Nuxeo Studio offers a dedicated servlet that provides Maven artifacts for:
- released versions of your project
- current snapshot of all common branches of your project
- current snapshot of all branches of each user's workspace (i.e. the work they are doing on a given branch but haven't yet shared by pushing staged commits).
You can get all available artifact on the following page: https://connect.nuxeo.com/nuxeo/site/studio/maven/nuxeo-studio/PROJECT_ID
You can then easily integrate your Studio configuration to your build process. Of course, all projects exposed through Maven are protected so that only contributors on the project are able to access the project in the Studio Maven repository. Hence you need to declare this "maven repository" on your local Maven settings, with correct credentials.
This is how to setup the Maven client to be able to access Studio Maven artifacts
- First you need to tag your project from Studio Client. This will generate a version of your project that can be accessed by Maven.
Then you need to configure your Maven client to use authentication when accessing the Studio Maven repository. For this, edit (or create if it does not exist) the
~/.m2/settings.xmlfile and add the following entry under the settings tag:
<servers> .... <server> <id>nuxeo-studio</id> <username>your_studio_username</username> <password>your_studio_password</password> </server> ... </servers>
Then in the POM (or a parent POM) where you need to add the dependency to the Studio project you should declare the Studio Maven repository like this:
<repositories> ... <repository> <id>nuxeo-studio</id> <url>https://connect.nuxeo.com/nuxeo/site/studio/maven</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> ... </repositories>
You notice we used the same server ID than in the
settings.xmlfile. The repository is located under the same root as Studio client (but using the Maven relative path).
Now you need to declare the dependency in your POM to point to the desired version of your Studio project. The project artifact key will be computed as follow:
nuxeo-studiobut can be changed from the Application Information view in Studio project. It is recommended to use the pattern com.mycompany for commercial (closed source) projects and org.mycompany for Open Source projects.
project_idis the ID of you project and is unique between all projects in Studio - you can get you project ID from the Application Information view in Studio project - look after Maven Artifact id property.
versionis the released version of your project. Let say you created a release with version number
1.0and your project ID is
myprojectand you are using the default
nuxeo-studiogroup. In that case your Maven dependency will be:
<dependency> <groupId>nuxeo-studio</groupId> <artifactId>myproject</artifactId> <version>1.0</version> </dependency>
The list of available versions for a given project is visible at:
MAVEN_GROUP=nuxeo-studio by default.
The list of available resources for a given project and version is visible at the given URL:
MAVEN_GROUP=nuxeo-studio by default and
VERSION=0.0.0-SNAPSHOT for the current development code.