Maven Deploy External JAR: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \ | -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \ | ||
-Durl=<url-of-the-repository-to-deploy> | -Durl=<url-of-the-repository-to-deploy> | ||
</source> | |||
==Example== | |||
<source lang="bash> | |||
# https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/ | |||
wget -O pom.xml https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1.pom | |||
wget -O install4j-runtime.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1.jar | |||
nano pom.xml | |||
</source> | |||
<source lang="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/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<artifactId>install4j-runtime</artifactId> | |||
<groupId>com.install4j</groupId> | |||
<name>install4j-runtime</name> | |||
<packaging>jar</packaging> | |||
<version>7.0.1</version> | |||
<build> | |||
<finalName>${project.artifactId}</finalName> | |||
<extensions> | |||
<extension> | |||
<groupId>org.apache.maven.wagon</groupId> | |||
<artifactId>wagon-ftp</artifactId> | |||
<version>2.8</version> | |||
</extension> | |||
<extension> | |||
<groupId>org.apache.maven.wagon</groupId> | |||
<artifactId>wagon-ssh</artifactId> | |||
<version>2.8</version> | |||
</extension> | |||
</extensions> | |||
</build> | |||
</project> | |||
</source> | |||
<code>nano ~/.m2/settings.xml </code> | |||
<source lang="xml> | |||
<settings 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/settings-1.0.0.xsd"> | |||
<!-- localRepository | |||
| The path to the local repository maven will use to store artifacts. | |||
| | |||
| Default: ${user.home}/.m2/repository | |||
<localRepository>/path/to/local/repo</localRepository> | |||
--> | |||
<servers> | |||
<server> | |||
<id>medisys.public.ftp</id> | |||
<username>[email protected]</username> | |||
<password>{snFXdvLERDsHbIUFFAACV4R11mssWn97DfYdmrAAV9k=}</password> | |||
</server> | |||
</servers> | |||
</settings> | |||
</source> | |||
<source lang="bash> | |||
mvn deploy:deploy-file\ | |||
-Durl=ftp://ftp.chorke.org\ | |||
-DrepositoryId=chorke.public.ftp\ | |||
-Djava.net.preferIPv4Stack=true\ | |||
-Dfile=./install4j-runtime.jar\ | |||
-DpomFile=./pom.xml | |||
</source> | </source> | ||
==References== | ==References== | ||
* [https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html Deploying 3rd party JARs to remote repository] | * [https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html Deploying 3rd party JARs to remote repository] |
Revision as of 18:41, 26 August 2019
mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<type-of-packaging> \
-Dfile=<path-to-file> \
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
-Durl=<url-of-the-repository-to-deploy>
Example
# https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/
wget -O pom.xml https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1.pom
wget -O install4j-runtime.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1.jar
nano 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>install4j-runtime</artifactId>
<groupId>com.install4j</groupId>
<name>install4j-runtime</name>
<packaging>jar</packaging>
<version>7.0.1</version>
<build>
<finalName>${project.artifactId}</finalName>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.8</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.8</version>
</extension>
</extensions>
</build>
</project>
nano ~/.m2/settings.xml
<settings 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/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<servers>
<server>
<id>medisys.public.ftp</id>
<username>[email protected]</username>
<password>{snFXdvLERDsHbIUFFAACV4R11mssWn97DfYdmrAAV9k=}</password>
</server>
</servers>
</settings>
mvn deploy:deploy-file\
-Durl=ftp://ftp.chorke.org\
-DrepositoryId=chorke.public.ftp\
-Djava.net.preferIPv4Stack=true\
-Dfile=./install4j-runtime.jar\
-DpomFile=./pom.xml