Studio

HOWTO: Work with Maven Integration

Updated: November 4, 2019

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.

Setting up the Maven Client

Maven can be setup to add a dependency to a specific release, and to do continuous integration on a branch. In all cases, to be able to access Studio Maven artifacts:

  1. 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.xml file 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>
    
    
  2. 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.xml file. The repository is located under the same root as Studio client (but using the Maven relative path).

Setting up Continuous Integration on a Branch

To set up a dependency to the latest snapshot of a Studio branch:

  1. Go to the Branch Management screen and select a branch.

  2. Press the Maven GAV button. This button is available both for the latest changes only available in your own workspace or for the ones that are shared for all users on the branch.

  1. Maven coordinates are shown and ready to be copy-pasted in your project's pom.xml.

Adding a Dependency to a Release

To add a Maven dependency on a specific Studio release:

  1. Create a release of your Studio project. This will generate a version of your project that can be accessed by Maven.

  2. Go to the Releases and Tags screen.

  3. Press the Maven GAV button on the desired release and copy the Maven coordinates in your project's pom.xml file.

Retrieving Maven Resources

The list of available versions for a given project is visible at:

https://connect.nuxeo.com/nuxeo/site/studio/projects/{PROJECT_ID}

or

https://connect.nuxeo.com/nuxeo/site/studio/maven/{MAVEN_GROUP}/{PROJECT_ID}/

with MAVEN_GROUP=nuxeo-studio by default.

The list of available resources for a given project and version is visible at the given URL:

https://connect.nuxeo.com/nuxeo/site/studio/maven/{MAVEN_GROUP}/{PROJECT_ID}/{VERSION}/

with MAVEN_GROUP=nuxeo-studio by default and VERSION=0.0.0-SNAPSHOT for the current development code.

We'd love to hear your thoughts!

All fields required