Created
March 31, 2021 22:14
-
-
Save igouss/be06fa12cb757b26e275a57b4dcfbd6d to your computer and use it in GitHub Desktop.
gradle Export jar files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task exportApiServiceParametersJar(type : Jar) { | |
from { sourceSets.main.output.classesDirs } { | |
include "com/foo/api/service/parameters/**" | |
} | |
dependsOn compileJava | |
} | |
task exportApiPagingJar(type : Jar) { | |
from { sourceSets.main.output.classesDirs } { | |
include "com/foo/api/paging/**" | |
} | |
dependsOn compileJava | |
} | |
publishing { | |
repositories { | |
maven { | |
credentials { | |
username project.getProperty("nexusPublishUsername") | |
password project.getProperty("nexusPublishPassword") | |
} | |
if (project.version.endsWith('-SNAPSHOT')) { | |
url "https://nexus/repository/maven-snapshots/" | |
} else { | |
url "https://nexus/repository/maven-releases/" | |
} | |
} | |
} | |
publications { | |
exportApiServiceParameters(MavenPublication) { | |
groupId = 'com.foo.api.service' | |
artifactId = 'parameters' | |
artifact exportApiServiceParametersJar | |
} | |
exportApiPaging(MavenPublication) { | |
groupId = 'com.foo.api' | |
artifactId = 'paging' | |
artifact exportApiPagingJar | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment