Hello everyone,
I need some assisstance deploying a JAR file to my projects maven repository.
I am running a clojure app, and have a rebuilt jar file that I wish to deploy as is, I tried following several guides but still hitting a wall.
Here is my config:
settings.xml
:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${env.CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
pom.xml
:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ID</groupId>
<artifactId>ID</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>NAME</name>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.9</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab.com/api/v4/groups/xxxxxxx/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab.com/api/v4/projects/xxxxxxx/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://gitlab.com/api/v4/projects/xxxxxxx/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
.gitlab-ci.yaml
job config:
deploy-jar:
stage: deploy-jar
image: maven:3.3.9-jdk-8
dependencies:
- build-jar
script:
- mvn deploy:deploy-file \
-Durl=https://gitlab.com/api/v4/groups/xxxxxx/-/packages/maven/ \
-DrepositoryId=gitlab-maven \
-Dfile=target/jar/ID-1.0.0-SNAPSHOT.jar \
-DgroupId=ID \
-DartifactId=ID \
-Dversion=1.0.0-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true
I am getting the following error:
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 256.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.896 s
[INFO] Finished at: 2019-08-19T05:27:37+00:00
[INFO] Final Memory: 11M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix ' -Durl=https' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
this came after several failed attempts, making me feel like I have a fundamentally wrong approach.
Any help is appreciated.
Many thanks,
MM