Here is my dummy
project's build.gradle
file:
apply plugin: 'groovy'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.3'
compile 'org.slf4j:jcl-over-slf4j:1.7.7'
testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-all:1.10.8'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
When I run gradle clean build -Pversion=1.2.3
, this packages up all my code and creates a build/libs/dummy-1.2.3.jar
for me.
I would like to know the absolute bare minimum amount of Gradle code necessary so that I could publish my "dummy" JARs to my local Maven cache (mavenLocal()
). Additionally, how does this work with versioning? I could always specify a concrete version for the dummy JAR, but when I'm publishing locally, it makes more sense (to me, at least) to publish SNAPSHOT
versions. I could just run gradle clean build -Pversion=0.1.SNAPSHOT
, but then my concern is whether or not other local projects would pick up the latest SNAPSHOT
versions.
So again:
- What's the bare minimum code to publish
dummy
locally? - Any way, when publishing locally, to specify a
SNAPSHOT
version that other projects always pick up the latest copy of? - What would other local projects need to use to pick up this
SNAPSHOT
? Something likecompile ':dummy:LATEST'
?