aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven compiler plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven compiler plugin" Watch "maven compiler plugin" New topic
Author

maven compiler plugin

Michael Sampson
Ranch Hand

Joined: Sep 24, 2008
Posts: 30
So I had a post a while ago related to Maven after which I had given up and stopped trying to fix the problem and now I am back to the maven forum but with something else. So I was building example spring projects for a book and the maven informed me I needed to manually download 3 different jar files which I did. From there I got stuck with this error statement and this was with the -e switch.

BUILD FAILURE

Compilation failure
Failure executing javac, but could not parse the error:
javac: invalid target release: 2.2

Now there was supposed to be a whole lot more with this error posting but I kept getting this message from coderanch

We're sorry, but your post appears to contain abbreviations that we don't like people to use at the Ranch. Because JavaRanch is an international forum, many of our members are not native English speakers. For that reason, it's important that we all try to write clear, standard English, and avoid abbreviations and SMS shortcuts. See here for more of an explanation. Thanks for understanding.

If the abbreviation occurs within code, you can use code tags to post it successfully.

The specific error message is: "u" is a silly English abbreviation; use "you" instead.


I'm positive I wasn't doing this. Some days you just can't win. Anyway.

I had gone back and run mvn clean before this and still got the same error before I ran clean. The other error messages were useful providing some direction. From this one, I am thinking there must be some problem with the maven compiler plugin because it is the only element in my pom.xml file that has a version 2.2. What I do to fix this if it were the problem is a big mystery. There was something of a stack trace for this. I can try to post it if anyone thinks it'll help.



Mike
Michael Sampson
Ranch Hand

Joined: Sep 24, 2008
Posts: 30
OK, so I resolved this one. The book had several chapters and several projects with each chapter. So looking at a previous chapters' examples which I had working I noticed the working examples had versioning set as
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>

and the example not working correctly had
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>2.2</source>
<target>2.2</target>
</configuration>
</plugin>

changing that 2.2 to 1.5 fixed it. I hadn't read the whole book. May be the directions to do that are buried in the book some where.

Mike

manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
the configuration you mentioned are the version source/target settings for java itself. the highest released version for java is currently 1.6.


aldana software engineering blog & .more
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maven compiler plugin