Created
June 7, 2012 16:01
-
-
Save martiell/2889674 to your computer and use it in GitHub Desktop.
Write pom dependencies to a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.codehaus.groovy.maven</groupId> | |
<artifactId>gmaven-plugin</artifactId> | |
<version>1.0</version> | |
<configuration> | |
<source> | |
// Write the compile/runtime classpath to a file, with one entry per line. | |
// Each line contains the relative path to a jar from the root of a Maven | |
// repository. | |
layout = new org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout() | |
scopes = [ 'compile', 'runtime' ] | |
artifacts = project.artifacts. | |
findAll { scopes.contains(it.scope) }. | |
collect { layout.pathOf(it) } | |
dir = new File(project.build.directory, | |
"generated-resources/classpath/") | |
dir.mkdirs() | |
new File(dir, "classpath.txt").withWriter { w -> | |
artifacts.each { w.println it } | |
} | |
</source> | |
</configuration> | |
<executions> | |
<execution> | |
<phase>validate</phase> | |
<goals> | |
<goal>execute</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment