Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12058

wildfly/feature-pack module doesn't build with profile java8-test

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 11.0.1.Final
    • 11.0.0.Final
    • Build
    • None

      wildfly/feature-pack/pom.xml uses both maven-resource-plugin and maven-antrun-plugin to process the module.xml files. There are 3 maven-resource-plugin executions copying the files into the build output directory, then a maven-antrun-plugin execution (using an external build.xml) renames the slot directories and replaces the token versions in module.xml with the actual versions.

      The problem is that all these 4 executions run in the generate-resources build phase, and Maven does not guarantee any particular order for plugin executions in the same phase. Normally they run in the source order, and everything works, but activating profiles java8-test and rhdg8-snapshots-repository changes the order, and the maven-antrun-plugin execution runs first.

      The result depends on whether a previous build already created the correct module.xml file in the correct location:

      • If the correct files exist, the java8-test build will create additional modules without replacing the version tokens. The build will then fail with an error like this:
      [ERROR] Failed to execute goal org.wildfly.build:wildfly-feature-pack-build-maven-plugin:1.2.13.Final:build (feature-pack-build) on project infinispan-feature-pack: Execution feature-pack-build of goal org.wildfly.build:wildfly-feature-pack-build-maven-plugin:1.2.13.Final:build failed: java.lang.RuntimeException: Some errors were encountered creating the feature pack
      [ERROR] Missing module ModuleIdentifier{name='org.hibernate.search.engine', slot='@hibernate.search.module.slot@'}. Module was required by [ModuleIdentifier{name='org.infinispan', slot='rhdg-8.1'}]
       [ERROR] Missing module ModuleIdentifier{name='org.apache.lucene', slot='@lucene.module.slot@'}. Module was required by [ModuleIdentifier{name='org.infinispan', slot='rhdg-8.1'}]
      • If the target directory is empty, theĀ maven-antrun-plugin will fail because there are no resource files to move+filter:
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.0.0:run (branded-modules) on project infinispan-feature-pack: An Ant BuildException has occured: The following error occurred while executing this line:
      [ERROR] /home/dan/Work/build-jdg/wildfly/feature-pack/build.xml:3: /home/dan/Work/build-jdg/wildfly/feature-pack/target/feature-pack/modules does not exist.
      [ERROR] around Ant part ...<ant antfile="build.xml" inheritRefs="true">... @ 4:49 in /home/dan/Work/build-jdg/wildfly/feature-pack/target/antrun/build-main.xml

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: