mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
10.58.2014 dfedaa374d0eed3fa2549d05bd460083804577cf
Move manifest concatenation to Maven plugin.
2 files modified
95 ■■■■ changed files
opendj-config-maven-plugin/src/main/java/org/forgerock/opendj/maven/OpendjConfigMojo.java 38 ●●●●● patch | view | raw | blame | history
opendj-config/pom.xml 57 ●●●●● patch | view | raw | blame | history
opendj-config-maven-plugin/src/main/java/org/forgerock/opendj/maven/OpendjConfigMojo.java
@@ -99,6 +99,18 @@
    private String generatedManifestsTempDir;
    /**
     * Temporary directory containing generated manifests.
     * <p>
     * There is one manifest file generated by component. It is the
     * responsibility of project that use this plugin to concatenate all
     * generated files into a single file.
     *
     * @parameter default-value="${project.build.directory}/admin/core.manifest"
     * @required
     */
    private String generatedManifestsLocation;
    /**
     * Root directory containing generated messages for configuration.
     *
     * @parameter default-value="${basedir}/src/main/resources/config/messages"
@@ -233,6 +245,9 @@
        getLog().info("Generate I18N messages and profiles...");
        exec.generateMessagesAndProfiles();
        getLog().info("Adding source directory " + generatedSourcesRootDir);
        getProject().addCompileSourceRoot(generatedSourcesRootDir);
    }
    void checkDirectories() throws MojoExecutionException {
@@ -293,6 +308,29 @@
                        transformationSetForManifests()
                    )),
                executionEnvironment(getProject(), getSession(), getPluginManager()));
            /*
             * Concatenate all single manifest files to a single manifest for
             * core administration components.
             */
            executeMojo(
                plugin(
                    groupId("org.apache.maven.plugins"),
                    artifactId("maven-antrun-plugin"),
                    version("1.7")),
                goal("run"),
                configuration(
                    element(name("target"),
                            element(name("concat"),
                                    attribute("destfile", generatedManifestsLocation),
                                    element(name("fileset"),
                                            attributes(
                                                    attribute("dir", generatedManifestsTempDir),
                                                    attribute("includes", "**/*.manifest")))),
                            element(name("delete"), attribute("dir", generatedManifestsTempDir))
                    )
                ),
                executionEnvironment(getProject(), getSession(), getPluginManager()));
        }
        /**
opendj-config/pom.xml
@@ -99,7 +99,6 @@
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/java</source>
                <source>${project.build.directory}/generated-sources/config</source>
              </sources>
            </configuration>
          </execution>
@@ -195,34 +194,44 @@
          </execution>
        </executions>
      </plugin>
      <!-- Concatenate all single manifest files to a single manifest for
        core administration components. -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <configuration>
              <target>
                <concat
                  destfile="${project.build.outputDirectory}/admin/core.manifest">
                  <fileset dir="${project.build.directory}/tmp"
                    includes="**/*.manifest" />
                </concat>
                <delete dir="${project.build.directory}/tmp" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only.
            It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.forgerock.opendj</groupId>
                    <artifactId>opendj-config-maven-plugin</artifactId>
                    <versionRange>[3.0.0-SNAPSHOT,)</versionRange>
                    <goals>
                      <goal>generate</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute>
                        <runOnIncremental>true</runOnIncremental>
                        <runOnConfiguration>true</runOnConfiguration>
                    </execute>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <reporting>
    <plugins>