[ 
https://issues.apache.org/jira/browse/MSHADE-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15003898#comment-15003898
 ] 

Kristian Rosenvold commented on MSHADE-171:
-------------------------------------------

Additional resource leaks have just been fixed in jdependency, so we'd need to 
wait for a release of a version >1.0

> "Access Denied" on Windows because shade plugin seems to try to open a 
> directory as Zip-File
> --------------------------------------------------------------------------------------------
>
>                 Key: MSHADE-171
>                 URL: https://issues.apache.org/jira/browse/MSHADE-171
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Happens on both Windows and Linux
>            Reporter: Dominik Stadler
>             Fix For: backlog
>
>         Attachments: MSHADE-171.zip
>
>
> Config of plugin is fairly simple, but fails with the error below when I call 
> "mvn package test", it works when I call only "mvn package", it seems the 
> plugin tries to open a directory as zip-file.
> It happens in a multi-module setup when building from the parent-directory. 
> It seems the dependency between the module where the shade plugin runs onto 
> another module causes the target/classes of that module to be added as 
> artifact-file, which causes the shade plugin to fail.
> Let me know if you need a self-contained reproducer project, I can provide 
> one, but it will take some time to build it...
> FYI, there was a similar problem in the war plugin at MWAR-192.
> {code}
>               <plugin>
>                       <groupId>org.apache.maven.plugins</groupId>
>                       <artifactId>maven-shade-plugin</artifactId>
>                       <version>2.3</version>
>                       <executions>
>                               <execution>
>                                       <phase>package</phase>
>                                       <goals>
>                                               <goal>shade</goal>
>                                       </goals>
>                               </execution>
>                       </executions>
>               </plugin>
> {code}
> {noformat}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-shade-plugin:2.3:shade (default) on project 
> towerrunner-ui: Error creating shaded jar: 
> C:\workspaces\workspace.GWT.changeset\towerrunner\towerrunner-base\target\classes
>  (Access is denied) -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.maven.plugins:maven-shade-plugin:2.3:shade (default) on 
> project towerrunner-ui: Error creating shaded jar: 
> C:\workspaces\workspace.GWT.changeset\towerrunner\towerrunner-base\target\classes
>  (Access is denied)
>         at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
>         at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>         at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
>         at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
>         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
>         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating 
> shaded jar: 
> C:\workspaces\workspace.GWT.changeset\towerrunner\towerrunner-base\target\classes
>  (Access is denied)
>         at 
> org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:566)
>         at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
>         at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
>         ... 19 more
> Caused by: java.io.FileNotFoundException: 
> C:\workspaces\workspace.GWT.changeset\towerrunner\towerrunner-base\target\classes
>  (Access is denied)
>         at java.util.zip.ZipFile.open(Native Method)
>         at java.util.zip.ZipFile.<init>(ZipFile.java:215)
>         at java.util.zip.ZipFile.<init>(ZipFile.java:145)
>         at java.util.jar.JarFile.<init>(JarFile.java:153)
>         at java.util.jar.JarFile.<init>(JarFile.java:117)
>         at 
> org.apache.maven.plugins.shade.DefaultShader.newJarFile(DefaultShader.java:267)
>         at 
> org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:100)
>         at 
> org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:471)
>         ... 21 more
> [ERROR] 
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to