Reputation: 76115
I have a separate git repository for document templates that I have no control over but whose contents need to be included as a folder in my final WAR. The versioning of these do not matter and the latest ones should always be used when packaging the war.
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.
Upvotes: 1
Views: 741
Reputation: 570645
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>
[...]
Upvotes: 2