Skip to content

Commit

Permalink
Qualify final artifact to avoid name conflicts (fixes #364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Nov 10, 2019
1 parent 37f6ad3 commit 8cc71a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ subprojects {
patch = 1 // backwards-compatible bug fixes
releaseBuild = rootProject.hasProperty('release')
}
archivesBaseName = path[1..-1].replaceAll(':', '-').toLowerCase()

if (!archivesBaseName.startsWith(rootProject.name)) {
archivesBaseName = rootProject.name + path.replaceAll(':', '-').toLowerCase()
}

dependencies {
testImplementation libraries.guava
Expand Down

4 comments on commit 8cc71a1

@davido
Copy link

@davido davido commented on 8cc71a1 Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with gradle, but shouldn't this change also change the Maven coordinates?
I mean the current coordinates are unchanged for caffeine guava adapter, right?

com.github.ben-manes.caffeine:guava:2.8.0

in which case the expected artifact name to be fetched from Central is:

https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/guava/2.8.0/guava-2.8.0.jar

IOW, to be consistently renamed the Maven coordinates should probably be:

com.github.ben-manes.caffeine:caffeine-guava:3.0.0

in which case the fetch URL would be:

https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine-guava/3.0.0/caffeine-guava-2.8.0.jar

Example is guava-retrying library, that gerrit also depends on:

<dependency>
    <groupId>com.github.rholder</groupId>
    <artifactId>guava-retrying</artifactId>
    <version>2.0.0</version>
</dependency>

With the corresponding URL:

https://repo1.maven.org/maven2/com/github/rholder/guava-retrying/2.0.0/guava-retrying-2.0.0.jar

@ben-manes
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, you're right this does change the coordinate.
https://oss.sonatype.org/content/repositories/snapshots/com/github/ben-manes/caffeine/

That probably isn't desirable to do until we move to 3.0...

@davido
Copy link

@davido davido commented on 8cc71a1 Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, small change, big impact :-)

https://oss.sonatype.org/content/repositories/snapshots/com/github/ben-manes/caffeine/caffeine-guava/2.8.1-SNAPSHOT/caffeine-guava-2.8.1-20191110.185159-1.jar

That's exactly what we would like to have. If you would release 2.8.1 from the HEAD, then we would fetch it like this:

<dependency>
    <groupId>com.github.ben-manes.caffeine</groupId>
    <artifactId>caffeine-guava</artifactId>
    <version>2.8.1</version>
</dependency>

in which case the fetched artifact would be called: caffeine-guava-2.8.1.jar.

That probably isn't desirable to do until we move to 3.0...

What is the ETA of 3.0.0?

@ben-manes
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At best I might have time over the winter holidays, but otherwise it is unplanned. That release would bump up the minimum JDK to take advantage of VarHandles, etc.

Please sign in to comment.