I am having some issues publishing a custom Gradle plugin, and I am struggling to figure out what I have done wrong.
When I publish my plugin via “publishToMavenLocal”, I am able to resolve it correctly and everything looks fine.
When I publish my plugin to my own HTTP maven repository, the artifacts are ending up in the locations I expected. However when I go to use it, it fails with the following error:
The format in that error message looks to be the plugin marker format which I expect it to only use for the initial POM resolution and then it should resolve the plugins JAR files based on the dependency in the plugin marker POM.
When looking at the differences between my ~.m2 directory and what gets created on the HTTP server, the folder paths all look correct but the maven local version is not producing as many files. My .m2 version will have
com/business/cicd/business-project/com.business.cicd.business-project.gradle.plugin/0.1/com.business.cicd.business-project.gradle.plugin-0.1.pom
but the HTTP repository version will have
.pom
.pom.md5
.pom.sha1
.pom.sha256
.pom.sha.512
Here is the contents of the POM file from my HTTP repository
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.business.cicd.business-project</groupId>
<artifactId>com.business.cicd.buisness-project.gradle.plugin</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>com.buisness.cicd</groupId>
<artifactId>cicd-worker</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
</project>
Here is the contents of my POM file from mavenLocal
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.business.cicd.business-project</groupId>
<artifactId>com.business.cicd.business-project.gradle.plugin</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>com.business.cicd</groupId>
<artifactId>cicd-worker</artifactId>
<version>0.1</version>
</dependency>
</dependencies>
</project>
The com.business.cicd:cicd-worker:0.1 dependency is able to be resolved from my HTTP repository if I try to use it as an implementation dependency, it just seems to be an issue with the plugin marker not resolving correctly.
Any insight at all to this would be greatly appreciated.