我需要从 2 个不同的 svn 位置下载到同一个输出目录。所以我配置了2个不同的执行。但是每次执行结帐时都会删除输出目录,因此它也会删除已经下载的项目。
这是我的 pom.xml 的示例:
<profile>
<id>checkout</id>
<activation>
<property>
<name>checkout</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.3</version>
<configuration>
<username>${svn.username}</username>
<password>${svn.pass}</password>
<checkoutDirectory>${path}</checkoutDirectory>
<skipCheckoutIfExists/>
</configuration>
<executions>
<execution>
<id>checkout_a</id>
<configuration>
<connectionUrl>scm:svn:https://host_n/folder</connectionUrl>
<checkoutDirectory>${path}</checkoutDirectory>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>checkout</goal>
</goals>
</execution>
<execution>
<id>checkout_b</id>
<configuration>
<connectionUrl>scm:svn:https://host_l/anotherfolder</connectionUrl>
<checkoutDirectory>${path}</checkoutDirectory>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>checkout</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
有什么办法可以防止执行删除文件夹 ${path} ?
我想出了一个解决方案,但我无法让它工作:
我在配置文件中添加了 maven-clean-plugin 的执行:
<profile>
<id>checkout</id>
...
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>not-clean</id>
<configuration>
<filesets>
<fileset>
<directory>${path}</directory>
<excludes>
<exclude>*/*</exclude>
</excludes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
但我无法意识到如何排除文件夹中的所有内容。
任何的想法?