Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml #104

Closed
finalcreator opened this issue Aug 26, 2022 · 6 comments
Assignees
Labels
invalid This doesn't seem right waiting_for_response The maintainer has requested additional information and is waiting for same
Milestone

Comments

@finalcreator
Copy link

finalcreator commented Aug 26, 2022

Failed when running mvn clean install under JDK 11

[ERROR] The package javax.xml.stream is accessible from more than one module: , java.xml
[ERROR] XMLStreamException cannot be resolved to a type

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                    <version>${lombok.version}</version>
                                </path>
                            </annotationProcessorPaths>
        <compilerArgs>
                                    <arg>--add-exports</arg>
                                    <arg>java.xml/com.sun.org.apache.xerces.internal.jaxp.datatype=ALL-UNNAMED</arg>
        </compilerArgs>
        <fork>true</fork>
    </configuration>
</plugin>

 <plugin>
                        <groupId>dev.aspectj</groupId>
                        <artifactId>aspectj-maven-plugin</artifactId>
                        <version>1.13.1</version>
                        <configuration>
                            <complianceLevel>${java.version}</complianceLevel>
                            <source>${java.version}</source>
                            <target>${java.version}</target>
                            <showWeaveInfo>true</showWeaveInfo>
                            <verbose>true</verbose>
                            <Xlint>ignore</Xlint>
                           <forceAjcCompile>true</forceAjcCompile>
                           <weaveDirectories>
                                <weaveDirectory>${project.build.directory}/classes</weaveDirectory>
                            </weaveDirectories>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
@kriegaex
Copy link
Contributor

Please post a link to a full sample project on GitHub. It should be minimal, but complete, so I can reproduce the problem. This is called an MCVE. Thank you.

@kriegaex kriegaex added the waiting_for_response The maintainer has requested additional information and is waiting for same label Aug 27, 2022
@kriegaex kriegaex self-assigned this Aug 27, 2022
@finalcreator
Copy link
Author

for simplicity, do we have example for "maven configure" for lombok&aspectj, and jetty&aspectj? (java 11 or later)

@kriegaex
Copy link
Contributor

kriegaex commented Aug 30, 2022

I asked you for an MCVE. So the answer cannot be that you ask me for one instead. If you like to get help and think there is a bug in the plugin, you need to make it easy for me to reproduce your problem, not for me to create a build-to-order MCVE for you. Feel free to hire me if you need that kind of service, though.

@finalcreator
Copy link
Author

The actual situation is that the project dependencies are more complex and there is no way to simplify them, so I think if there is a standard reference project, maybe I can solve it myself.
That's why I asked if there were any relevant examples.

@finalcreator
Copy link
Author

The error is:
The package org.w3c.dom is accessible from more than one module: , java.xml

I tried to add -add-exports but didn't work, is this configure correct?

--add-exports
java.xml/org.w3c.dom=ALL-UNNAMED

@kriegaex
Copy link
Contributor

kriegaex commented Sep 3, 2022

The actual situation is that the project dependencies are more complex and there is no way to simplify them

That statement is unworthy of a developer. You can always simplify. Just strip off as much as possible, until only as much is left as is necessary to reproduce the problem. If I cannot reproduce your problem, I cannot help you. I do not feel so inclined to try and guess what kind of undisclosed situation you might have. I am closing this question as invalid. If you change your mind and provide an MCVE, we can re-open it.

@kriegaex kriegaex closed this as completed Sep 3, 2022
@kriegaex kriegaex added this to the Release 1.14 milestone Sep 3, 2022
@kriegaex kriegaex added the invalid This doesn't seem right label Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right waiting_for_response The maintainer has requested additional information and is waiting for same
Projects
None yet
Development

No branches or pull requests

2 participants