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

Can't pass --module-path argument to the compiler. #40

Open
DanielChicot opened this issue May 25, 2018 · 4 comments
Open

Can't pass --module-path argument to the compiler. #40

DanielChicot opened this issue May 25, 2018 · 4 comments

Comments

@DanielChicot
Copy link

DanielChicot commented May 25, 2018

In order to build a java 9/10 module based aspect j project with maven I need to add aspectjrt.jar to the module path. The ajc compiler has the --module-path option e.g.:

ajc --module-path c:/opt/aspectj1.9/lib/aspectjrt.jar ...

but I can't seem to get the aspectj-maven-plugin to pass this through to the compiler.

aspectj-maven compiler version 1.11.
aspectj version 1.9.1

Note that I can get around this with the ASPECTJ_OPTS environment variable, e.g.

$ export ASPECTJ_OPTS="--module-path c:/opt/aspectj1.9/lib/aspectjrt.jar"
$ mvn aspectj:compile

@mojo2012
Copy link
Contributor

mojo2012 commented Nov 7, 2018

Is there any news on this? It kinda seems like this project is stale (dead?). How come?

@mojo2012
Copy link
Contributor

mojo2012 commented Nov 9, 2018

I opened a PR with fix toallow to pass arbitrary command line arg to the compiler.
Please merge ASAP

@Dominique88
Copy link

Dominique88 commented Nov 14, 2023

I have this problem.

11:03:13.013 [ERROR] AjcCompileMojo - The package org.w3c.dom is accessible from more than one module: , java.xml

<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.14.0</version>

with

<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.7</version>
  <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.14.0</version>
                <configuration>
                    <complianceLevel>11</complianceLevel>
                    <source>8</source>
                    <target>11</target>
                    <showWeaveInfo>true</showWeaveInfo>
                    <verbose>true</verbose>
                    <Xlint>ignore</Xlint>
                    <encoding>UTF8</encoding>
                    <excludes>
                        <exclude>**/package-info.java</exclude>
                    </excludes>
                    <aspectLibraries>
                        <aspectLibrary>
                            <groupId>org.tst</groupId>
                            <artifactId>tst-metrics</artifactId>
                        </aspectLibrary>
                    </aspectLibraries>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

@kriegaex
Copy link
Collaborator

kriegaex commented Nov 14, 2023

A couple of years ago, my PR #100 was not merged, but as a maintainer of both AspectJ and https://github.com/dev-aspectj/aspectj-maven-plugin, I added basic support for --module-path back then. Look for option javaModules there. If you have any problems, please open an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants