我需要从2个不同的svn位置下载到同一个输出目录。所以我配置了2个不同的执行。但每次执行checkout时都会删除输出目录,因此它也会删除已下载的项目。maven scm插件在每次执行时删除输出文件夹
这里是我的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-清理插件的执行:
<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>
,但我不知道如何排除文件夹中的所有内容。
任何想法?
要格式化代码,请将每行缩进四个空格。 – 2010-05-06 08:07:52
您可以解释为什么您需要在Maven内部签出代码?为什么你需要两个地点?这不应该由持续集成服务器(例如Hudson)完成吗? – khmarbaise 2010-05-06 08:09:58
啊......您无法使用Subversion将相同的目标位置检出两次,也无法使用其他VCT。 – khmarbaise 2010-05-06 08:11:04