Example-imagej-command plugin with latest pom-scijava problem

Lately I have tried to play a little with plugin example example-imagej-command. After it’s cloned everything is fine with full build.
I have tried to change pom-scijava version from 13.0.0 to something latest - 16.2.0 in my case and after running ‘mvn’ command I got following error:

[WARNING] Rule 8: org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds failed with message:

The following artifacts either - are SNAPSHOT versions (V), contain 
SNAPSHOT parents (P), or contain SNAPSHOT dependencies (D):

 Failed to build pom. net.imagej:imagej:2.0.0-rc-61

I have checked other versions of pom-scijava and for example on 15.0.0 it works fine. Can anybody explain what is wrong with using latest version in that particular plugin example?

Dear @krzysg,

the latest released, non-SNAPSHOT version of pom-scijava is 16.1.0 (check out http://maven.imagej.net/#nexus-search;quick~pom-scijava). This should solve your issues with the enforcer, which forces you to not reference SNAPSHOT version of artifacts.

See http://imagej.net/Architecture#Reproducible_builds for more information on that topic.

Best,
Stefan

Dear @stelfrich,

unfortunately it gives same error output for 16.1.0 and also for 16.0.0
Thanks for pointing me to ‘reproducible builds’ stuff’ so the error msg is more clear to me.

/Krzysztof

I cannot confirm that issue on my setup, @krzysg. Could you maybe run mvn --debug enforcer:enforce and paste the output here?

All steps from git clone to command you suggested:

/tmp$ git clone https://github.com/imagej/example-imagej-command.git
Cloning into 'example-imagej-command'...
remote: Counting objects: 21, done.
remote: Total 21 (delta 0), reused 0 (delta 0), pack-reused 21
Unpacking objects: 100% (21/21), done.

/tmp$ cd example-imagej-command/
/tmp/example-imagej-command (master=)$ vi pom.xml 
/tmp/example-imagej-command (master *=)$ gd
diff --git a/pom.xml b/pom.xml
index 1b9d95d..e024f09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
        <parent>
                <groupId>org.scijava</groupId>
                <artifactId>pom-scijava</artifactId>
-               <version>13.0.0</version>
+               <version>16.0.0</version>
                <relativePath />
        </parent>
/tmp/example-imagej-command (master *=)$ mvn --debug enforcer:enforce
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/Cellar/maven32/3.2.5/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: utf-8
OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/Cellar/maven32/3.2.5/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/gonciarz/.m2/settings.xml
[DEBUG] Using local repository at /Users/gonciarz/.m2/repository


..... ///  I have removed some initial infos since limit on msg length


[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] Tasks:   [enforcer:enforce]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Gauss Filtering 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Resolving plugin prefix enforcer from [org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix enforcer to org.apache.maven.plugins:maven-enforcer-plugin from POM com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       com.mycompany:GaussFiltering:0.1.0-SNAPSHOT
[DEBUG] Dependencies (collect): [test]
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [imagej.public (http://maven.imagej.net/content/groups/public, default, releases+snapshots), central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Repositories (plugins)     : [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <fail default-value="true">${enforcer.fail}</fail>
  <failFast default-value="false">${enforcer.failFast}</failFast>
  <ignoreCache default-value="false">${enforcer.ignoreCache}</ignoreCache>
  <mojoExecution default-value="${mojoExecution}"/>
  <project default-value="${project}"/>
  <rules>
    <requireMavenVersion>
      <version>3.0.4</version>
    </requireMavenVersion>
    <requirePluginVersions>
      <message>Plugins need to be versioned!</message>
    </requirePluginVersions>
    <banDuplicateClasses>
      <message>No Duplicate Classes Allowed!
- For duplicate transitive dependencies, add dependency exclusions.
- For duplications between direct dependencies, resolve or add
  ignored classes to this rule&apos;s configuration.</message>
      <findAllDuplicates>true</findAllDuplicates>
    </banDuplicateClasses>
    <requireDeveloperRoles>
      <validRoles>founder,lead,developer,debugger,reviewer,support,maintainer</validRoles>
    </requireDeveloperRoles>
    <requireContributorRoles>
      <validRoles>founder,lead,developer,debugger,reviewer,support,maintainer</validRoles>
    </requireContributorRoles>
    <enforceBytecodeVersion>
      <maxJdkVersion>1.8</maxJdkVersion>
      <excludes>
        <exclude>com.headius:invokebinder</exclude>
        <exclude>com.sun:tools</exclude>
      </excludes>
      <ignoredScopes>
        <ignoredScope>test</ignoredScope>
      </ignoredScopes>
    </enforceBytecodeVersion>
    <banCircularDependencies/>
    <requireElements implementation="org.scijava.maven.plugin.enforcer.RequireElements">
      <elements>
        <element>name</element>
        <element>description</element>
        <element>url</element>
        <element>inceptionYear</element>
        <element>organization</element>
        <element>licenses</element>
        <element>developers</element>
        <element>contributors</element>
        <element>mailingLists</element>
        <element>scm</element>
        <element>issueManagement</element>
        <element>ciManagement</element>
        <element>properties//license.licenseName</element>
        <element>properties//license.copyrightOwners</element>
      </elements>
    </requireElements>
    <requireReproducibleBuilds implementation="org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds">
      <groupIds>org.scijava,net.imagej,net.imglib2,io.scif,sc.fiji</groupIds>
    </requireReproducibleBuilds>
  </rules>
  <session default-value="${session}"/>
  <skip default-value="false">${enforcer.skip}</skip>
</configuration>
[DEBUG] =======================================================================
[WARNING] The POM for net.imagej:imagej:jar:2.0.0-rc-61 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model
[FATAL] Non-parseable POM /Users/gonciarz/.m2/repository/net/imagej/imagej/2.0.0-rc-61/imagej-2.0.0-rc-61.pom: only whitespace content allowed before start tag and not T (position: START_DOCUMENT seen \n\t\tT... @2:4)  @ line 2, column 4

[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=3}
[DEBUG] com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG]    net.imagej:imagej:jar:2.0.0-rc-61:compile
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (default-cli) @ GaussFiltering ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=1, ConflictMarker.nodeCount=319, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=53, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=4, ConflictResolver.conflictItemCount=133, DefaultDependencyCollector.collectTime=134, DefaultDependencyCollector.transformTime=6}
[DEBUG] org.apache.maven.plugins:maven-enforcer-plugin:jar:1.4.1:
[DEBUG]    org.codehaus.mojo:extra-enforcer-rules:jar:1.0-beta-6:runtime
[DEBUG]       org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG]       org.apache.maven.shared:maven-dependency-tree:jar:2.2:compile
[DEBUG]          org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG]          org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9:compile
[DEBUG]       org.apache.maven.shared:maven-common-artifact-filters:jar:1.4:compile
[DEBUG]       com.ibm.icu:icu4j:jar:56.1:runtime
[DEBUG]    org.scijava:scijava-maven-plugin:jar:1.0.0:runtime
[DEBUG]       org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.3:provided
[DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG]    org.apache.maven:maven-core:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1:compile
[DEBUG]       org.slf4j:slf4j-jdk14:jar:1.5.6:runtime
[DEBUG]          org.slf4j:slf4j-api:jar:1.5.6:runtime
[DEBUG]       org.slf4j:jcl-over-slf4j:jar:1.5.6:runtime
[DEBUG]       org.apache.maven.reporting:maven-reporting-api:jar:2.2.1:compile
[DEBUG]          org.apache.maven.doxia:doxia-sink-api:jar:1.1:compile
[DEBUG]          org.apache.maven.doxia:doxia-logging-api:jar:1.1:compile
[DEBUG]       org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-error-diagnostics:jar:2.2.1:compile
[DEBUG]       commons-cli:commons-cli:jar:1.2:compile
[DEBUG]       org.apache.maven:maven-plugin-descriptor:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG]       org.apache.maven:maven-monitor:jar:2.2.1:compile
[DEBUG]       classworlds:classworlds:jar:1.1:compile
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.22:compile
[DEBUG]    commons-lang:commons-lang:jar:2.3:compile
[DEBUG]    org.apache.maven.enforcer:enforcer-api:jar:1.4.1:compile
[DEBUG]    org.apache.maven.enforcer:enforcer-rules:jar:1.4.1:compile
[DEBUG]       org.beanshell:bsh:jar:2.0b4:compile
[DEBUG]       org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6:compile
[DEBUG]    org.apache.maven.plugin-testing:maven-plugin-testing-harness:jar:1.3:compile
[DEBUG]       org.codehaus.plexus:plexus-archiver:jar:2.2:compile
[DEBUG]          org.codehaus.plexus:plexus-io:jar:2.0.4:compile
[DEBUG]       junit:junit:jar:4.11:compile
[DEBUG]          org.hamcrest:hamcrest-core:jar:1.3:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1
[DEBUG]   Imported:  < project>com.mycompany:GaussFiltering:0.1.0-SNAPSHOT
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1
[DEBUG]   Included: org.apache.maven.plugins:maven-enforcer-plugin:jar:1.4.1
[DEBUG]   Included: org.codehaus.mojo:extra-enforcer-rules:jar:1.0-beta-6
[DEBUG]   Included: org.apache.maven.shared:maven-dependency-tree:jar:2.2
[DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG]   Included: org.eclipse.aether:aether-util:jar:0.9.0.M2
[DEBUG]   Included: org.apache.maven.shared:maven-common-artifact-filters:jar:1.4
[DEBUG]   Included: com.ibm.icu:icu4j:jar:56.1
[DEBUG]   Included: org.scijava:scijava-maven-plugin:jar:1.0.0
[DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG]   Included: org.slf4j:slf4j-jdk14:jar:1.5.6
[DEBUG]   Included: org.slf4j:slf4j-api:jar:1.5.6
[DEBUG]   Included: org.slf4j:jcl-over-slf4j:jar:1.5.6
[DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.2.1
[DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.1
[DEBUG]   Included: org.apache.maven.doxia:doxia-logging-api:jar:1.1
[DEBUG]   Included: commons-cli:commons-cli:jar:1.2
[DEBUG]   Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.22
[DEBUG]   Included: commons-lang:commons-lang:jar:2.3
[DEBUG]   Included: org.apache.maven.enforcer:enforcer-api:jar:1.4.1
[DEBUG]   Included: org.apache.maven.enforcer:enforcer-rules:jar:1.4.1
[DEBUG]   Included: org.beanshell:bsh:jar:2.0b4
[DEBUG]   Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-6
[DEBUG]   Included: org.apache.maven.plugin-testing:maven-plugin-testing-harness:jar:1.3
[DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:2.2
[DEBUG]   Included: org.codehaus.plexus:plexus-io:jar:2.0.4
[DEBUG]   Included: junit:junit:jar:4.11
[DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9
[DEBUG]   Excluded: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.3
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.2.1
[DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.2.1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1, parent: sun.misc.Launcher$AppClassLoader@2503dbd3]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce' with basic configurator -->
[DEBUG]   (s) fail = true
[DEBUG]   (s) failFast = false
[DEBUG]   (f) ignoreCache = false
[DEBUG]   (f) mojoExecution = org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce {execution: default-cli}
[DEBUG]   (s) project = MavenProject: com.mycompany:GaussFiltering:0.1.0-SNAPSHOT @ /private/tmp/example-imagej-command/pom.xml
[DEBUG]   (s) version = 3.0.4
[DEBUG]   (s) message = Plugins need to be versioned!
[DEBUG]   (f) message = No Duplicate Classes Allowed!
- For duplicate transitive dependencies, add dependency exclusions.
- For duplications between direct dependencies, resolve or add
  ignored classes to this rule's configuration.
[DEBUG]   (f) findAllDuplicates = true
[DEBUG]   (f) validRoles = founder,lead,developer,debugger,reviewer,support,maintainer
[DEBUG]   (f) validRoles = founder,lead,developer,debugger,reviewer,support,maintainer
[DEBUG]   (f) maxJdkVersion = 1.8
[DEBUG]   (f) excludes = [com.headius:invokebinder, com.sun:tools]
[DEBUG]   (f) ignoredScopes = [test]
[DEBUG]   (f) elements = [name, description, url, inceptionYear, organization, licenses, developers, contributors, mailingLists, scm, issueManagement, ciManagement, properties//license.licenseName, properties//license.copyrightOwners]
[DEBUG]   (f) groupIds = org.scijava,net.imagej,net.imglib2,io.scif,sc.fiji
[DEBUG]   (s) rules = [org.apache.maven.plugins.enforcer.RequireMavenVersion@6ebd78d1, org.apache.maven.plugins.enforcer.RequirePluginVersions@436390f4, org.apache.maven.plugins.enforcer.BanDuplicateClasses@4d157787, org.apache.maven.plugins.enforcer.RequireDeveloperRoles@68ed96ca, org.apache.maven.plugins.enforcer.RequireContributorRoles@6d1310f6, org.apache.maven.plugins.enforcer.EnforceBytecodeVersion@3228d990, org.apache.maven.plugins.enforcer.BanCircularDependencies@54e7391d, org.scijava.maven.plugin.enforcer.RequireElements@50b8ae8d, org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds@255990cc]
[DEBUG]   (s) session = org.apache.maven.execution.MavenSession@51c929ae
[DEBUG]   (s) skip = false
[DEBUG] -- end configuration --
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireMavenVersion
[DEBUG] Rule org.apache.maven.plugins.enforcer.RequireMavenVersion is cacheable.
[DEBUG] Detected Maven Version: 3.2.5
[DEBUG] Detected Maven Version: 3.2.5 is allowed in the range 3.0.4.
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequirePluginVersions
[DEBUG] RequirePluginVersions.getAllPlugins:
[DEBUG]   lifecycleMapping = clean
[DEBUG]   plugins = org.apache.maven.plugins:maven-clean-plugin:2.5:clean
[DEBUG]     plugin = org.apache.maven.plugins:maven-clean-plugin:2.5:clean
[DEBUG]     GAV = [org.apache.maven.plugins, maven-clean-plugin, 2.5, clean]
[DEBUG] RequirePluginVersions.getAllPlugins:
[DEBUG]   lifecycleMapping = process-test-resources
[DEBUG]   plugins = org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
[DEBUG]     plugin = org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
[DEBUG]     GAV = [org.apache.maven.plugins, maven-resources-plugin, 2.6, testResources]
[DEBUG]   lifecycleMapping = package
[DEBUG]   plugins = org.apache.maven.plugins:maven-jar-plugin:2.4:jar
[DEBUG]     plugin = org.apache.maven.plugins:maven-jar-plugin:2.4:jar
[DEBUG]     GAV = [org.apache.maven.plugins, maven-jar-plugin, 2.4, jar]
[DEBUG]   lifecycleMapping = compile
[DEBUG]   plugins = org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
[DEBUG]     plugin = org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
[DEBUG]     GAV = [org.apache.maven.plugins, maven-compiler-plugin, 3.1, compile]
[DEBUG]   lifecycleMapping = test
[DEBUG]   plugins = org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
[DEBUG]     plugin = org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
[DEBUG]     GAV = [org.apache.maven.plugins, maven-surefire-plugin, 2.12.4, test]
[DEBUG]   lifecycleMapping = install
[DEBUG]   plugins = org.apache.maven.plugins:maven-install-plugin:2.4:install
[DEBUG]     plugin = org.apache.maven.plugins:maven-install-plugin:2.4:install
[DEBUG]     GAV = [org.apache.maven.plugins, maven-install-plugin, 2.4, install]
[DEBUG]   lifecycleMapping = process-resources
[DEBUG]   plugins = org.apache.maven.plugins:maven-resources-plugin:2.6:resources
[DEBUG]     plugin = org.apache.maven.plugins:maven-resources-plugin:2.6:resources
[DEBUG]     GAV = [org.apache.maven.plugins, maven-resources-plugin, 2.6, resources]
[DEBUG]   lifecycleMapping = test-compile
[DEBUG]   plugins = org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
[DEBUG]     plugin = org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile
[DEBUG]     GAV = [org.apache.maven.plugins, maven-compiler-plugin, 3.1, testCompile]
[DEBUG]   lifecycleMapping = deploy
[DEBUG]   plugins = org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
[DEBUG]     plugin = org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
[DEBUG]     GAV = [org.apache.maven.plugins, maven-deploy-plugin, 2.7, deploy]
[DEBUG] RequirePluginVersions.getAllPlugins:
[DEBUG]   lifecycleMapping = site
[DEBUG]   plugins = org.apache.maven.plugins:maven-site-plugin:3.3:site
[DEBUG]     plugin = org.apache.maven.plugins:maven-site-plugin:3.3:site
[DEBUG]     GAV = [org.apache.maven.plugins, maven-site-plugin, 3.3, site]
[DEBUG]   lifecycleMapping = site-deploy
[DEBUG]   plugins = org.apache.maven.plugins:maven-site-plugin:3.3:deploy
[DEBUG]     plugin = org.apache.maven.plugins:maven-site-plugin:3.3:deploy
[DEBUG]     GAV = [org.apache.maven.plugins, maven-site-plugin, 3.3, deploy]
[DEBUG] All Plugins in use: [Plugin [org.scijava:scijava-maven-plugin], Plugin [org.codehaus.mojo:buildnumber-maven-plugin], Plugin [org.codehaus.mojo:build-helper-maven-plugin], Plugin [org.apache.maven.plugins:maven-source-plugin], Plugin [org.apache.maven.plugins:maven-site-plugin], Plugin [org.apache.maven.plugins:maven-resources-plugin], Plugin [com.zenjava:javafx-maven-plugin], Plugin [org.apache.maven.plugins:maven-compiler-plugin], Plugin [org.apache.maven.plugins:maven-surefire-plugin], Plugin [org.apache.maven.plugins:maven-jar-plugin], Plugin [org.apache.maven.plugins:maven-clean-plugin], Plugin [com.github.maven-nar:nar-maven-plugin], Plugin [org.apache.maven.plugins:maven-install-plugin], Plugin [net.imagej:imagej-maven-plugin], Plugin [org.apache.maven.plugins:maven-deploy-plugin], Plugin [org.apache.maven.plugins:maven-enforcer-plugin], Plugin [org.fusesource.mvnplugins:maven-graph-plugin]]
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.BanDuplicateClasses
[DEBUG] Dependency tree resolution listener events:
[DEBUG] testArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] includeArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] startProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[WARNING] Invalid POM for net.imagej:imagej:jar:2.0.0-rc-61, transitive dependencies (if any) will not be available, enable debug logging for more details: 1 problem was encountered while building the effective model
[FATAL] Non-parseable POM /Users/gonciarz/.m2/repository/net/imagej/imagej/2.0.0-rc-61/imagej-2.0.0-rc-61.pom: only whitespace content allowed before start tag and not T (position: START_DOCUMENT seen \n\t\tT... @2:4)  @ line 2, column 4
 for project 
[DEBUG]   testArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   includeArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   startProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   endProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG] endProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] Searching for duplicate classes in null
[WARNING] Could not find net.imagej:imagej:jar:2.0.0-rc-61:compile at null
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireDeveloperRoles
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireContributorRoles
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion
[DEBUG] Dependency tree resolution listener events:
[DEBUG] testArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] includeArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] startProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG]   testArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   includeArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   startProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   endProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG] endProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] Analyzing artifact net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG] isBadArtifact() a:net.imagej:imagej:jar:2.0.0-rc-61:compile Artifact getFile():null
[DEBUG] Bytecode version analysis took 0 ms
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.BanCircularDependencies
[DEBUG] Detected Maven Version: 3.2.5
[DEBUG] building maven31 dependency graph for com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT with Maven31DependencyGraphBuilder
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=0, DefaultDependencyCollector.transformTime=1}
[DEBUG] com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG]    net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG] groupId: net.imagejcom.mycompany
[DEBUG] Executing rule: org.scijava.maven.plugin.enforcer.RequireElements
[DEBUG] Executing rule: org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds
[DEBUG] Dependency tree resolution listener events:
[DEBUG] testArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] includeArtifact: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] startProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG]   testArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   includeArtifact: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   startProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG]   endProcessChildren: artifact=net.imagej:imagej:jar:2.0.0-rc-61:compile
[DEBUG] endProcessChildren: artifact=com.mycompany:GaussFiltering:jar:0.1.0-SNAPSHOT
[DEBUG] Adding failure due to exception
org.apache.maven.enforcer.rule.api.EnforcerRuleException: 
The following artifacts either - are SNAPSHOT versions (V), contain 
SNAPSHOT parents (P), or contain SNAPSHOT dependencies (D):

 Failed to build pom. net.imagej:imagej:2.0.0-rc-61

	at org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds.execute(RequireReproducibleBuilds.java:141)
	at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:193)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[WARNING] Rule 8: org.scijava.maven.plugin.enforcer.RequireReproducibleBuilds failed with message:

