mvn deploy上传jar包到远程仓库

  • 使用idea deploy命令

配置pom.xml

   ff-model
   
      
         org.apache.maven.plugins
         maven-compiler-plugin
         2.3.1
         
            1.7
            1.7
            UTF-8
         
      
      
         org.apache.maven.plugins
         maven-surefire-plugin
         2.17
         
            true
         
      
      
         maven-source-plugin
         
            
               attach-sources
               deploy
               
                  jar-no-fork
               
            
         
      
      
         maven-javadoc-plugin
         
            
               attach-javadocs
               deploy
               
                  jar
               
            
         
      
      
         
         maven-deploy-plugin
         
            
               deploy
               deploy
               
                  deploy
               
            
         
      
   
   
      
         src/main/java
         
            **/*.dic
            **/*.xml
         
      
      
         src/main/resources
      
   



   
      releases
      http://nexus.xx.com/content/repositories/releases
   
   
      snapshots
      http://nexus.xx.com/content/repositories/snapshots
   

 

配置setting.xml

  

                            releases

                            admin

                            admin123

                  

                  

                            snapshots

                            admin

                            admin123

                  

注意pom.xml中的id和setting.xm的id名称要一致

执行deploy命令
mvn deploy上传jar包到远程仓库_第1张图片
  • maven命令上传

    上传到本地仓库 上传到远程仓库

    mvn install:install-file -DgroupId=com.lagou.plat.bi.mysql-connector-java-bin -DartifactId=mysql-connector-java-bin -Dversion=0.0.1 -Dpackaging=jar -Dfile=D:\workspace\test\lagouBI\mysql-connector-java-bin.jar
    mvn deploy:deploy-file -DgroupId=com.lagou.plat.bi.mysql-connector-java-bin -DartifactId=mysql-connector-java-bin -Dversion=0.0.1 -Dpackaging=jar -Dfile=D:\workspace\test\lagouBI\mysql-connector-java-bin.jar -Durl=http://nexus.lagou.com/content/repositories/releases -DrepositoryId=releases
     

     

 

你可能感兴趣的:(maven)