我正在使用maven-webstart-plugin生成2个JNLP(jnlpA和jnlpB),配置为2次执行。该项目有2个依赖项:
我需要jnlpA作为依赖项dependencyA.jar,commons和A1.jar,A2.jar,A3.jar ......和jnlpB dependencyB.jar,commons和B1.jar,B2.jar,B3.jar。 ..我不知道怎么用maven-webstart-plugin做这个。
我试过这个:
使用名为“excludeTransitive”的插件属性为false(默认值)。在这种情况下,两个JNLP都将具有所有依赖关系。
将“excludeTransitive”更改为true,在这种情况下,两个JNLP只将dependencyA.jar和dependencyB.jar作为依赖项。
如果将“excludeTransitive”设置为false(默认值),请使用以下选项排除并包含插件允许在每次执行中使用的内容:
所以,我的问题是我需要在执行中包含或排除依赖关系,但包含所有传递依赖关系。
当我尝试选项3时,我的pom的一个例子是:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>MyJnlp</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>webstart-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<executions>
<execution>
<id>install-jnlp</id>
<phase>process-resources</phase>
<goals>
<goal>jnlp-inline</goal>
</goals>
<configuration>
<workDirectory>target/dist</workDirectory>
<jnlp>
<inputTemplate>src/main/jnlp/jnlpA-template.vm</inputTemplate>
<outputFile>jnlpA.jnlp</outputFile>
<mainClass>Start</mainClass>
</jnlp>
<dependencies>
<excludes>
<exclude>xxx:dependencyB</exclude>
</excludes>
</dependencies>
</configuration>
</execution>
<execution>
<id>uninstall-jnlp</id>
<phase>process-resources</phase>
<goals>
<goal>jnlp-inline</goal>
</goals>
<configuration>
<workDirectory>target/dist</workDirectory>
<jnlp>
<inputTemplate>src/main/jnlp/jnlpB-template.vm</inputTemplate>
<outputFile>jnlpB.jnlp</outputFile>
<mainClass>Uninstaller</mainClass>
</jnlp>
<dependencies>
<excludes>
<exclude>xxx:dependencyA</exclude>
</excludes>
</dependencies>
</configuration>
</execution>
</executions>
<configuration>
<excludeTransitive>false</excludeTransitive><resourcesDirectory>${project.basedir}/src/main/jnlp/resources</resourcesDirectory>
<jnlp>
<inputTemplateResourcePath>${project.basedir}</inputTemplateResourcePath>
</jnlp>
<gzip>true</gzip>
<makeArchive>false</makeArchive>
<outputJarVersions>false</outputJarVersions>
<verbose>true</verbose>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>xxx</groupId>
<artifactId>dependencyA</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>xxx</groupId>
<artifactId>dependencyB</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>