4

I have a project that uses aspectj-maven-plugin:

org.codehaus.mojo aspectj-maven-plugin 1.8

In eclipse(mars) I try to import the project as a maven project but I get error below.

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 have tried adding toolsjarSystemPath to my properties in my Settings.xml. No luck. I have tried adding "-vm C:\Program Files\Java\jdk1.7.0_79\lib" to eclipse.ini. Again, no luck. Does anyone know any other solutions for this problem? I have set my JAVA_HOME to: "C:\Program Files\Java\jdk1.7.0_79"

I have no clue anymore... The solutions of [error upgrading aspectj-maven-plugin v1.8

[1]: error upgrading aspectj-maven-plugin v1.8 don't work

kriegaex
  • 63,017
  • 15
  • 111
  • 202
bobK
  • 704
  • 2
  • 7
  • 24

2 Answers2

7

As I already wrote in another answer (but StackOverflow answers which are just links get deleted, so I repeat myself here):

I found a problem in AspectJ Maven plugin and fixed it. My pull request was finally merged and is contained in the new plugin version 1.9. Just upgrade your POM and enjoy.

P.S.: The real problem is in Eclipse, but it was easier to put a workaround into the Maven plugin than to get it fixed upstream.

Community
  • 1
  • 1
kriegaex
  • 63,017
  • 15
  • 111
  • 202
  • Upgrading to AspectJ plugin 1.9 (from 1.8) in Spring Tool Suite 3.9 fixed this issue on my project. Thanks. – CatsAndCode Aug 28 '17 at 18:23
  • @kriegaex doesn't work for me though:\ using java 10 – Dmitry Senkovich Aug 01 '18 at 15:46
  • My answer is from 2016, Java 10 is from 2018. So you better update to AspectJ Maven 1.11 and, more importantly, override the AspectJ dependencies in the plugin so as to use AspectJ 1.9.1, which is still mainly a Java 9 release (thus the version 1.9), but includes some preparations for Java 10 already, e.g. you can use `var` declarations. BTW, "doesn't work for me" is not a helpful error description. If my hints here do not help you, please do not reply here but open a new question with a concrete error description and an [MCVE](http://stackoverflow.com/help/mcve) instead of hijacking this one. – kriegaex Aug 02 '18 at 02:44
  • Flag the question as a duplicate, don't copy-paste your own answer........... – Michael May 16 '19 at 16:06
  • Thanks for lecturing me on a question which is already 2.5 years old and for recommending me to flag a duplicate which I also did 2.5 years ago (see my automatically generated comment under the question!), but to which nobody reacted. So I think it is a good thing to have a correct answer here in order to counter-balance the accepted one which is actually wrong because it only works around a symptom. – kriegaex May 17 '19 at 00:13
  • Ah, and because you don't like my comment that I did what you suggested (flag as duplicate) already, you just gave me two downvotes here and in the other question. Thank you so much, good job. Usually people around here try to help one another and be nice. I see from your badges that you like to edit questions and do other clean-up work here, that's great community work. But lecturing me was not necessary. – kriegaex May 17 '19 at 03:28
4

What worked for me, was removing all JRE's and only have a JDK installed. This removed the problem, as apparently Eclipse uses the JRE by default.

bobK
  • 704
  • 2
  • 7
  • 24
  • 1
    Thanks, I just switched eclipse's default JRE path to the JDK (rather than using the JRE inside the JDK). Maven was using eclispe default JRE. – Asoub Apr 05 '18 at 13:26