1 第一个问题
执行mvn clean deploy失败,报错如下:
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.cainiao:nballowance-client:jar:1.0.4-snapshot from/to releases (http://mvnrepo.xxx.com/mvn/releases): Failed to transfer file: http://mvnrepo.xxx.com/mvn/releases/com/cainiao/nballowance-client/1.0.4-snapshot/nballowance-client-1.0.4-snapshot.jar. Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)pom.xml文件也是snapshot的(release权限控制,不能再本地deloy到中央仓库)<groupId>com.xxx</groupId> <artifactId>nballowance-client</artifactId> <packaging>jar</packaging> <version>1.0.4-snapshot</version>问题出在这里,version版本号snapshot是小写的,改成大写后OK。2 第二个问题
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failureUnable to locate the Javac Compiler in: d:/jdk1.8.0_101/../lib/tools.jarPlease ensure you are using JDK 1.4 or above andnot a JRE (the com.sun.tools.javac.Main class is required).In most cases you can change the location of your Javainstallation by setting the JAVA_HOME environment variable.检查 JAVA_HOME 符合预期$ echo $JAVA_HOMED:/jdk1.8.0_101解决办法新建一个文件夹命名为lib,拷贝 tools.jar文件到新建的lib文件夹,把lib文件夹拷贝到和jdk1.8.0_101文件夹同级的目录(D盘下)
然后执行 mvn clean deploy 解决。
新闻热点
疑难解答