maven倉庫失效的狀況下搭建maven項目web
1,在有maven倉庫的狀況下mvn clean package 2,整個項目拷貝到沒有的環境下 3,ls |xargs -t -I a cp a/pom.xml a/pomback.xml 4,ls |xargs -t -I a vi a/pom.xml 進行全部dependency的刪除,vi: 999 dd注意補充</project> 5,ls |xargs -t -I {} mv {}/target/{}-1.0-SNAPSHOT/WEB-INF/lib {}/src/main/webapp/WEB-INF/ # 進行lib目錄的移動 6,在idea中打開,設置項目屬性,設置modules和artifacts,參考https://blog.csdn.net/fly910905/article/details/78849156 設置artifacts的時候,右側文件夾能夠整個拖過來,而後須要反覆拖動幾回;不須要設置artifacts; 此時,就能夠用idea來進行項目的運行了; 7,在pom中能夠增長編譯jar包引用,參考https://blog.csdn.net/catoop/article/details/48489365, 使用: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> <compilerArgs> <arg>-verbose</arg> <arg>-Xlint:unchecked</arg> <arg>-Xlint:deprecation</arg> <arg>-extdirs</arg> <arg>${project.basedir}/src/main/webapp/WEB-INF/lib</arg> </compilerArgs> </configuration> </plugin> </plugins> </build>這時候可使用mvn clean package了;