Maven Shading Error: Access is Denied

匆匆过客 提交于 2019-12-01 06:04:55

You can face this error, if you're compiling from Eclipse with m2e plugin.

The workaround is to uncheck Resolve Workspace artifacts in the Maven Run Configuration.

I am using Eclipse Spring with the maven plugin. I was seeing a similar error in the logs:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.3:shade (default) on project lds_ws_framework: Error creating shaded jar: C:\Users\fritchd\Documents\autoaction_archivetkitproject\target\classes (Access is denied) -> [Help 1]

I had recently updated my projects to use the maven-shade-plugin 2.3 from a different maven build process. I noticed I had a lot of artifacts from the previous process in the \target folder. So I tried just deleting all files under the \target directory for that project. When I reran the build, I didn't see the error.

Use the artifactSet option of maven-shade-plugin

For whatever reason this way Eclipse does not produce the "Access Denied" error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!