zoukankan      html  css  js  c++  java
  • maven打包jar源码至私服

    1. setting文件 配置私服中设置的用户和密码

     <servers>
            <server>
                <id>releases</id>  
                <username>admin</username>  
                <password>xxxxxxxxxxx</password>  
            </server>
            <server>
                <id>snapshots</id>  
                <username>admin</username>  
                <password>xxxxxxxxx</password>  
           </server>  
           <server>
                <id>Nexus</id>  
                <username>admin</username>  
                <password>xxxxxxx</password>  
           </server>  
           <server>
                <id>Nexus2</id>  
                <username>admin</username>  
                <password>xxxxxxx</password>  
           </server>

    2.需要打包的项目的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">
        <version>1.1.0</version>
        <modelVersion>4.0.0</modelVersion>
        <packaging>jar</packaging>
        <artifactId>msg-service</artifactId>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.plugin.version>3.2</maven.compiler.plugin.version>
            <maven_jar_plugin_version>2.4</maven_jar_plugin_version>
        </properties>
    
        <dependencies>
           
            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
            <dependency>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.0.1</version>
            </dependency>
    
        </dependencies>
    
        <distributionManagement>
            <repository>
                <id>releases</id>
                <name>Maven Snapshots</name>
                <url>http://192.168.79.16:9081/nexus/content/repositories/releases</url>
            </repository>
            <snapshotRepository>
                <id>snapshots</id>
                <name>Maven Snapshots</name>
                <url>http://192.168.79.16:9081/nexus/content/repositories/snapshots</url>
            </snapshotRepository>
        </distributionManagement>
    
        <build>
            <finalName>msg-service</finalName>
            <sourceDirectory>src/main/java/com/fqgj/jkzj/msg/service</sourceDirectory>
            <!--<resources>-->
            <!--&lt;!&ndash; 控制资源文件的拷贝 &ndash;&gt;-->
            <!--<resource>-->
            <!--<directory>...</directory>-->
            <!--</resource>-->
            <!--</resources>-->
    
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <inherited>true</inherited>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <skip>true</skip><!-- 跳过测试 -->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven_jar_plugin_version}</version>
                    <configuration>
                        <archive>
                            <addMavenDescriptor>true</addMavenDescriptor>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
  • 相关阅读:
    省选D2T2 滚榜
    CF1516E(第一类斯特林数)
    Atcoder ZEP F题
    Atcoder ARC 115 A~D
    Atcoder ARC 117
    「舞蹈链 DLX 」学习笔记
    「FJOI-2021」仰视那片离我远去了的天空。
    「UVA1603」破坏正方形 Square Destroyer
    「网络流」学习笔记
    博客搬家
  • 原文地址:https://www.cnblogs.com/likun10579/p/7221263.html
Copyright © 2011-2022 走看看