The following artifacts either - are SNAPSHOT versions (V), contain 
SNAPSHOT parents (P), or contain SNAPSHOT dependencies (D):

 Failed to build pom. net.imagej:imagej:2.0.0-rc-61

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.669 s
[INFO] Finished at: 2017-06-23T12:14:15+02:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project GaussFiltering: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project GaussFiltering: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
	at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:237)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

It looks like your local Maven repository contains a screwed up POM for net.imagej:imagej:2.0.0-rc-61.

Could you try to to rm -rf /Users/gonciarz/.m2/repository/net/imagej/imagej/2.0.0-rc-61/ which will re-download the files for that GAV on the next Maven build?

1 Like

That helped, thanks a lot!

Hi all, I know this is a little old, but I’m seeing very similar things.

I downloaded the zip from https://github.com/imagej/example-imagej-command, opened in Netbeans (using v11.1). I clicked resolve problems and it downloaded the dependencies, and on building the project I see a similar error:

Rule 8: org.scijava.maven.plugin.enforcer.RequireElements failed with message:
The following required elements have errors:
* contributors: element is missing

The pom had org.scijava version as 26, but NetBeans suggested the latest version of 27.0.1, and I got the same error with both. Here’s my half edited pom for completeness (I started to change the details about me and the project)
pom.xml (2.4 KB)

Any pointer, or links to other posts I’ve missed, would be much appreciated.
Thanks
Neil

Ok, don’t know what the issue was, but somehow downloading the .zip file and then asking Netbeans to open that folder had things messed up. If I got through the steps to template and then clone inside Netbeans, it seems to work just fine.

Not sure if it’s that I used the zip download, or if having the maven downloaded dependencies already in place fixed the issue.

Either way, I’m moving on.
Happy coding :slight_smile:

1 Like