Hi all. This fixed my issue that I believe is similar to the ones above. The problem I see is that each publication in the publishing config gets a new timestamp for the upload. I am using Spring Boot and its plugin as well. So by adding the extra artifacts ( from the Jar tasks) to the one publication, it worked. All items have the same timestamp that matches and the metadata.xml file appears to work such that a dependent project can now access the api objects. See this example:
task apiJar(type: Jar) {
classifier = 'api'
from(sourceSets.main.output) {
include "com/company/app/dto/**"
}
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task apiSourceJar(type: Jar, dependsOn: classes) {
classifier = 'api-sources'
from(sourceSets.main.allSource) {
include "com/company/app/dto/**"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom.withXml {
asNode().appendNode('description', 'APP Sprint Boot App')
}
artifact apiJar
artifact sourceJar
artifact apiSourceJar
}
}
repositories {
maven {
credentials {
username = 'username'
password = 'password'
}
if(project.version.endsWith('-SNAPSHOT')) {
url "http://server:9081/artifactory/libs-snapshot-local"
} else {
url "http://server:9081/artifactory/libs-release-local"
}
}
}
}