Skip to content

Instantly share code, notes, and snippets.

@fikovnik
Created May 8, 2016 20:45
Show Gist options
  • Save fikovnik/974eeb0283c43e94e6873dd40a8b1536 to your computer and use it in GitHub Desktop.
Save fikovnik/974eeb0283c43e94e6873dd40a8b1536 to your computer and use it in GitHub Desktop.
Synchronize maven repository from gradle module dependencies
task syncMavenRepository(type: JavaExec) {
classpath = configurations.mavenEmbedder
main = 'org.apache.maven.cli.MavenCli'
systemProperties['maven.multiModuleProjectDirectory'] = projectDir
args = [
'--errors',
'--batch-mode',
'--settings', '../config/repo-settings.xml',
'--file', "${buildDir}/pom.xml",
"org.apache.maven.plugins:maven-dependency-plugin:2.10:go-offline"
]
}
project.test.dependsOn(syncMavenRepository)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment