@@ -12,22 +12,22 @@ tasks.register('checkArtifactExists') {
1212 }
1313
1414 def repoUrl = project. hasProperty(' mavenRepoUrl' ) ? project. mavenRepoUrl : mavenLocalUrl
15- def artifactPath = " ${ repoUrl} /${ project.group.replace('.', '/')} /${ project.archivesBaseName } /${ project.version} /${ project.archivesBaseName } -${ project.version} .jar"
15+ def artifactPath = " ${ repoUrl} /${ project.group.replace('.', '/')} /${ project.base.archivesName } /${ project.version} /${ project.base.archivesName } -${ project.version} .jar"
1616 logger. lifecycle(" Checking if artifact exists at: $artifactPath " )
1717
1818 if (artifactPath. startsWith(' file:/' )) {
1919 // Handle file URLs
2020 def file = new File (new URI (artifactPath))
2121 if (file. exists()) {
22- throw new IllegalStateException (" Artifact '${ project.group} :${ project.archivesBaseName } :${ project.version} ' already exists. Publishing aborted." )
22+ throw new IllegalStateException (" Artifact '${ project.group} :${ project.base.archivesName } :${ project.version} ' already exists. Publishing aborted." )
2323 }
2424 } else {
2525 // Handle HTTP URLs
2626 def url = new URL (artifactPath)
2727 def connection = url. openConnection()
2828 connection. setRequestMethod(' HEAD' )
2929 if (connection. responseCode == 200 ) {
30- throw new IllegalStateException (" Artifact '${ project.group} :${ project.archivesBaseName } :${ project.version} ' already exists. Publishing aborted." )
30+ throw new IllegalStateException (" Artifact '${ project.group} :${ project.base.archivesName } :${ project.version} ' already exists. Publishing aborted." )
3131 }
3232 }
3333 logger. lifecycle(" Artifact does not exist, proceeding with publish." )
@@ -43,7 +43,7 @@ publishing {
4343 mavenJava(MavenPublication ) {
4444 from components. java
4545 groupId = project. group
46- artifactId = project. archivesBaseName
46+ artifactId = project. base . archivesName
4747 version = project. version
4848
4949 // Attach sources JAR to the publication
0 commit comments