• maven仓库失效的情况下搭建maven项目


    maven仓库失效的情况下搭建maven项目

    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;
    project structure > Model > Dependencies > + Jars or Directory,选择WEB-INF下面的lib 此时,就可以用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了;
  • 相关阅读:
    java 实现一段文字中,出现次数最多的字
    json 字符串 <----> json 对象
    农场销售
    IDEA Tomcat配置 VM Option
    java用JSONObject生成json
    面向对象
    java读取 properties配置文件
    Jquery span标签的取值赋值
    Oracle 分析函数 over
    gitee指令集合
  • 原文地址:https://www.cnblogs.com/stono/p/10867775.html
Copyright © 2020-2023  润新知