maven 鏡像倉庫 setting.xml修改 & 手動導入的包如何加到maven里面


如果不知道maven安裝路徑IDEA中打File->Settings   再點Build->Maven右邊看maven安裝路徑,打開這個路徑,再打開conf/settings.xml文件

 

 

在xml中添加以下鏡像地址,

 

<mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>
</mirror>
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

<mirror>
    <id>ibiblio</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</mirror>
<mirror>
    <id>jboss-public-repository-group</id>
    <mirrorOf>central</mirrorOf>
    <name>JBoss Public Repository Group</name>
    <url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>

<mirror>
    <id>central</id>
    <name>Maven Repository Switchboard</name>
    <url>http://repo1.maven.org/maven2/</url>
    <mirrorOf>central</mirrorOf>
</mirror>
<mirror>
    <id>repo2</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo2.maven.org/maven2/</url>
</mirror>

 

 

 

手動導入的jar包如何導入到maven本地倉庫


CMD進入jar所在目錄,運行以下命令導入jar到本地倉庫(以下演示導了多個)
mvn install:install-file -DgroupId=(com.公司名) -DartifactId=(公司名-包名) -Dversion=(版本) -Dpackaging=jar -Dfile=(jar的文件名)


mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-slides -Dversion=18.7 -Dpackaging=jar -Dfile=aspose-slides-18.7-jdk16.jar
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-cells -Dversion=18.9 -Dpackaging=jar -Dfile=aspose-cells-18.9.jar
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=14.9.0 -Dpackaging=jar -Dfile=aspose-words-14.9.0-jdk16.jar
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-email -Dversion=19.6 -Dpackaging=jar -Dfile=aspose-email-19.6-jdk16.jar

pom.xml文件添加節點

<!--手動導入的aspose-->
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-slides</artifactId>
            <version>18.7</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-cells</artifactId>
            <version>18.9</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-words</artifactId>
            <version>14.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-email</artifactId>
            <version>19.6</version>
        </dependency>

 


免責聲明!

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



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