use nuxeo cli with Nuxeo 2021

Hello,

Nuxeo CLI has not been updated when Nuxeo 2021 is released. I uninstalled Nuxeo CLI and install again using the commande npm install -g nuxeo-cli but when i type nuxeo -v I still get version 2.0.0. When I generate a sample project with nuxeo bootstrap single-module command, I still get in the generated pom :

<parent>
<groupId>org.nuxeo</groupId>
<artifactId>nuxeo-addons-parent</artifactId>
<version>10.10</version>
</parent>

Do you have any idea if it will be upgraded to Nuxeo 2021 ? Regards.

0 votes

2 answers

743 views

ANSWER



Hello, Nuxeo CLI prompts you for the Nuxeo platform version you want to use, if you specify 10.10 (default value) you obtain the pom.xml above. If you want to create a package for LTS-2021, you need to specify version 2021.X where X equals to the latest release you want to use (e.g. 2021.24)

For example, to create a whole package to start developing: nuxeo bootstrap type an image title

Then finally create a package module to be able to compile your Java MarketPlace as a package you can compile and install on a server: nuxeo bootstrap package type an image title

You will end up with a standard project having:

  • a parent pom.xml
  • a core project (where you put your main code)
  • a package project (where you express package dependency and install instructions)

Your pom.xml should looks like this:

  <parent>
    <groupId>org.nuxeo</groupId>
    <artifactId>nuxeo-parent</artifactId>
    <version>2021.24</version>
  </parent>

  <groupId>org.mygroup.id</groupId>
  <artifactId>test-parent</artifactId>
  <name>Test parent</name>
1 votes



Jordan, Thank you for your feedback. I followed you instructions pretty much verbatim. I am using a slightly older version (2021.18). However when I do an mvn clean compile I see the following error.

[INFO] Scanning for projects… Downloading from maven-internal: https://packages.nuxeo.com/repository/maven-internal/org/nuxeo/nuxeo-parent/2021.18/nuxeo-parent-2021.18.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for org.mygroup.id:test-parent:1.0-SNAPSHOT: Could not transfer artifact org.nuxeo:nuxeo-parent:pom:2021.18 from/to maven-internal (https://packages.nuxeo.com/repository/maven-internal/): authentication failed for https://packages.nuxeo.com/repository/maven-internal/org/nuxeo/nuxeo-parent/2021.18/nuxeo-parent-2021.18.pom, status: 401 Unauthorized and 'parent.relativePath' points at wrong local POM @ line 4, column 11 @

As best as I can tell, my settings.xml file has appropriate servers and user id / password combinations. What else should I be looking at?

FWIW - I have looked at the following and it gives me the same results. https://doc.nuxeo.com/nxdoc/develop-your-own-java-code/

I appreciate your willingness to help !

SG

08/17/2022

Sudarshan, Nuxeo LTS 2021 Maven artefacts are private. If you're working on a 2021 project with proper subscription, you need to request access to the repository through a support ticket, then update your Maven settings with a personal token you will need to generate. Please see documentation for that: https://doc.nuxeo.com/corg/maven-usage/#maven-usage-for-lts-2021
08/18/2022

Perfect ! I had the access but i was using the wrong token in my Maven settings.xml file. I appreciate the help!
08/18/2022

Thank you Jordan for your response. We don't have support, we can only use public libraries, and the last one is 10.10. Regards.
08/25/2022


Hello,

Can anyone from Nuxeo comment on this thread? I am in the similar boat. There are a lot of challenges with writing custom Java code.

Thanks,

SG

0 votes