You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by snowb0y <ga...@fnarg.net> on 2011/04/17 18:55:42 UTC
Maven refusing to compile Spring project due to annotations
I'm running Eclipse and Maven on a Mac. Here's my version of Maven
$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
Java version: 1.6.0_22
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"
What I'm trying to do is use Maven to compile my Spring project so I can
deploy the packaged war to a Tomcat. I setup my pom.xml (see below) and
asked mvn to create the package. The build failed with the following error:
Compilation failure
/path/to/WelcomeController.java:[7,1] annotations are not supported in
-source 1.3
(use -source 5 or higher to enable annotations)
@Controller
Doing mvn compile gives the same error. Google showed me that the
1.3-compiler-as-default was a known problem with Maven and I was happy to
find a fix explained here:
http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
But it's still not working ): In desperation I followed these instructions:
http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
and put a fresh maven on my Linux box. The build failed with the same error,
so it seems that my pom.xml is the culprit. But how? Here's the pom. Any
ideas welcome!
4.0.0
net.fnarg.twotrack
twotrack-webapp
war
1.0-SNAPSHOT
Twotrack Webapp
http://maven.apache.org
3.0.5.RELEASE
twotrack
apache-tomcat-twotrack
twotrack
twotrack
com.springsource.repository.bundles.release
SpringSource Enterprise Bundle Repository - SpringSource Bundle
Releases
http://repository.springsource.com/maven/bundles/milestone
com.springsource.repository.bundles.external
SpringSource Enterprise Bundle Repository - External Bundle
Releases
http://repository.springsource.com/maven/bundles/external
javax.servlet
jstl
1.2
javax.el
el-api
1.0
provided
org.apache.taglibs
com.springsource.org.apache.taglibs.standard
1.1.2
javax.servlet
servlet-api
2.5
provided
org.springframework
spring-context
${spring.version}
org.springframework
spring-web
${spring.version}
org.springframework
spring-webmvc
${spring.version}
junit
junit
3.8.1
test
org.apache.maven.plugins
maven-eclipse-plugin
1.6
1.6
twotrack
src/main/resources
true
src/main/webapp
true
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-refusing-to-compile-Spring-project-due-to-annotations-tp4309204p4309204.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Re: Maven refusing to compile Spring project due to annotations
Posted by snowb0y <ga...@fnarg.net>.
Hi Manuel,
Well seen! Worked straight away. Thanks for your post.
snowb0y
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-refusing-to-compile-Spring-project-due-to-annotations-tp4309204p4309761.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven refusing to compile Spring project due to annotations
Posted by Manuel Doninger <ma...@doninger.net>.
> org.apache.maven.plugins
> maven-eclipse-plugin
>
> 1.6
> 1.6
>
Well, you should use the maven-compiler-plugin as described in
http://maven.apache.org/plugins/maven-compiler-plugin/howto.html, not
the maven-eclipse-plugin.
Manuel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Maven refusing to compile Spring project due to annotations
Posted by Martin Gainty <mg...@hotmail.com>.
the solution is accomplished by following the instructions in the displayed error message
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk
export PATH=$JAVA_HOME/bin:$PATH
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Sun, 17 Apr 2011 09:55:42 -0700
> From: gavin@fnarg.net
> To: users@maven.apache.org
> Subject: Maven refusing to compile Spring project due to annotations
>
> I'm running Eclipse and Maven on a Mac. Here's my version of Maven
>
>
> $ mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
> Java version: 1.6.0_22
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"
>
>
> What I'm trying to do is use Maven to compile my Spring project so I can
> deploy the packaged war to a Tomcat. I setup my pom.xml (see below) and
> asked mvn to create the package. The build failed with the following error:
>
>
> Compilation failure
> /path/to/WelcomeController.java:[7,1] annotations are not supported in
> -source 1.3
> (use -source 5 or higher to enable annotations)
> @Controller
>
>
> Doing mvn compile gives the same error. Google showed me that the
> 1.3-compiler-as-default was a known problem with Maven and I was happy to
> find a fix explained here:
>
> http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
> http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
>
>
> But it's still not working ): In desperation I followed these instructions:
>
>
> http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
> http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
> and put a fresh maven on my Linux box. The build failed with the same error,
> so it seems that my pom.xml is the culprit. But how? Here's the pom. Any
> ideas welcome!
>
>
>
>
> 4.0.0
> net.fnarg.twotrack
> twotrack-webapp
> war
> 1.0-SNAPSHOT
> Twotrack Webapp
> http://maven.apache.org
>
>
> 3.0.5.RELEASE
> twotrack
> apache-tomcat-twotrack
> twotrack
> twotrack
>
>
>
>
> com.springsource.repository.bundles.release
> SpringSource Enterprise Bundle Repository - SpringSource Bundle
> Releases
> http://repository.springsource.com/maven/bundles/milestone
>
>
> com.springsource.repository.bundles.external
> SpringSource Enterprise Bundle Repository - External Bundle
> Releases
> http://repository.springsource.com/maven/bundles/external
>
>
>
>
>
> javax.servlet
> jstl
> 1.2
>
>
> javax.el
> el-api
> 1.0
> provided
>
>
> org.apache.taglibs
> com.springsource.org.apache.taglibs.standard
> 1.1.2
>
>
> javax.servlet
> servlet-api
> 2.5
> provided
>
>
> org.springframework
> spring-context
> ${spring.version}
>
>
> org.springframework
> spring-web
> ${spring.version}
>
>
> org.springframework
> spring-webmvc
> ${spring.version}
>
>
> junit
> junit
> 3.8.1
> test
>
>
>
>
>
>
> org.apache.maven.plugins
> maven-eclipse-plugin
>
> 1.6
> 1.6
>
>
>
> twotrack
>
>
> src/main/resources
> true
>
>
> src/main/webapp
> true
>
>
>
>
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-refusing-to-compile-Spring-project-due-to-annotations-tp4309204p4309204.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
Re: Maven refusing to compile Spring project due to annotations
Posted by snowb0y <ga...@fnarg.net>.
Hi Jeff,
Thanks for reply. It's the same error with these 3 variations.
<configuration>
<wtpversion>1.5</wtpversion>
</configuration>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
The pom used to have a parent from a repo at my place of work. My goal is to
get the build working without the parent as this isn't a work project. But
then the compile error kicked in ..
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-refusing-to-compile-Spring-project-due-to-annotations-tp4309204p4309745.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven refusing to compile Spring project due to annotations
Posted by Jeff MAURY <je...@jeffmaury.com>.
What kind of error do you have once you set the source and target parameter
of the maven compiler plugin to 1.5 ?
Jeff
On Sun, Apr 17, 2011 at 6:55 PM, snowb0y <ga...@fnarg.net> wrote:
> I'm running Eclipse and Maven on a Mac. Here's my version of Maven
>
>
> $ mvn -version
> Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
> Java version: 1.6.0_22
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"
>
>
> What I'm trying to do is use Maven to compile my Spring project so I can
> deploy the packaged war to a Tomcat. I setup my pom.xml (see below) and
> asked mvn to create the package. The build failed with the following error:
>
>
> Compilation failure
> /path/to/WelcomeController.java:[7,1] annotations are not supported in
> -source 1.3
> (use -source 5 or higher to enable annotations)
> @Controller
>
>
> Doing mvn compile gives the same error. Google showed me that the
> 1.3-compiler-as-default was a known problem with Maven and I was happy to
> find a fix explained here:
>
> http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
> http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
>
>
> But it's still not working ): In desperation I followed these instructions:
>
>
>
> http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
>
> http://pwong-tipsandtricks.blogspot.com/2009/02/install-and-test-maven-on-centos-52.html
> and put a fresh maven on my Linux box. The build failed with the same
> error,
> so it seems that my pom.xml is the culprit. But how? Here's the pom. Any
> ideas welcome!
>
>
>
>
> 4.0.0
> net.fnarg.twotrack
> twotrack-webapp
> war
> 1.0-SNAPSHOT
> Twotrack Webapp
> http://maven.apache.org
>
>
> 3.0.5.RELEASE
> twotrack
> apache-tomcat-twotrack
> twotrack
> twotrack
>
>
>
>
> com.springsource.repository.bundles.release
> SpringSource Enterprise Bundle Repository - SpringSource Bundle
> Releases
> http://repository.springsource.com/maven/bundles/milestone
>
>
> com.springsource.repository.bundles.external
> SpringSource Enterprise Bundle Repository - External Bundle
> Releases
> http://repository.springsource.com/maven/bundles/external
>
>
>
>
>
> javax.servlet
> jstl
> 1.2
>
>
> javax.el
> el-api
> 1.0
> provided
>
>
> org.apache.taglibs
> com.springsource.org.apache.taglibs.standard
> 1.1.2
>
>
> javax.servlet
> servlet-api
> 2.5
> provided
>
>
> org.springframework
> spring-context
> ${spring.version}
>
>
> org.springframework
> spring-web
> ${spring.version}
>
>
> org.springframework
> spring-webmvc
> ${spring.version}
>
>
> junit
> junit
> 3.8.1
> test
>
>
>
>
>
>
> org.apache.maven.plugins
> maven-eclipse-plugin
>
> 1.6
> 1.6
>
>
>
> twotrack
>
>
> src/main/resources
> true
>
>
> src/main/webapp
> true
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-refusing-to-compile-Spring-project-due-to-annotations-tp4309204p4309204.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
--
"Legacy code" often differs from its suggested alternative by actually
working and scaling.
- Bjarne Stroustrup
http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury