On Mon, Mar 8, 2010 at 5:36 PM, Jesse Eichar <[email protected]>wrote:
> Hi,
>
> I have customized my build so that there are 3 artifacts. I have
> customized uploadArtifacts so all 3 artifacts are uploaded to a remote maven
> repository. Now I want to customize install so that they are installed in
> the local repository.
>
After applying the Maven plugin there is an install task. Executing this
install task will store by default all artifacts of the archives
configuration to your local Maven repo. By default the default jar is part
of the archives configuration. You can add additional jars like:
artifacts {
archives jar1, jar2
}
If you want for some reason publish not the archives configuration but
another configuration, you can simply say.
install {
configuration = configurations.yourConfiguration
}
- Hans
--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz
> I have tried this:
>
>
> task install(overwrite: true) << {
> env = System.getenv()
> sep = File.separator
> localRepo = env['MAVEN_REPO'] ?: env['HOME']+"${sep}.m2${sep}repository"
> repository(url: "file://"+localRepo)
> snapshotRepository(url: "file://"+localRepo)
>
> addFilter('lib') { artifact, file ->
> artifact.name.contains 'print-lib'
> }
>
> addFilter('standalone') { artifact, file ->
> artifact.name.contains 'print-standalone'
> }
>
> addFilter('war') { artifact, file ->
> artifact.name.contains 'print-servlet'
> }
> }
>
>
> But I get the message:
>
> FAILURE: Build failed with an exception.
>
> * Where:
> Build file '/Volumes/Box/Projects/mapfish/src/print/build.gradle' line: 114
>
> * What went wrong:
> Execution failed for task ':install'.
> Cause: Could not find method repository() for arguments
> [{url=file:///Users/jeichar/.m2/repository}] on root project 'print'.
>
>
>
> What is the correct method to publish the three artifacts?
>
> Thank you,
>
> Jesse
>