我使用 maven-dependency-plugin 将构建的包复制到远程服务器。我这样做是这样的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
<outputDirectory>/home/xxx/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
现在我需要将其复制到另一个地方(客户端和服务器接口(interface)的共享包)。我该怎么做?我尝试添加第二个outputDirectory、新的 block artifactItems和新的 block artifactItem,但没有结果。
最佳答案
您必须添加另一个 <execution>
为此标记。这可能共享相同的阶段,但必须有一个唯一的 ID。
关于java - Maven-dependency-plugin 复制包到几个地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23152523/