Two Maven errors - "The type cannot be resolved" + aspect weaver.1.8.0.M1 is missing

I have two errors in an existing mvm project that I am trying to build and do not know how to solve it.

First the main one :

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.5:compile (default) on project ws: Compiler errors:
The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files

      

I'm kidding a little, I mean this is from the main JRE, so I'm not sure what this error means. I am building this from the command line, not through Eclipse or other IDEs at this point. Most of the answers on the web seem to be based on placing the JRE in the path of building the project in eclipse.

I have Java 1.8 installed, running on OSX. My Java Source + Target version is 1.7.

Second warning I didn't fuss too much, but I would like to remove it if I can:

[WARNING] The POM for org.aspectj:aspectjweaver:jar:1.8.0.M1 is missing, no dependency information available

      

Now I believe this comes from Spring-Aspects-4.0 which I depend on, I have set the clear decency in the POM to 1.7.4 (stable).

Anyway, I can remove this warning or I need to install a 1.8.0.M1 dependency on my POM, which I don't want to do.

+3


source to share


1 answer


So after a lot of rework, it seems the problem is that the framework it was built on was installed JDK 8 and the aspectjweaver version was not compatible with it.

Therefore two solutions:

  • Install JDK7 and set it as JAVA_HOME before building.


or

  • Set source / target to 1.8, set aspectjweaver to 1.8.1 and it will work.

The error message was not clear, but it is now sorted.

+9


source







All Articles