I have 2 artifacts I want to push. first one is a tar ball called myTarBall-1.1.tar.gz second one is a jar file myJarFile-1.1.jar
I want to push myTarBall-1.1.tar.gz into nexus to the following location com.sample.location.abc. I then want to push myJarFile-1.1.jar into nexus to the following location com.sample.location.xyz.
How would I go about doing that?
Thus far, I am only successful in pushing the myTarBall-1.1.tar.gz to com.sample.location.abc, but I can't figure out how to push myJarFile-1.1.jar to com.sample.location.xyz...
Any help would be appreciated...
Below is my build.gradle file:
plugins
{
id 'maven-publish'
}
group = "com.sample.location.abc"
version = "1.1"
def artifact_tar = 'myTarBall'
def artifact_jar = 'myJarFile'
publishing {
publications {
maven(MavenPublication) {
groupId = "${project.group}"
artifactId = "${artifact_tar}"
version = "${version}"
artifact source: "${artifact_tar}-${version}.tar.gz", extension: "tar.gz"
??? How to also push myJarFile-1.1.jar to com.sample.location.xyz in here???
}
}
}
In order to be able to push artifacts to different groups, I simply needed to add a new publication, which was suggested by @user16358266
publishing {
publications {
mavenOne(MavenPublication) {
groupId = "${project.group}"
artifactId = "${artifact_tar}"
version = "${version}"
artifact source: "${artifact_tar}-${version}.tar.gz", extension: "tar.gz"
}
mavenTwo(MavenPublication) {
groupId = "${**new.group.id**}"
artifactId = "${artifact_jar}"
version = "${version}"
artifact source: "${artifact_jar}-${version}.jar", extension: "jar"
}
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments