Maven可以这样做吗?还是我需要单独编写脚本?我非常想不惜一切代价避免使用git子模块。
Maven SCM Plugin
以及
scm:checkout
目标是获取git存储库的内容(在配置中提供所有必需的信息,如
connectionUrl
,和
checkoutDirectory
prepare-package
阶段(并在战争期间打包
package
). 像这样的:
[...]
<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<checkoutDirectory>${project.build.directory}/${project.build.finalName}/somepath</checkoutDirectory>
<connectionUrl>scm:git:git://server_name[:port]/path_to_repository</connectionUrl>
...
</configuration>
</execution>
</executions>
</plugin>
[...]
</plugins
[...]
</build>
[...]