Hi, I am trying to help get a project (Lightweight Java Game Library <http://lwjgl.org/>) into Maven Central repository.
This project is the most used way for java games to use opengl.

The project is made of a main jar lwjgl.jar and some natives for each platform.

I have to main questions:

*What should be the id of the native artifacts:*

For now, what I am using is having a classifier composed of "natives-${platform}" like natives-win, natives-mac, natives-linux. I think this is a useful naming convention because it allows the creation of a plugin (maven-natives-plugin <http://code.google.com/p/mavennatives/>) that matches those classifiers and unpacks the natives. This allows you to add them to the java.library.path. Also it allows the creation of an eclipse plugin so that everything is configured automatically.


*The other issue is what should be the artifactId of the native artifacts:*
In my personal repository I added the natives using the same artifactId as the main artifact, but with the natives-${platform} classifier, and added the natives as dependencies of the main artifact.

   *    main artifact: groupId:org.lwjgl - artifactId: lwjgl
   *    natives artifacts: groupId: org.lwjgl - artifactId: lwjgl -
     classifier: natives-${platform}

This solutions works great because you don't have to declare the natives when you add a dependency. The problem came when I tried create a build of the project made with maven, because the main artifact depends on the natives, but they share the groupId and artifactId maven complains that there is a cycle and refuses to build. Shouln't it work if I use runtime as scope for the native dependencies? At build time they should not be used, so the build shouldn't complain about a cycle and then I can attach them to the result of the build. I could use a different artifactId, but there is no natural name for that, the only thing that comes to mind, is oldartifactId-natives but that would clash with the proposed naming convention using natives-${platform} as classifier.


so the questions are:

   *      is the proposed naming convention for artifacts with natives
     (natives-${platform}) a good one? is there anyone better?
   *      should I be able to define cycles if the dependencies have
     runtime scope?. If I can't or is not recommended what would you
     recommend as an artifactId?

thanks for the help

Rubén

Reply via email to