Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When finished, the entire build section of our pom should look something like this:

Code Block
xml
xml
<?xml version="1.0"?>.
.
.
<build>
  <plugins>
    <!-- copy izpack resources into izpack staging area, expected by izpack.xml -->
    <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <executions>
        <execution>
          <id>create-staging-area</id>
          <phase>process-resources</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <tasks>
              <copy todir="${izpack.staging}">
                <fileset dir="${basedir}/src/izpack"/>
              </copy>
            </tasks>
          </configuration>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <artifactId>maven-dependency-plugin</artifactId>
      <configuration>
        <excludeTransitive>false</excludeTransitive>
        <stripVersion>true</stripVersion>
        <overWriteReleases>true</overWriteReleases>
        <overWriteSnapshots>true</overWriteSnapshots>
        <overWriteIfNewer>true</overWriteIfNewer>
        <excludeScope>system</excludeScope>
      </configuration>
      <executions>
        <execution>
          <!-- copy product jars to izpack staging lib -->
          <id>copy-product-dependencies</id>
          <phase>prepare-package</phase>
          <goals>
            <goal>copy-dependencies</goal>
          </goals>
          <configuration>
            <outputDirectory>${izpack.staging}/lib</outputDirectory>
            <excludeScope>system</excludeScope>
            <!-- this excludes tools.jar, e.g. -->
            <excludeArtifactIds>mycustompanels</excludeArtifactIds>
            <excludeGroupIds>org.codehaus.izpack</excludeGroupIds>
          </configuration>
        </execution>
        <execution>
          <!-- copy izpack custom (custom panels, etc.) jars to izpack staging custom -->
          <id>copy-izpack-dependencies</id>
          <phase>prepare-package</phase>
          <goals>
            <goal>copy-dependencies</goal>
          </goals>
          <configuration>
            <outputDirectory>${izpack.staging}/custom</outputDirectory>
            <includeArtifactIds>mycustompanels</includeArtifactIds>
          </configuration>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.codehaus.izpack</groupId>
      <artifactId>izpack-maven-plugin</artifactId>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>izpack</goal>
          </goals>
          <configuration>
            <!-- base for relative paths in izpack descriptor -->
            <baseDir>${izpack.staging}</baseDir>
            <installFile>${basedir}/src/izpack/install.xml</installFile>
          </configuration>
        </execution>
      </executions>
      <dependencies>
        <dependency>
          <groupId>org.codehaus.izpack</groupId>
          <artifactId>izpack-panel</artifactId>
          <version>${izpack.version}</version>
        </dependency>
	   <dependency>
          <groupId>com.mycompany</groupId>
          <artifactId>myapplication</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
          <groupId>com.mycompany</groupId>
          <artifactId>mycustompanels</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>
.
.
.

As mentioned at the start of this article, the dependencies of your application are project dependencies and need to be specified as normal Maven dependencies in the project's dependencies section.

...