Hi,
I have a multimodule project that someone else have done. It generates multiple .ear files through a external tool (product provided tool) in a filesystem dir. I want to upload these .ear files to Nexus maven repository in through init script , but if i declare more than one artifacts -> archives of type: ‘ear’ it just uploads one. I’ve tried changing the type to ‘EAR’ and ‘jar’ and it works.
Is this the way it behaves , there is something that I’m missing or I’m doing something wrong?.
I’ve pasted the code I’m using in the init script below. Also on pastebin http://pastebin.com/VjhnFca5
rootProject{
def dirEars_dir = "/ears"
def earArtifactsList = []
artifacts {
new File(dirEars).eachFileMatch(~/.*.ear/) {fileEar ->
archives file: file(fileEar.getAbsolutePath()), name: fileEar.getName().replaceAll(".ear",""), type: 'ear'
earArtifactsList.add(fileEar.getName().replaceAll(".ear",""))
}
}
rootProject.group = "com.myproject"
rootProject.version = "0.1-SNAPSHOT"
uploadArchives{
repositories {
mavenDeployer {
uniqueVersion = false
name = 'earsUpload'
repository(id: "ears",url: "${mavenRepositoryReleasesUrl}")
snapshotRepository(id: "ears-snapshots",url: "${mavenRepositorySnapshotsUrl}")
earArtifactsList.each { earName ->
addFilter(earName) {artifact, file ->
artifact.name == earName
}
pom(earName).artifactId = earName
pom(earName).groupId = "${rootProject.group}"
pom(earName).version = "${rootProject.version}"
}
}
}
}
}
Thanks in advance,
Pedro.