向本地添加jar包的经历

举例:

Jruby.jar包 安装到本地

命令

mvn install:install-file -Dfile=C:\Users\Administrator\Desktop\jruby-complete-9.3.3.0.jar -DgroupId=org.jruby -DartifactId=jruby-complete -Dversion=9.3.3.0 -Dpackaging=jar

可能出现的报错:

[ERROR] No plugin found for prefix 'install' in the current project and in the p lugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the re positories [local ({my repository path}), central (https://repo.maven. apache.org/maven2)]

 

maven的settings.xml文件改成,其中localRepository改为自己的安装maven地址的repository

<?xml version="1.0" encoding="UTF-8"?>
<settings> 
<localRepository>C:\apache-maven-3.0.4\repository</localRepository>
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
  <profiles>
    <profile>
       <id>nexus</id> 
        <repositories>
            <repository>
                <id>nexus</id>
                <name>local private nexus</name>
                <url>http://maven.oschina.net/content/groups/public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        
        <pluginRepositories>
            <pluginRepository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile></profiles>
</settings>

 

posted on 2022-03-04 14:38  Esquecer  阅读(38)  评论(0编辑  收藏  举报

导航