Is this possible with Maven or do I need to script something separately? I would very much like to avoid using a git submodule at all costs.
It should be possible to use the Maven SCM Plugin and its scm:checkout
goal to get the content of your git repository (providing all the required information in the configuration like the connectionUrl
, the checkoutDirectory
, etc) during the prepare-package
phase (and get it packaged in your war during package
). Something like this:
[...]
<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>
[...]