【Java】Java引用maven私服jar包及jar包提交私服問題


pom.xml中加入以下配置即可

 

1.引用私服jar包

    <!-- 加載的是 第三方項目使用的jar包 -->
    <repositories>
        <repository>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>java</id>
            <name>java</name>
            <url>http://192.168.8.100:8081/repository/java/</url>
        </repository>
    </repositories>

    <!--加載的是maven生命周期插件的jar包-->
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>java</id>
            <name>java</name>
            <url>http://192.168.8.100:8081/repository/java/</url>
        </pluginRepository>
</pluginRepositories>

 2.jar包提交私服

    <distributionManagement>
    <!--    <repository>
            <id>nexus-aliyun</id>
            <name>Nexus aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </repository>-->
        <repository>
            <id>releases</id>
            <url>http://192.168.8.100:8081/repository/java/</url>
        </repository>
        <snapshotRepository>
            <id>Snapshots</id>
            <url>http://192.168.8.100:8081/repository/java/</url>
        </snapshotRepository>
    </distributionManagement>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM