stempler / gradle-versioneye-plugin

Plugin for Gradle to update your project's dependencies status on www.versioneye.com
MIT License
31 stars 5 forks source link

allow change GAC artifact_id if project.name doesn't match artifact basename #43

Open childnode opened 6 years ago

childnode commented 6 years ago

https://github.com/stempler/gradle-versioneye-plugin/blob/master/src/main/groovy/org/standardout/gradle/plugin/versioneye/PomTask.groovy#L150

is fixed to project.name which is a bad idea for submoduled projects, since it might be duplicate in different projects where artifacts baseName is set differently (refer to Tar.baseName or or Jar.baseName both feeded by project.archivesBaseName

even the current solution is only manageable in projects without submodules where rootProject.name can be set in gradle.settings, but any subsequent module's project.name is hard set in gradle.settings (pathname by convention) and not manageable by project.name in subproject's build.gradle (read only prop)

so: please use project.archivesBaseName as artifact_id in PomTask! else you have to hack s.th. like

./gradlew -q :${app}:versioneye-pom;
mv ${app}/build/pom.json{,.bak};
prjname="<what you set up for project.archivesBaseName>"
jq ".artifact_id=\"${prjname}\"" ${app}/build/pom.json.bak > ${app}/build/pom.json;
jq '.artifact_id' ${app}/build/pom.json;
./gradlew :${app}:versionEyeCreate -x :${app}:versioneye-pom;