Maven: No Snapshot allowed

Hi,

currently I'm using the 5.9.1-SNAPSHOT sdk to package the preview/conversion support for a new doc type. My target is to distribute the 'nuxeo-platform-preview' - feature with the new package. When I compile the project I get the following build errors (see below). I'm aware that these errors are produced by the dependencies to the preview feature, but I don't really know, how to deal with these messages. Is the previewing feature under major construction? Is it by design to manually copy the previewer to nuxeo bundles? Should I have a dependency error in my project's pom file? Should I go back to the latest stable version for testing the package?

Regards

[..]

[INFO] [enforcer:enforce {execution: enforce-versions}]
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireReleaseDeps failed with message:
No Snapshots Allowed!
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-directory-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-placeful-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-forms-layout-core:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-jtajca:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-convert:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-versioning-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-convert:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-commandline-executor:jar:5.9.1-SNAPSHO
T
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-types-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-contentview-jsf:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-schema:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-web-common:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-osgi:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-filemanager-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-forms-layout-client:jar:5.9.1-SNAPSHOT

Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-reload:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-filemanager-core:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-query:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-io:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-usermanager-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-login:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-management:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.common:nuxeo-common:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-ui-web:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-webapp-base:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-ui-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-htmlsanitizer:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-search-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-forms-layout-io:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-event:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-launcher-commons:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.theme:nuxeo-theme-core:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-el:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-metrics:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-preview:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-storage-sql:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-actions-core:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-mimetype-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.runtime:nuxeo-runtime-deploy:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-management:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-forms-layout-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-url-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.core:nuxeo-core-convert-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-query-api:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.ecm.platform:nuxeo-platform-actions-jsf:jar:5.9.1-SNAPSHOT
Found Banned Dependency: org.nuxeo.theme:nuxeo-theme-fragments:jar:5.9.1-SNAPSHOT
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Some Enforcer rules have failed. Look above for specific messages explaining why the rule fail
ed.

[..]
0 votes

1 answers

8268 views

ANSWER

I've stepped back to 5.8 sdk. Now currently everything works as expected.
11/21/2013



Hi,

The enforcer plugin complains about SNAPSHOT dependencies on a release: which means that your are building a non-SNAPSHOT artifact which depends on Nuxeo SNAPSHOT artifacts. That's obviously wrong since your build won't be reproducible.
Depending on your development use case, there are various other recommended ways.

Given the output, you are reusing Nuxeo compile rules for your own project (by Maven inheritance). Ideally, you should have your own corporate POM (copying most of the plugins and pluginManagement Nuxeo configuration) and only import the Nuxeo dependencies: see https://github.com/nuxeo/nuxeo-marketplace-sample/blob/master/marketplace/pom.xml.

With your current inheritance of Nuxeo POM, you can deactivate the constraint on Nuxeo artifacts with such a configuration (see http://maven.apache.org/enforcer/enforcer-rules/index.html):

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-enforcer-plugin</artifactId>
  <version>1.0.1</version>
  <configuration>
    <rules>
      <requirePluginVersions>
        <message>Set plugin versions in pluginManagement section.</message>
        <banLatest>true</banLatest>
        <banRelease>true</banRelease>
        <banSnapshots>true</banSnapshots>
        <!-- <unCheckedPluginList>org.nuxeo.build:nuxeo-distribution-tools</unCheckedPluginList> -->
      </requirePluginVersions>
      <requireReleaseDeps>
        <message>No Snapshots Allowed!</message>
        <onlyWhenRelease>true</onlyWhenRelease>
        <excludes>
          <exclude>org.nuxeo*</exclude>
        </excludes>
      </requireReleaseDeps>
      <requireMavenVersion>
        <version>[2.2.1,)</version>
      </requireMavenVersion>
      <requireJavaVersion>
        <version>[1.7,)</version>
      </requireJavaVersion>
    </rules>
    <skip>false</skip>
  </configuration>
</plugin>

Regards,

0 votes



That greatly helps to switch back to 5.9.1-SNAPSHOT for development. Thanks
11/26/2013