title: Maven permission denied
body: <p>I'm getting strange exception while trying to create exploded war directory with maven. And it's strange because I already changed all files permissions to 777 for everyone.
  What should I check? Ican't find any useful info in stacktrace :(</p>
  
  <p>Goals I execute:</p>
  
  <pre><code>install war:exploded tomcat:redeploy
  </code></pre>
  
  <p>Here's stacktrace:</p>
  
  <pre><code>
  Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:exploded (default-cli) on project app-web: Failed to copy file for artifact [com.kk:app-core2:jar:app-SNAPSHOT:compile]: D:\kk\app-2013\app-core2\target\classes (Odmowa dostępu) -> [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:exploded (default-cli) on project app-web: Failed to copy file for artifact [com.kk:app-core2:jar:app-SNAPSHOT:compile]
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      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:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      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:601)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to copy file for artifact [com.kk:app-core2:jar:app-SNAPSHOT:compile]
      at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:137)
      at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleArtifacts(WarProjectPackagingTask.java:195)
      at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:107)
      at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:479)
      at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:412)
      at org.apache.maven.plugin.war.WarExplodedMojo.execute(WarExplodedMojo.java:43)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: java.io.FileNotFoundException: D:\kk\app-2013\app-core2\target\classes (Odmowa dostępu)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.(FileInputStream.java:138)
      at org.codehaus.plexus.util.FileUtils.doCopyFile(FileUtils.java:1067)
      at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1049)
      at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:304)
      at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:152)
      at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:211)
      at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:147)
      at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:112)
      ... 26 more
  </code></pre>
  
  <p>EDIT POM.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
          &lt;parent&gt;
          &lt;artifactId&gt;app&lt;/artifactId&gt;
          &lt;groupId&gt;com.kk&lt;/groupId&gt;
          &lt;version&gt;2013-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;artifactId&gt;app-web&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;name&gt;Application&lt;/name&gt;
      &lt;dependencies&gt;
          &lt;!- whole lot of dependecies-&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes&gt;
                  &lt;/excludes&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/resource&gt;
              &lt;resource&gt;
                  &lt;filtering&gt;false&lt;/filtering&gt;
                  &lt;directory&gt;src/main/html&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;plugins&gt;
               &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;excludeResources&gt;true&lt;/excludeResources&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                      &lt;complianceLevel&gt;1.6&lt;/complianceLevel&gt;
                      &lt;includes&gt;
                          &lt;include&gt;**/IMediaManager.java&lt;/include&gt;
                          &lt;include&gt;**/CachableMediaManager.java&lt;/include&gt;
                          &lt;include&gt;**/BaseApplication.java&lt;/include&gt;
                      &lt;/includes&gt;
                      &lt;aspectLibraries&gt;
                          &lt;aspectLibrary&gt;
                              &lt;groupId&gt;com.kk&lt;/groupId&gt;
                              &lt;artifactId&gt;commons-cache&lt;/artifactId&gt;
                          &lt;/aspectLibrary&gt;
                      &lt;/aspectLibraries&gt;
                  &lt;/configuration&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                          &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt;
                          &lt;version&gt;${aspectj.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;finalName&gt;app-web&lt;/finalName&gt;
      &lt;/build&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;development&lt;/id&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;com.kk&lt;/groupId&gt;
                      &lt;artifactId&gt;app-web-config&lt;/artifactId&gt;
                      &lt;scope&gt;runtime&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
              &lt;properties&gt;
                  &lt;m2eclipse.wtp.contextRoot&gt;/&lt;/m2eclipse.wtp.contextRoot&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>