fedmest
fedmest

Reputation: 719

Gradle publishing to Maven adds a suffix that does not seem to work from Maven POM dependencies

When I publish to a local maven repository from a Gradle project, I find that the main JAR file has a -plain suffix.

pdffer/pdffer-template/1.0-SNAPSHOT 
➜ ll
total 32
-rw-r--r--  1 fedmest  staff   918B Sep  1 16:39 maven-metadata-local.xml
-rw-r--r--  1 fedmest  staff   3.8K Sep  1 16:39 pdffer-template-1.0-SNAPSHOT-plain.jar
-rw-r--r--  1 fedmest  staff   1.9K Sep  1 16:39 pdffer-template-1.0-SNAPSHOT.module
-rw-r--r--  1 fedmest  staff   1.7K Sep  1 16:39 pdffer-template-1.0-SNAPSHOT.pom

When I include this library as a Maven dependency from a POM file, it cannot find it - it only works if I rename the main JAR to exclude the -plain suffix. Can I get Gradle to generate the JAR without the suffix? Any idea why the suffix appears, please?

Upvotes: 4

Views: 2679

Answers (1)

orid
orid

Reputation: 329

To disable 'plain', follow the springboot documentation: https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#packaging-executable.and-plain-archives

jar {
    classifier = ''
}

I also found the answer here: https://stackoverflow.com/a/67752182/11723872

Upvotes: 6

Related Questions