码迷,mamicode.com
首页 > Web开发 > 详细

maven打包上传到本地中央库

时间:2018-10-23 14:42:48      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:art   xxxx   源码包   col   version   test   oal   targe   com   

pom文件中添加插件如下

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <testSource>${java.version}</testSource>
                    <testTarget>${java.version}</testTarget>
                </configuration>
            </plugin>
            <!--配置生成源码包-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>Nexus Release Repository</name>
            <url>http://xxxx:8081/repository/cetccd_hosted/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://xxxx:8081/repository/cetccd_snapshots/</url>
        </snapshotRepository>
        </distributionManagement>
    

 

settings.xml文件添加如下内容

<server>
        <id>snapshots</id>
        <username>admin</username>
        <password>xxxx</password>
    </server>
    <server>   
        <id>releases</id>   
        <username>admin</username>   
        <password>xxxx</password>   
    </server> 

 

 

 

clean deploy -Dmaven.test.skip=true

技术分享图片

 

maven打包上传到本地中央库

标签:art   xxxx   源码包   col   version   test   oal   targe   com   

原文地址:https://www.cnblogs.com/yuluoxingkong/p/9835709.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!