Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Maven repository ?  (Read 11491 times)

0 Members and 1 Guest are viewing this topic.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Maven repository ?
« on: January 09, 2013, 10:57:01 pm »
Hi, thanks for your binding, i'm trying it out at the moment.

Do you plan on "mavenizing" your project ? As i use Maven to manage my dependencies, i find quite sad to have to add manually jsfml jar to the build path.

thx.
« Last Edit: January 16, 2013, 04:33:14 pm by dwarfman78 »
@dwarfman78
github.com/dwarfman78

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Maven repository ?
« Reply #1 on: January 10, 2013, 06:02:36 pm »
Hey, thanks for your feedback! :)

To be honest, I have no idea about using Maven.
What exactly do you mean by "mavenizing" JSFML and what would I have to do to achieve that? Is it enough to place a pom.xml into the root directory? What should that contain?

I am not really planning to build JSFML itself using Maven, but if there's any way I can make JSFML work with Maven, I'll be happy to cooperate.
JSFML - The Java binding to SFML.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Maven repository ?
« Reply #2 on: January 10, 2013, 08:42:26 pm »
Maven is a "sort of cmake" with dependency management. It uses a descriptor (pom.xml) to build projects and repositories (online or offline) to retrieve dependencies (like apt-get does on debian).

By mavenizing i mean adding a pom.xml to your project and using mvn binary to compile JSFML.jar this operation will also create a metadata file named jsfml.pom.

pom.xml should contains some information about where are located your sources relatively to the file and list your project's dependencies as well if any.

this will allow users like me to do the same with their projects by adding the jsfml dependency to their own pom.xml.

I think you can host a maven repository on github (not sure how). If not possible, you can just let the user retrieve your sources with the pom and build/deploy them on their local repository (offline).

Not sure if i'm clear as Maven can be quite touchy, however it is a standard that will certainly add to your project.
@dwarfman78
github.com/dwarfman78

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Maven repository ?
« Reply #3 on: January 10, 2013, 10:13:49 pm »
Ok i see that you're using JNI which requires a little tweaking on your pom... (because you need to generate some headers first.)

I'm going to investigate, i'll keep you posted.
@dwarfman78
github.com/dwarfman78

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Maven repository ?
« Reply #4 on: January 11, 2013, 03:12:42 pm »
There should be no reason to generate the headers. That's only necessary when any of the SFML API changes. The generated headers are checked in and can remain untouched.

The vital build processes are "ant compile" (compile the java sources) and the targets to build the C++ sources, which uses the already generated headers. For that, there should also be no need.

The idea is that users simply grab the release JAR file and put it in their classpath. Building the JAR and binaries yourself doesn't give you any advantage. You'd have to build the binaries for all kinds of operating systems (Windows 32 and 64, Linux 32 and 64, Mac OS X). That's the job I do for users and the result is jsfml.jar.

So I think a simple maven repository that lists the releases and snapshots should be enough?
JSFML - The Java binding to SFML.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Maven repository ?
« Reply #5 on: January 12, 2013, 01:12:43 pm »
Quote
So I think a simple maven repository that lists the releases and snapshots should be enough?

Yeah but you cannot add a jar to a repo if the project is not mavenized (because of the metadata file that need to be generated and put next to your jar in the repo directory).

Anyway i've been digging the jni+maven subject for the last couple of days and i've come to a "proof of concept" that is working based on this tutorial : http://www.tricoder.net/blog/?p=197

http://wikisend.com/download/602130/jnimaven.rar

Sorry for the rar filetype ...

I've tried to push it forward and use it to build JSFML, i'm quite close to a success BUT i'm stuck at the linking step of the intercom part (undefined reference to bla bla bla...) as my C++/JNI knowledge is quite limited.

Check it out here :

http://wikisend.com/download/595178/jnimaven-jsfml.rar

in order to build these using maven you obviously need mvn binaries and define correctly your JAVA_HOME system variable, then go the project root directory (jnimaven-parent) and type "mvn clean install -Pwin32" without the quotes.

I'm not trying to force you to mavenize your project in any way so if you want to let it where it is, it's ok for me i may or may not continue my research, i don't know, you already did a good job with those ant scripts and using a standalone jar is acceptable too.

i'll keep you posted if i go further.
@dwarfman78
github.com/dwarfman78

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Maven repository ?
« Reply #6 on: January 16, 2013, 08:03:28 am »
Sorry for the late reply.
It looks like I have to learn more about Maven, and at the moment I don't have too much time to do that. I may find some room for that in late february.

So if you don't mind, just use the JAR release for now.
In case you're willing and able to get a Maven setup running, feel free to do a pull request on github. ;) For now, I opened this issue to remind me: https://github.com/pdinklag/JSFML/issues/45
JSFML - The Java binding to SFML.

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: Maven repository ?
« Reply #7 on: January 21, 2013, 03:46:12 am »
+1 on putting JSFML on Maven. It would be a wise decision.
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

dwarfman78

  • Full Member
  • ***
  • Posts: 228
  • I'm bietzsche, Nietzsche !
    • MSN Messenger - cd4c@hotmail.com
    • View Profile
    • Email
Re: Maven repository ?
« Reply #8 on: January 21, 2013, 01:54:47 pm »
There's a maven plugin that you could use, it allows you to build your project using an ant build script "as is".

http://maven.apache.org/plugins/maven-antrun-plugin/

This should be simplier.

I wish i could have more time to investigate but i'm in some kind of rush at work for the moment.
@dwarfman78
github.com/dwarfman78

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Maven repository ?
« Reply #9 on: January 21, 2013, 01:57:32 pm »
Same here, got exam phase at university soon and am therefore pushing this back until then.
Thanks for all the information though, they should help me get started.
JSFML - The Java binding to SFML.

 

anything