mvn clean install没有sudo就行不通

时间:2018-04-20 01:45:38

标签: maven ubuntu permissions install sudo

我有一个奇怪的问题,我有一个配置了maven的项目,当我执行时: mvn clean install 我收到此错误:

[INFO] --------------------------------------------------------------- 
---------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------- 
---------
[INFO] Total time: 4.637 s
[INFO] Finished at: 2018-04-19T22:21:24-03:00
[INFO] --------------------------------------------------------------- 
---------
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven- 
plugin:2.3:wsimport (wsimport-XXXXXXXXX-generate) on project 
XXXXXXXXXX: 
Mojo failed - check output -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with 
the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please read the following articles:
[ERROR] [Help 1]    
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptio
n
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with 
the command
  • 但是当我执行 sudo mvn clean install 时,它可以正常工作。为什么我需要使用 sudo
  • 执行
  • 我在Ubuntu 16.04,maven 3.5.3和java 1.7.0_95
  • 上运行

提前感谢您的时间。

1 个答案:

答案 0 :(得分:1)

对于Linux用户

导致问题的原因:

  • float calculateY(float x, float y) { return y + sin(x); } void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec3 bgColor = vec3(0.0); vec3 lineColor = vec3(0.0); float lineWidth = 0.001; vec2 uv = fragCoord/iResolution.xy; uv = -1.0 + 2.0 * uv; uv.y += 0.1; float largeTimeOffset = 1000000.0; float x = (uv.x + (iTime + largeTimeOffset)); float y = calculateY(x, uv.y); lineWidth = abs(1.0 / (300.0 * y)); lineColor += vec3(lineWidth, lineWidth, lineWidth); fragColor = vec4(bgColor+lineColor,1.0); } (基于pom.xml)-将所有子项目链接到 root 用户

我如何解决此问题:

  • 通过sudo mvn clean install检查所有目标文件夹都属于根用户
  • 在主项目文件夹中,运行基本pom.xml的位置:
    • ls -al * | grep target
    • 或者:sudo chown -R username:username .