Getting started on Gemfury with Maven βeta

Creating a Java library

To get started in creating your Java library, initialize your Maven project with mvn archetype:generate:

$ mvn archetype:generate -DgroupId=com.mycompany.foo -DartifactId=foolib \
    -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 \
    -DinteractiveMode=false
    
$ cd foolib

Please take note to use your own values for groupId and artifactId.

This command will create an initial pom.xml file to describe your project. The file will contain the project’s name and its dependencies.

At this point, you may customize the generated pom.xml with the info of your project (e.g. version, url). When ready, be sure to commit pom.xml into your project’s Git repo.

Next, you may check the integrity of your local Maven environment by running the test suite on the newly generated project:

$ mvn test

A result of a build success is an assurance that you have a good environment to start on. If there are errors, you may want to fix them now before proceeding to add new code.

Your project structure should look like the following:

foolib/
├── pom.xml
├── src/main/java/com/mycompany/foo
│   ├── App.java
├── src/test/java/com/mycompany/foo
│   ├── AppTest.java

With the implementation in place, you can now package the artifact.

$ mvn package

You can find the generated artifact in the target sub-path.

$ ls target/*.jar
target/foolib-1.0-SNAPSHOT.jar

Next