Maven offline - problem with mvn-plugins

前端 未结 6 1905
滥情空心
滥情空心 2021-01-12 06:49

I\'m using maven in my project and I need to run the build in a non-internet-access machine.

When I test my project build everything is working, bu

6条回答
  •  攒了一身酷
    2021-01-12 07:34

    In order to cache plugins into the .m2/repository folder you would need to specify all plugins explicitly with the mvn :help

    You would also need to specify explicit version for each plugin in the or section of your pom.xml

     
      org.apache.maven.plugins
      maven-surefire-plugin
      2.19
      
        
          org.apache.maven.surefire
          surefire-testng
          2.19
        
      
    
    

    This is needed to make sure that mvn install -o uses the same plugin version.

    Ofcourse you would also need to run mvn dependency:go-offline to take care of your compile and test dependencies.

    mvn assembly:help compiler:help enforcer:help exec:help failsafe:help install:help jar:help resources:help surefire:help mvn dependency:go-offline mvn compile --offline

提交回复
热议问题