Re: How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)
On Feb 17, 2011, at 5:41 PM, Andreas Tille wrote:
<snip>
> [INFO] ------------------------------------------------------------------------
> [INFO] Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.
> [INFO] ------------------------------------------------------------------------
> Or should I apply the pom.xml file which was suggested in an other
> mail in this thread? I simply tried:
>
Yes, you need a pom.xml in the root of a project for maven to do its mojo.
>
> /home/andreas/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/src/main/java/Patristic/PatristicTableModel.java:[48,3] annotations are not supported in -source 1.3
> (use -source 5 or higher to enable annotations)
> @Override
>
> /home/andreas/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/src/main/java/Patristic/tree/Node.java:[20,18] generics are not supported in -source 1.3
> (use -source 5 or higher to enable generics)
> private Vector<Node> children=new Vector<Node>();
> ...
>
>
> What does this mean?
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>
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.
Kind regards,
Thomas
Reply to: