Maven Deploy External JAR: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<source lang="bash>
<syntaxhighlight lang="bash>
mvn deploy:deploy-file -DgroupId=<group-id> \
mvn deploy:deploy-file -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -DartifactId=<artifact-id> \
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>
</syntaxhighlight>


==Install4j==
==Install4j==
<source lang="bash>
<syntaxhighlight lang="bash>
# https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/
# 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 pom.xml https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1.pom
Line 16: Line 16:
wget -O install4j-runtime-sources.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-sources.jar
wget -O install4j-runtime-sources.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-sources.jar
wget -O install4j-runtime-javadoc.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-javadoc.jar
wget -O install4j-runtime-javadoc.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-javadoc.jar
</source>
</syntaxhighlight>


==pom.xml==
==pom.xml==
<code>nano pom.xml</code>
<code>nano pom.xml</code>
<source lang="xml>
<syntaxhighlight lang="xml>
<?xml version="1.0" encoding="UTF-8"?>
<?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"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Line 43: Line 43:
     </build>
     </build>
</project>
</project>
</source>
</syntaxhighlight>


==settings.xml==
==settings.xml==
<code>nano ~/.m2/settings.xml </code>
<code>nano ~/.m2/settings.xml </code>
<source lang="xml>
<syntaxhighlight lang="xml>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<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">
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
Line 58: Line 58:
   </servers>
   </servers>
</settings>
</settings>
</source>
</syntaxhighlight>


==Deploy==
==Deploy==
===jar===
===jar===
<source lang="bash>
<syntaxhighlight lang="bash>
mvn deploy:deploy-file \
mvn deploy:deploy-file \
     -Durl=ftp://ftp.chorke.org \
     -Durl=ftp://ftp.chorke.org \
Line 69: Line 69:
     -Dfile=./install4j-runtime.jar \
     -Dfile=./install4j-runtime.jar \
     -DpomFile=./pom.xml  
     -DpomFile=./pom.xml  
</source>
</syntaxhighlight>


===javadoc===
===javadoc===
<source lang="bash>
<syntaxhighlight lang="bash>
mvn deploy:deploy-file \
mvn deploy:deploy-file \
     -Dfile=install4j-runtime-javadoc.jar \
     -Dfile=install4j-runtime-javadoc.jar \
Line 79: Line 79:
     -Dclassifier=javadoc \
     -Dclassifier=javadoc \
     -DpomFile=./pom.xml
     -DpomFile=./pom.xml
</source>
</syntaxhighlight>


===sources===
===sources===
<source lang="bash>
<syntaxhighlight lang="bash>
mvn deploy:deploy-file \
mvn deploy:deploy-file \
     -Dfile=install4j-runtime-sources.jar \
     -Dfile=install4j-runtime-sources.jar \
Line 89: Line 89:
     -Dclassifier=sources \
     -Dclassifier=sources \
     -DpomFile=./pom.xml
     -DpomFile=./pom.xml
</source>
</syntaxhighlight>


==References==
==References==
{|
| valign="top" |
* [https://maven.apache.org/plugins/maven-javadoc-plugin/faq.html  Deploying 3rd party Javadoc to remote repository]
* [https://maven.apache.org/plugins/maven-javadoc-plugin/faq.html  Deploying 3rd party Javadoc to remote repository]
* [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]
* [[Maven Checkstyle Plugin]]
* [[Maven]]
| valign="top" |
| valign="top" |
|}

Latest revision as of 00:01, 30 August 2024

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>

Install4j

# 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
wget -O install4j-runtime-sources.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-sources.jar
wget -O install4j-runtime-javadoc.jar https://maven.ej-technologies.com/repository/com/install4j/install4j-runtime/7.0.1/install4j-runtime-7.0.1-javadoc.jar

pom.xml

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>
        </extensions>
    </build>
</project>

settings.xml

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">
  <servers>
    <server>
      <id>chorke.public.ftp</id>
      <username>[email protected]</username>
      <password>{snFXdvLERDsHbIUFFAACV4R11mssWn97DfYdmrAAV9k=}</password>
    </server>
  </servers>
</settings>

Deploy

jar

mvn deploy:deploy-file \
    -Durl=ftp://ftp.chorke.org \
    -DrepositoryId=chorke.public.ftp \
    -Djava.net.preferIPv4Stack=true \
    -Dfile=./install4j-runtime.jar \
    -DpomFile=./pom.xml

javadoc

mvn deploy:deploy-file \
    -Dfile=install4j-runtime-javadoc.jar \
    -DrepositoryId=chorke.public.ftp \
    -Durl=ftp://ftp.chorke.org \
    -Dclassifier=javadoc \
    -DpomFile=./pom.xml

sources

mvn deploy:deploy-file \
    -Dfile=install4j-runtime-sources.jar \
    -DrepositoryId=chorke.public.ftp \
    -Durl=ftp://ftp.chorke.org \
    -Dclassifier=sources \
    -DpomFile=./pom.xml

References