microsoft / microsoft/kiota-java
#1786 breaks compilation with Eclipse compiler
- Dominant language
- Java
- Stars
- 38
- Forks
- 34
- Avg merge
- 15h 9m
- Merged PRs (30d)
- 20
Description
https://github.com/microsoft/kiota-java/pull/1786 causes compilation of projects with Eclipse compiler to fail:
```
[ERROR] Failed to execute goal dev.aspectj:aspectj-maven-plugin:1.14:test-compile (default) on project kiota-xml: AJC compiler errors:
[ERROR] error at
[ERROR] import javax.xml.stream.XMLInputFactory;
[ERROR] ^^^^^^^^^^^^^^^^
[ERROR] /kiota-xml/src/test/java/com/example/kiota/xml/Foobar.java:3:0::0 The package javax.xml.stream is accessible from more than one module: , java.xml
[ERROR] error at
[ERROR] System.out.println(XMLInputFactory.newInstance().getClass().getName());
[ERROR] ^^^^^^^^^^^^^^^
[ERROR] /kiota-xml/src/test/java/com/example/kiota/xml/Foobar.java:9:0::0 XMLInputFactory cannot be resolved
```
It compiles fine with the standard Maven compiler plugin. The error is caused by the addition of `api 'javax.xml.stream:stax-api:1.0-2'`. An exclusion can be used as a workaround.
```java
package com.example.kiota.xml;
import javax.xml.stream.XMLInputFactory;
public class Foobar {
public static void main( String[] args ) {
System.out.println(XMLInputFactory.newInstance().getClass().getName());
}
}
```
```xml
4.0.0
com.example
kiota-xml
1.0-SNAPSHOT
1.9.22.1
21
21
UTF-8
com.microsoft.kiota
microsoft-kiota-authentication-azure
1.8.8
org.aspectj
aspectjrt
${aspectj.version}
dev.aspectj
aspectj-maven-plugin
1.14
21
compile
test-compile
org.aspectj
aspectjrt
${aspectj.version}
org.aspectj
aspectjtools
${aspectj.version}
```
Contributor guide
Research direction
Start by reviewing pull request #1786 and the dependency declarations that added javax.xml.stream:stax-api:1.0-2. Reproduce the failure with the dev.aspectj:aspectj-maven-plugin test-compile goal and compare it with the standard Maven compiler. Done means projects using the Eclipse compiler compile without the duplicate java.xml module error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100