3

When using the maven-publish gradle plugin , it publishes both the myapp.jar and myapp-sources.jar files to the maven repo. How can I exclude the publish of the myapp-sources.jar to the maven repo.

Following is the publishing section for the build.gradle file for my project

project.group = 'com.test'
project.version = '0.0.1'
sourceCompatibility = '8'

publishing {
    publications {
        maven(MavenPublication){
            groupId = project.group
            artifactId = project.name
            version = project.version
            from components.java
            artifact jar
        }
    }
}
cooldev
  • 497
  • 1
  • 3
  • 17

0 Answers0