FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Java

 
 
LinkBack Thread Tools
 
Old 02-17-2011, 03:41 PM
Andreas Tille
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

On Wed, Feb 16, 2011 at 11:29:52PM +0100, Torsten Werner wrote:
> are you looking for 'mvn package'?

$ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.2/maven-resources-plugin-2.2.pom
...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18 seconds
[INFO] Finished at: Thu Feb 17 09:04:14 GMT 2011
[INFO] Final Memory: 12M/26M
[INFO] ------------------------------------------------------------------------


Or should I apply the pom.xml file which was suggested in an other
mail in this thread? I simply tried:

$ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building patristic
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/andreas/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/src/main/resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 35 source files to /home/andreas/debian-maintain/todo/0_debian-med_todo/0phylogeny/patristic/maven/patristic-20100817/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/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?

Thanks for any help

Andreas.

--
http://fam-tille.de


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110217164122.GF20776@an3as.eu">http://lists.debian.org/20110217164122.GF20776@an3as.eu
 
Old 02-18-2011, 06:55 AM
Andreas Tille
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

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>

<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.

--
http://fam-tille.de
 
Old 02-18-2011, 07:33 AM
Olivier Sallou
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

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>

<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
 

Thread Tools




All times are GMT. The time now is 12:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org