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 <[email protected]> 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

Reply via email to