nguillaumin / slick2d-maven

Maven distribution of the Slick2D Gava game development library
BSD 3-Clause "New" or "Revised" License
66 stars 36 forks source link

Use the branch mvn-repo as a remote maven repository #9

Closed cubedtear closed 10 years ago

cubedtear commented 10 years ago

The purpose of this PR is to allow people to use this github repo as a Maven repo too, so that instead of having to download it and run mvn install by hand, they can just clone any repo with the following code and the usual slick-2d dependencies in its pom.xml and it would download all the dependencies from it without any problem:

<repositories>
    <repository>
        <id>slick2d-mvn-repo</id>
        <url>https://raw.github.com/nguillaumin/slick2d-maven/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

In order for people to be able to do that, you will personally have to take a couple steps, since you are the owner of the repo:

First, you will need to add your authentication for github in your maven's settings.xml, as the following:

<settings>
    <servers>
        <server>
            <id>github</id>
            <username>Your-Github-Username</username>
            <password>Your-Github-Password</password>
        </server>
    </servers>
</settings>

or, alternatively, (although I have not tried this one)

<settings>
    <servers>
        <server>
            <id>github</id>
            <password>OAuth-2-Token</password>
        </server>
    </servers>
</settings>

Next, you only have to run mvn clean deploy, and a branch called mvn-repo will be created (only in the Github remote), holding all the artifacts from all the modules.

As for the mvn-repo folder that gets created in the root folder, it gets deleted by just calling mvn clean, and in case you forget to delete it, it is ignored too.

Hope you take into account how much this would ease the use of this repository, and thanks for making the effort of putting this repo together in the first place.

nguillaumin commented 10 years ago

Hi,

Thanks that's a great idea, however it would not be necessary if the JARs were on the the Maven central repository. I haven't tried very hard because Slick2d seems a bit dead, but if there's still interest I'll try harder.

If I can't get it to work, I'll apply your proposal.

cubedtear commented 10 years ago

OK, I just thought since you said you had problems with adding it to Maven Central it would at least be possible to do this. However, I agree that it would be better if the jars were in Central

nguillaumin commented 10 years ago

I was able to make progress on this, and I'm actually ready to release to Maven Central now :)

I was just wondering which version number to set. Currently it's using a version like <year>-<month>-SNAPSHOT because I was automatically syncing with the upstream repository and build the Maven package with the date of when it was sync-ed.

But on Maven Central I wouldn't want to use date as it's not the best practice, and it would prevent me from doing multiple releases on one month (except if I add the day number in the version which makes it ever messier).

Since Slick2D never had version numbers, I was thinking of simply starting at 1.0.0. I don't think the original repository is updated anymore, so in practice there shouldn't be any subsequent versions except if I start accepting patches/fixes from people, which I might start doing if there's regained interest once it's in Central.

Any thoughts on the version numbers?

cubedtear commented 10 years ago

I think 1.0.0 would be a good version to start with, since it would be the first version released with an actual version number, and, after all, it is the first slick2d-maven.

I took a look at the original repo you linked, and the only thing similar to a version number is the build number, which is not really a version, so, in my opinion, go ahead and use 1.0.0

nguillaumin commented 10 years ago

Success! http://search.maven.org/#search%7Cga%7C1%7Cslick2d