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-16-2011, 09:29 PM
Torsten Werner
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

Hi Andreas,

On Wed, Feb 16, 2011 at 11:03 PM, Andreas Tille <andreas@an3as.eu> wrote:
> I'm actually not very keen on really using maven as long as I can
> get the package working at all - but I actually have no real clue
> what command line would trigger the build process (and upstream)
> seems to be dead. *So in principle the most simple help would be
> a command line which builds the JAR.

are you looking for 'mvn package'?

Cheers,
Torsten


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=1+fAAGFHzL98H5eoXiMn7NyX3-g0VHV7eLimx@mail.gmail.com">http://lists.debian.org/AANLkTi=1+fAAGFHzL98H5eoXiMn7NyX3-g0VHV7eLimx@mail.gmail.com
 
Old 02-16-2011, 09:31 PM
"Manfred Moser"
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

> Hi,
>
> inspired by some hints about Java packaging I tried another package. It
> is called patristic[1] (just another biological phylogeny software). It
> comes just with a directory full of *.java files and the binary download
> just tells in what directory layout the classes should end up. Chances
> to contact upstream seem low (Homepage mentioned on the scientific
> publication page[2] is not available any more). So I decided to start
> some maven training and did
>
> mvn archetype:generate -DgroupId=Patristic -DartifactId=patristic
> -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
>
> as it is suggested here[3]
>
>> Anyway, unfortunately, you still have to put hands on upstream's code,
>> because maven requires the projects it's working on to have a specific
>> directory structure.
>
> That's fine in the case of patristic - I'd need to repack the code in
> any case - so why not applying the maven directory layout?
>
> I'm actually not very keen on really using maven as long as I can
> get the package working at all - but I actually have no real clue
> what command line would trigger the build process (and upstream)
> seems to be dead. So in principle the most simple help would be
> a command line which builds the JAR.

Maven is the easiest way. Put all those files into the src/main/java
folder of the created folder with the pom.xml file and run

mvn clean install

You should get a jar in the target folder.


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 15e3da124802332c1b5a2dc868af8b67.squirrel@www.mosa buam.com">http://lists.debian.org/15e3da124802332c1b5a2dc868af8b67.squirrel@www.mosa buam.com
 
Old 02-16-2011, 10:38 PM
Giovanni Mascellani
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

Hi.

On 16/02/2011 23:03, Andreas Tille wrote:
> mvn archetype:generate -DgroupId=Patristic -DartifactId=patristic -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
>
> as it is suggested here[3]

There's something funny about this command: I executed it and it had to
download about 30 different files before being able to do something
really dump (copy some simple templates in the working directory).

>> Anyway, unfortunately, you still have to put hands on upstream's code,
>> because maven requires the projects it's working on to have a specific
>> directory structure.
>
> That's fine in the case of patristic - I'd need to repack the code in
> any case - so why not applying the maven directory layout?

Actually I checked it, and this is not really necessary: you can
configure it[1]. Anyway, I really think that it's better to user
standard layout, to make your more idiomatic for others.

[1] http://maven.apache.org/pom.html#Directories

> I'm actually not very keen on really using maven as long as I can
> get the package working at all - but I actually have no real clue
> what command line would trigger the build process (and upstream)
> seems to be dead. So in principle the most simple help would be
> a command line which builds the JAR.

As Torsten suggests, once you have your working POM the command you need
in "mvn package".

Here[2] you can a sample POM package for patristic, which unfortunately
doesn't compile because of missing dependencies I don't know where to get.

[2] http://people.debian.org/~gio/packages/patristic-maven.tar.gz

BTW, working on this just made me notice that some new versions of
FreeHEP were released some months ago. These releases were deployed on
maven repositories, but I didn't notice them because they were not
deployed on the site where development happened before. This is one of
the many things I don't like of maven: it doesn't teach developers to
have clean and clear release cycle and habits (for instance, where to
publish the release), because the magic of maven will (try to) solve any
problem.

Ciao, Giovanni.
--
Giovanni Mascellani <mascellani@poisson.phc.unipi.it>
Pisa, Italy

Web: http://poisson.phc.unipi.it/~mascellani
Jabber: g.mascellani@jabber.org / giovanni@elabor.homelinux.org
 
Old 02-16-2011, 10:56 PM
"Manfred Moser"
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

> BTW, working on this just made me notice that some new versions of
> FreeHEP were released some months ago. These releases were deployed on
> maven repositories, but I didn't notice them because they were not
> deployed on the site where development happened before. This is one of
> the many things I don't like of maven: it doesn't teach developers to
> have clean and clear release cycle and habits (for instance, where to
> publish the release), because the magic of maven will (try to) solve any
> problem..

Hm.. I think the opposite is true. Release go to Maven central and not
some website somewhere on the net. That way as a developer you dont have
to worry about manually downloading from all over the place and monitoring
sites all over the place. Maven encourages and supports proper process...
but many people still just hack away..

manfred


--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: f8941cb430fd76eceb35dbbd2e388a58.squirrel@www.mosa buam.com">http://lists.debian.org/f8941cb430fd76eceb35dbbd2e388a58.squirrel@www.mosa buam.com
 
Old 02-17-2011, 05:49 PM
Thomas Zeeman
 
Default 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

--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 8BAC46C8-1218-476F-8414-58D7BE5F0860@xs4all.nl">http://lists.debian.org/8BAC46C8-1218-476F-8414-58D7BE5F0860@xs4all.nl
 
Old 02-18-2011, 07:47 PM
Thomas Zeeman
 
Default How to apply maven build system (Was: How to use Debian packaged freehep instead of upstream provided freehep.jar)

Hi,

On Feb 18, 2011, at 8:55 AM, Andreas Tille wrote:

> Hi,
>
> 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

Sorry, my bad. I thought you had a bit more knowledge about maven pom files.

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

Hm. Weird I thought Maven 2.2.1 already contained a recent enough default of the maven-compiler-plugin in its super-pom. The source appears to suggest as much (http://svn.apache.org/viewvc/maven/maven-2/tags/maven-2.2.1/pom.xml?view=markup) maybe adding a version to the compiler plugin broke it.

Anyway. You're not using one of the 2.0.x or 2.1.x versions I assumed you were running. Version 2.2.1 is the latest 2.x release and you don't want to try maven 3 yet. Too many 3rd-party plugins need to be fixed still, not to mention applications. So don't worry about upgrading yet.

Kind regards,
Thomas

--
To UNSUBSCRIBE, email to debian-java-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5051FAC6-8D4E-44FB-92EB-7E45CFA49170@xs4all.nl">http://lists.debian.org/5051FAC6-8D4E-44FB-92EB-7E45CFA49170@xs4all.nl
 

Thread Tools




All times are GMT. The time now is 08:47 AM.

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