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