Instead of "1.7" try simply "7". Dave Wolf Java Architect Gorilla Logic
-----Original Message----- From: Johannes.Lichtenberger [mailto:johannes.lichtenber...@uni-konstanz.de] Sent: Thu 1/5/2012 4:00 PM To: Maven Users List Subject: Re: Maven / Java 1.7 compliance On 01/05/2012 11:24 PM, Johannes.Lichtenberger wrote: > Hello, > > I want to package a maven-(multi)module, the parent pom includes: > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>2.3.2</version> > <configuration> > <source>${maven.compiler.source}</source> > <target>${maven.compiler.target}</target> > <encoding>${project.build.sourceEncoding}</encoding> > </configuration> > </plugin> > > I'm using Java 1.7 and the properties are specified as follows: > > <properties> > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > <maven.compiler.source>1.7</maven.compiler.source> > <maven.compiler.target>1.7</maven.compiler.target> > <slf4j.version>1.6.1</slf4j.version> > </properties> > The maven version is 2.2.1: > > johannes@luna:~/workspace/treetank/bundles/treetank-core$ mvn -version > Apache Maven 2.2.1 (rdebian-6) > Java version: 1.7.0 > Java home: /usr/lib/jvm/jdk1.7.0/jre > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux" version: "3.0.0-14-generic" arch: "amd64" Family: "unix" > > I have no clue why it doesn't use java version 1.7. When invoking mvn > package I get the error (use -source 7 or higher to enable diamond > operator) for instance. Do you know why it tries using 1.6? The effective POM is: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <executions> <execution> <id>default-testCompile</id> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </execution> <execution> <id>default-compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </execution> </executions> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> really strange :( --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received. DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives.