标签:compiler conf 用户 direct ram distrib bin col dcl
对工程里一个用来对外提供jar的module进行deploy。
直接在IDEA的maven面板里执行deploy是没问题的,可以正常发布到私服上。而在执行clean deploy命令时,却总是不成功,提示Return code is: 401, ReasonPhrase: Unauthorized.
为什么我没权限呢?我可以deploy的呀!
迟疑一刻,才豁然明白,maven服务器自然是要做权限控制的,普通用户都能删除仓库里的包,岂不是太可怕了。嘿嘿~
附pom配置:
<distributionManagement> <repository> <id>releases</id> <url>http://192.168.40.196:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://192.168.40.196:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
附build错误:
"C:\Program Files\Java\jdk1.8.0_40\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi -Dmaven.home=D:\Java\apache-maven-3.3.3 -Dclassworlds.conf=D:\Java\apache-maven-3.3.3\bin\m2.conf "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.4\lib\idea_rt.jar=35487:C:\Program Files\JetBrains\IntelliJ IDEA 2018.3.4\bin" -Dfile.encoding=UTF-8 -classpath D:\Java\apache-maven-3.3.3\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2018.3.4 clean deploy -DskipTests [INFO] ------------------------------------------------------------------------ [INFO] Building omsbase-rpcapi 1.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ omsbase-rpcapi --- [INFO] Deleting D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi\target [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ omsbase-rpcapi --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 26 source files to D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi\target\classes [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ omsbase-rpcapi --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ omsbase-rpcapi --- [INFO] Building jar: D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi\target\omsbase-rpcapi-1.0.1-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ omsbase-rpcapi --- [INFO] Installing D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi\target\omsbase-rpcapi-1.0.1-SNAPSHOT.jar to D:\workspace\m3\com\emax\zhenghe\omsbase-rpcapi\1.0.1-SNAPSHOT\omsbase-rpcapi-1.0.1-SNAPSHOT.jar [INFO] Installing D:\SourceProject\zhenghe\oms_base\omsbase-rpcapi\pom.xml to D:\workspace\m3\com\emax\zhenghe\omsbase-rpcapi\1.0.1-SNAPSHOT\omsbase-rpcapi-1.0.1-SNAPSHOT.pom [INFO] [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ omsbase-rpcapi --- Downloading: http://192.168.40.196:8081/nexus/content/repositories/snapshots/com/emax/zhenghe/omsbase-rpcapi/1.0.1-SNAPSHOT/maven-metadata.xml Downloaded: http://192.168.40.196:8081/nexus/content/repositories/snapshots/com/emax/zhenghe/omsbase-rpcapi/1.0.1-SNAPSHOT/maven-metadata.xml (780 B at 0.9 KB/sec) Uploading: http://192.168.40.196:8081/nexus/content/repositories/snapshots/com/emax/zhenghe/omsbase-rpcapi/1.0.1-SNAPSHOT/omsbase-rpcapi-1.0.1-20200506.101246-7.jar Uploading: http://192.168.40.196:8081/nexus/content/repositories/snapshots/com/emax/zhenghe/omsbase-rpcapi/1.0.1-SNAPSHOT/omsbase-rpcapi-1.0.1-20200506.101246-7.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 30.762 s [INFO] Finished at: 2020-05-06T18:12:47+08:00 [INFO] Final Memory: 57M/516M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project omsbase-rpcapi: Failed to deploy artifacts: Could not transfer artifact com.emax.zhenghe:omsbase-rpcapi:jar:1.0.1-20200506.101246-7 from/to snapshots (http://192.168.40.196:8081/nexus/content/repositories/snapshots/): Failed to transfer file: http://192.168.40.196:8081/nexus/content/repositories/snapshots/com/emax/zhenghe/omsbase-rpcapi/1.0.1-SNAPSHOT/omsbase-rpcapi-1.0.1-20200506.101246-7.jar. Return code is: 401, ReasonPhrase: Unauthorized.
附maven私服仓库截图:
豁然明白的囧事 之 执行mvn:clean deploy提示Unauthorized
标签:compiler conf 用户 direct ram distrib bin col dcl
原文地址:https://www.cnblogs.com/buguge/p/12838166.html