Maven着色错误:访问被拒绝 [英] Maven Shading Error: Access is Denied
问题描述
现在,我已经看过这个问题,但它似乎没有任何使用我的目标文件夹。
Now, I have already seen this question, however it doesn't appear anything is using my target folder.
发生了什么事,就是当我编译它失败并向我显示这个错误时:
What's going on, is when I compile it fails and shows me this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.3:shade (default) on project FooProject: Error creating shaded jar: Failed to analyze class dependencies: C:\Users\paul_000\Documents\FooCore\target\classes (Access is denied) -> [Help 1]
我不太清楚为什么会发生这种情况,因为它不会发生在我的普通计算机上。
I'm not quite sure exactly why this happens, as it doesn't happen on my normal computer.
编辑:我忘了提及,我正在着色的jar在存储库中不存在。我只是在本地编译它(干净安装)。
同样,这是我用来遮蔽的内容:
I forgot to mention, the jar I am shading does not exist on a repository. I just compile it locally (clean install). As well, here's what I use to shade:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
推荐答案
如果您正在编译,可能会遇到此错误来自Eclipse的m2e插件。
You can face this error, if you're compiling from Eclipse with m2e plugin.
解决方法是在Maven运行配置中取消选中 Resolve Workspace artifacts
。
The workaround is to uncheck Resolve Workspace artifacts
in the Maven Run Configuration.
这篇关于Maven着色错误:访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!