3

I would like to run the Maven project that I have on https://github.com/ihsanhaikalz/testMaven in the Eclipse 4.5 (Mars) but it gave me an error in the pom.xml as follow:

1 problem was encountered while building the effective model for
 org.codehaus.mojo:aspectj-maven-plugin:1.8 [ERROR] 
'dependencies.dependency.systemPath' for com.sun:tools:jar must specify an
 absolute path but is ${toolsjarSystemPath} @

I already installed AJDT for Eclipse 4.5 through http://download.eclipse.org/tools/ajdt/45/dev/update and when I pulled from my github the Eclipse started to download Maven plugin connectors and Maven integration for AJDT but the error is still there. I already tried follow this and this still no luck.

Here is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>testMaven</groupId>
    <artifactId>testMaven</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <properties>

        <java.version>1.8</java.version>
        <aspectj.version>1.8.9</aspectj.version>
        <!-- Maven Plugin Versions -->
        <maven.compiler.plugin.version>3.2</maven.compiler.plugin.version>

    </properties>

    <repositories>
        <repository>
            <id>anon.inf.tu-dresden.de-snapshots</id>
            <url>http://anon.inf.tu-dresden.de/artifactory/repo/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
    </dependencies>

    <build>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.8</version>
                <configuration>
                    <complianceLevel>${java.version}</complianceLevel>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <showWeaveInfo>true</showWeaveInfo>
                </configuration>
                <executions>
                    <execution>
                        <id>AspectJ-Classes</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>AspectJ-Test-Classes</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

    </build>
</project>

Any help is appreciated. Thanks

Community
  • 1
  • 1
Ihsan Haikal
  • 1,085
  • 4
  • 16
  • 42
  • Is your java home properly set? – uniknow Jun 26 '16 at 07:44
  • @uniknow yes I did already set my java home to the jdk I used in the environment variable but still error – Ihsan Haikal Jun 27 '16 at 22:25
  • Did you ever get past this? I have the same issue... – Dave Jul 08 '16 at 16:18
  • @HDave in the end I just change the plugin version to 1.7 instead 1.8 and it works fine with my project, but ultimately did not solve this problem – Ihsan Haikal Jul 10 '16 at 12:34
  • 4
    I found a bug in the plugin's Maven configuration and fixed it. Cross your fingers that my [pull request](https://github.com/mojohaus/aspectj-maven-plugin/pull/19) will get into the next release. – kriegaex Sep 25 '16 at 12:50
  • Possible duplicate of [error upgrading aspectj-maven-plugin v1.8](http://stackoverflow.com/questions/32997222/error-upgrading-aspectj-maven-plugin-v1-8) – kriegaex Dec 04 '16 at 11:10

1 Answers1

3

In the end I could not solve this problem 100% but I found an alternative solution to this problem by changing the aspectj-maven-plugin's version from 1.8 to 1.7. Here is the excerpt of the new pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.7</version>
    <configuration>
           <complianceLevel>${java.version}</complianceLevel>
           <source>${java.version}</source>
           <target>${java.version}</target>
           <showWeaveInfo>true</showWeaveInfo>
    </configuration>
    <executions>
           <execution>
                 <id>AspectJ-Classes</id>
                 <phase>process-classes</phase>
                 <goals>
                    <goal>compile</goal>
                 </goals>
           <execution>
   <execution>
   <id>AspectJ-Test-Classes</id>
   <phase>process-test-classes</phase>
   <goals>
       <goal>test-compile</goal>
       </goals>
   </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
Ihsan Haikal
  • 1,085
  • 4
  • 16
  • 42