当我要使用Pom进行Maven安装时,
<build>
<defaultGoal>package</defaultGoal>
<sourceDirectory>${basedir}/src/main/izpack</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/izpack</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<!-- Configure the compiler to use Java 1.5 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- Have project dependencies be picked up by izPack when its compiler runs -->
<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>5.0.0-rc4</version>
<dependencies>
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-panel</artifactId>
<version>5.0.0-rc4</version>
</dependency>
</dependencies>
<!-- mvn help:describe -DgroupId=org.codehaus.izpack -DartifactId=izpack-maven-plugin -Dversion=5.0.0-beta11 -Ddetail -->
<configuration>
<installFile>${staging.dir}/install.xml</installFile>
<attach>false</attach>
<kind>standard</kind>
<descriptorEncoding>UTF-8</descriptorEncoding>
<izpackBasedir>${staging.dir}</izpackBasedir>
<customPanelDirectory>${staging.dir}</customPanelDirectory>
</configuration>
<executions>
<execution>
<id>standard-installer</id>
<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Do not deploy any of the installer artifacts. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<staging.dir>${project.build.directory}/staging</staging.dir>
</properties>
无法在项目Izpack-Installer上执行目标org.codehaus.izpack:izpack-maven-plugin:5.0.0-rc4:izpack(标准安装程序):编译过程中失败:无效的基本目录:workspace / myproject / target / staging
上面的错误使我整日浪费...请发布支持Linux中控制台安装的izpack Maven插件的工作pom。
注意:我将install.xml放在src / main / izpack / install.xml以及src / main / resources / install.xml中。
最佳答案
终于在一天结束后得到了答案... :)
<build>
<defaultGoal>package</defaultGoal>
<sourceDirectory>${basedir}/src/main/resources</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<!-- Configure the compiler to use Java 1.7 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- Have project dependencies be picked up by izPack when its compiler runs -->
<plugin>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-maven-plugin</artifactId>
<version>5.0.0-rc4</version>
<configuration>
<installerFile>${basedir}/target</installerFile>
<izpackBasedir>${staging.dir}</izpackBasedir>
<dependencies>
<dependency>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-standalone-compiler</artifactId>
<version>4.3.5</version>
</dependency>
</dependencies>
</configuration>
<executions>
<execution>
<id>izpack</id>
<phase>package</phase>
<goals>
<goal>izpack</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Do not deploy any of the installer artifacts. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<staging.dir>${project.build.directory}/staging</staging.dir>
</properties>
目标文件夹中的“登台”目录是手动创建的。...:)