Hi,
the plugin must be under other tags.
Example:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
So your pom should look like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>patristic</groupId>
<artifactId>patristic</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Patristic</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.freehep</groupId>
<artifactId>freehep-graphics2d</artifactId>
<version>2.1.3</version>
</dependency>
</dependencies>
</project>
Olivier
Le 2/18/11 8:55 AM, Andreas Tille a écrit :
Hi,
On Thu, Feb 17, 2011 at 07:49:52PM +0100, Thomas Zeeman wrote:
It means the application is using two features of java (annotations and
generics to be precise) which are only supported in Java 5+. To fix this you
need to set the source property of the maven-compiler-plugin in the build
section of the pom to 1.5. It might also be necessary to set the target to 1.5
in this case. I.e like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
Please excuse for my ignorance but it seems that I need more detailed
advise. I applied this to the previosely suggested pom.xml (see
attachment) but now I get
$ $ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
POM Location:
/home/tillea/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/pom.xml
Reason: Parse error reading POM. Reason: Unrecognised tag: 'plugin' (position: START_TAG
seen ...</name>\n\n<plugin>... @10:13) for project unknown at
/home/tillea/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/pom.xml
Or update to a more recent version of maven or the compiler plugin. They've
updated the default for source and target to 1.5 for some time now.
I also have no idea how to follow this hint:
$ apt-cache policy maven2
maven2:
Installiert: 2.2.1-5
Kandidat: 2.2.1-5
Versionstabelle:
*** 2.2.1-5 0
501 http://debian.tu-bs.de/debian/ testing/main amd64 Packages
50 http://ftp.de.debian.org/debian/ unstable/main amd64 Packages
100 /var/lib/dpkg/status
What more recent version do you mean?
Thanks for your patience
Andreas.
--
gpg key id: 4096R/326D8438 (pgp.mit.edu)
Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438