Skip to content

Commit 943882c

Browse files
authored
Merge pull request diffplug#205 from diffplug/bugfix-plugin-maven-depends-on-snapshots
Fix problem where plugin-maven might be published with snapshot deps
2 parents df0ff48 + 675233e commit 943882c

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

plugin-maven/CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Version 1.10.0-SNAPSHOT - TBD ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-maven-plugin/snapshot/), [snapshot](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/spotless-maven-plugin/))
44

5+
* Fix build to ensure that published versions never have snapshot deps ([#205](https://github.com/diffplug/spotless/pull/205)).
6+
57
### Version 1.0.0.BETA1 - February 11th 2017 ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-maven-plugin/1.0.0.BETA1/), [jcenter](https://bintray.com/diffplug/opensource/spotless-maven-plugin/1.0.0.BETA1))
68

79
* Maven plugin written by [Konstantin Lutovich](https://github.com/lutovich).

plugin-maven/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ def mvnw(String args) {
5555
}
5656

5757
dependencies {
58-
compile project(":lib")
59-
compile project(":lib-extra")
58+
if (!project.versionMaven.endsWith('-SNAPSHOT') && project.versionLib.endsWith('-SNAPSHOT')) {
59+
// gradle = release, lib = snapshot, therefore gradle should depend on the last stable lib
60+
compile "com.diffplug.spotless:spotless-lib:${project.stableLib}"
61+
compile "com.diffplug.spotless:spotless-lib-extra:${project.stableLib}"
62+
} else {
63+
compile project(':lib')
64+
compile project(':lib-extra')
65+
}
6066
compileOnly "org.apache.maven:maven-plugin-api:${VER_MAVEN_API}"
6167
compileOnly "org.apache.maven.plugin-tools:maven-plugin-annotations:${VER_MAVEN_API}"
6268
compileOnly "org.eclipse.aether:aether-api:${VER_ECLIPSE_AETHER}"

0 commit comments

Comments
 (0)