我有一个名为HelloWorld的项目。这是一个Maven Java项目。
我有一个像https://my.repo.com/svn/filesToCopy的存储库
我想做的是:
全自动应对3个文件(a.xsd
,b.xsd
,c.xsd
)从SVN仓库到我的src/main/resource
目录。
我试图在我的pom.xml中添加类似的内容:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Coping one file</echo>
<copy file="https://my.repo.com/svn/filesToCopy/a.xsd" todir="${basedir}/src/main/resource" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
然后只是建立一个项目,但根本无法正常工作。
更令我怀疑的是,传递https
链接是否需要在某个地方输入用户名和密码。
有任何想法吗?
您是否尝试过这种方法?来自Maven SCM插件
<execution>
<id>perform-checkout</id>
<configuration>
<connectionUrl>myUrl</connectionUrl>
<checkoutDirectory>myDirectory</checkoutDirectory>
<excludes>folder1</excludes>
</configuration>
<phase><!-- some phase --></phase>
<goals>
<goal>checkout</goal>
</goals>
</execution>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句