持续集成之打包配置

1、使用IEDA打包Maven项目

(1)先配置maven的环境变量:

(2)修改maven的conf目录下的 settings.xml,配置本地仓库以及远程仓库【远程仓库为阿里云的,或者使用默认配置】

远程仓库

     <!-- 阿里云仓库-->
    <mirror>
        <id>alimaven</id>
        <mirrorOf>central</mirrorOf>          
        <name>aliyun maven</name>  
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>     
    </mirror>

 

(3)配置maven中的jdk信息,并激活配置

 

(4)POM文件中打包插件的JDK配置信息需maven配置保持一致

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <verbose>true</verbose>
                <fork>true</fork>
                <executable>${JAVA_HOME}/bin/javac</executable>
            </configuration>
        </plugin>
    </plugins>
</build>

(5)常见问题

(5.1)该类问题,可尝试删除maven-compiler-plugin所有的jar包重新下载,或者检查远程仓库是否能访问到 clean、compiler

Error: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not b

CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved

(5.2)maven中jdk与打包编译使用jdk没有保持一致

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ApiAutoTest
190728: Fatal error compiling: 无效的目标发行版: 1.8 -> [Help 1]

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值