Maven, and two issues

Started by cfmdobbie, September 29, 2003, 00:10:23

Previous topic - Next topic

cfmdobbie

I'm currently using Maven for work purposes, and am very impressed with it.  Bored on a Sunday evening I decided to get it working with LWJGL, and the results are pretty good!  However, it did kick up two issues I should mention:

org\lwjgl\openal\CoreAL.java:703:  A single CTRL-B has made it into some Javadoc.  Currently breaks Maven's checkstyle plugin.

Most/all Java source files:  Recommend putting the $Id$ line in each Javadoc comment at the end.  Currently the lines appear in package summary and index pages, and JDK1.4.2's Javadoc doclet complains about them.

Have you thought about using Maven either as a project build tool or for just generating various project statistics?
ellomynameis Charlie Dobbie.

Matzon

uhm...

/me goes off to read about Maven

cfmdobbie

http://www.maven.org/

It's a Java-orientated project build system - it's the next layer up from Ant and uses Ant internally but the developer doesn't need to worry about writing tasks etc.  You provide a project.xml file which tells it a few details like where the source code is and what libraries you're using, and it handles the rest - it knows how to compile code, make distributions, compile reports etc.  Grab the files I created here:

http://www.padcroft.org/cfmdobbie/files/lwjgl-maven/

And chuck them into your LWJGL directory.  Install the latest Maven binaries from here:

http://maven.apache.org/builds/release/1.0-beta-10/

Add the bin directory to your PATH and set a MAVEN_HOME environment variable if necessary.  Open a command prompt in your LWJGL directory and type for example:

maven jar

I was just playing with it so it's not complete but you can see the potential if you try the following as well:

maven dist
maven site

At each step wander through the ./target directory to see what's been done.  I'm so impressed with it, all my Java projects will be using it from now on.  Enjoy!
ellomynameis Charlie Dobbie.

wondersonic

The new version of maven (maven 2) really rocks:
- simpler (only 5 main goals)
- more stable
- handles multi sub projects with dependence transitivity
...

I use it for my new project and I was wondering if lwjgl could be available in a shared repository such as http://www.ibiblio.org/maven2/ :?:
S.

Matzon

though it all sounds neat, I fail to see what issues we have that it solves ?

wondersonic

Okay, I'm not saying you have any issues. I'm just saying that maven 2 is here and handles many things better than maven; this was just an answer to "/me goes off to read about Maven"  :wink:

By the way, I took a very quick look at the sources of LWJGL and I couldn't find a test directory with testcases inside (at least concerning the Java API).

Anyway if you are curious, try these links:
- http://maven.apache.org/guides/getting-started/index.html#What%20is%20Maven?,
- http://maven.apache.org/benefits-of-using-maven.html


About the ibiblio.org part, I don't know how to do it but I'm sure that a maven 1 & 2 repository would be appreciated in order to download and install on one local repository the jars and other files of LWJGL without having to fight with the sourceforge download system (a minimum of 10 clicks to get all the archives).

If you don't have experienced the power of the maven 2 dependencies, I recommand you to try (I can help by providing a simple project.xml file). For example, I've downloaded the 0.98-1 release this weekend and just now (good job :wink:) I've to download the 0.99... If a repository was available all I would have to do would be to replace 8-1 by 9 in my project.xml file (and all the new dependencies would be automatically downloaded on my next project build).

Anyway, it is late so I've to leave.
And long live to LWJGL!!!!!!!!!!!!!!!
S.

oak

I am currently switching our build system to maven, and was sad to find that LWJGL was not found in the central repository. If at all possible, please add it there:

http://maven.apache.org/guides/mini/guide-central-repository-upload.html

I know that this might seem uninteresting but at least JME are adding maven2 support, Project Darkstar are moving to maven also - and there is good Netbeans and Eclipse integration. Having tried it only for two days (and almost completely "ported" 19 inter-depending projects) I can only say I am impressed with its ease of use.
ove Zig !

Matzon

Personally I have no intention of using Maven, nor do I want to spend an exorbitant amount of time to get acquainted with it. The lwjgl distribution is more than a lwjgl.jar, and as such the pom file would need a lot of work.
If we were to use any dependency management, it would probably be Ivy - however we don't really have any dependencies that are locatable in any repository.

Matzon

please see our irc discussion here:
http://echelog.matzon.dk/logs/browse/lwjgl/1214085600 - starting at [01:40:24]

I'd like to see:

  • create a script that generates and re-packages a std. lwjgl distribution into something maven compatible
  • upload said package
  • create a maven project, which just declares a <dependency> on lwjgl
  • run it without any interaction
Where I see this failing is:
How do the maven bundle handle native files?
How does maven add things to the library path?
How does maven know which path has the relevant native files for the running os?

Of course, this is all just for projects that depend on lwjgl. We have no plans to build lwjgl under maven.

SSG

I have read the irc log and void256 raised a good point: The solution doesn't need to be perfect - you can simply package and upload the jar without any native libraries because this will allow us to at least build against it. We can be left responsible for putting the native libs in the right place at runtime. People will be smart enough to find out they have to do this after googling for UnsatisfiedLinkError.

From my own experience, dealing with native dependencies in this way isn't difficult at all. Typically I place these in the src/main/resources directory and run development versions of the build without packaging everything into a jar. When it comes time to deploy, I simply take the jar-with-dependencies (built with the assembly plugin) and use WinRar to remove the native libraries which I bundle alongside the jar.

Let's take the first step by uploading the jar and figuring out a better solution if we need to later.

Maven rocks!

pmy

+1 for maven support.

Found this thread after watching this: Quake II in the *Chrome web browser*, using GWT+LWJGL to help port Jake2 to WebGL:

  http://www.youtube.com/watch?v=aW--Wlf9EFs

Starting at 19:30.  After demoing it, at about 24:00 (and later), they make the point that dealing with the complexity required strong transitive dependency analysis support to manage the multiple code bases.

I'm going to try a similar pseudo-port of a 3d app to the browser, and have started it using maven.  It's really speeding me up and I would definitely appreciate being able to include a dep on lwjgl.