简体   繁体   中英

Migrate maven project in offline environment

I have created a web application in spring mvc and now i have to migrate the project to an offline machine but when i imported the project in my eclipse(offline) then it got stuck on "Importing Maven Projects" and also it is showing an error in my pom.xml file at tag :-

    <plugins>
     <plugin> // shows error over here
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>

I also read something about mvn dependency:go-offline so I tried it but couldn't exactly understand that where it saves the dependencies? So, is there a way through which i could import the project in the offline environment?

As pointed out by @Thomas , the only way to build a project which needs external dependencies with Maven is to copy the repository in the target environment. Build your project on an online environment, then copy your .m2 folder in the offline one. The build will then find all required libraries locally. With mvn dependency:go-offline you tell maven to download all the needed plugin dependencies in your local repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM