Embedded Error Target Classes Access Is Denied
Contents |
here for a quick overview of the site Help Center Detailed answers to any maven install access is denied questions you might have Meta Discuss the workings and policies maven access denied to repository of this site About Us Learn more about Stack Overflow the company Business Learn more about
Maven Target Folder Access Denied
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Error Creating Shaded Jar (is A Directory)
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up maven-dependency-plugin target/classes - Access is denied up vote 3 down vote favorite I have a multi module project with a parent project A, and two childs project B and maven shade plugin C. Project B has a dependency on project C. I use the maven-dependency-plugin to copy the dependencies of B to a lib/ directory in the target/ directory. So, I can use the maven-assembly-plugin to include this lib/ directory in the final zip. The problem is I get the following error when I run mvn clean package on project B: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more Caused by: java.io.FileNotFoundException: D:\path-to-projects-directory\C\target\classes (Access is denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:120) at org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:36) at org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1141) at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1048) at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:192) ... 23 more Someone has an idea? I've done some research on the web and I found that there is such an issue (see http://jira.codehaus.org/browse/MWAR-192 , that's for the wars but I have the similar problem with JAR). It seems that the target/classes directory of project C can't be accessed to create the C.jar (the C.jar must be included in the lib/ directory of project B). Thanks maven m2eclipse maven-depend
resoutlion in m2eclipseAgile Board ExportXMLWordPrintableJSON Details Type: Bug Status: Closed Priority: Major Resolution: Fixed Affects Version/s: 2.1-alpha-2 Fix Version/s: 2.4 http://stackoverflow.com/questions/8823342/maven-dependency-plugin-target-classes-access-is-denied Component/s: None Labels: None Environment: windows vista Description While building my webapp in eclipse using a launch configuration (goals clean install) and having 'Resolve https://issues.apache.org/jira/browse/MWAR-192 Workspace Artifacts' checked, the war plugin cant assemble the war file properly. Note that disabled 'Resolve Workspace Artifacts' and the war is assembled fine [DEBUG] Processing: nexus-lvo-plugin-1.3.3-SNAPSHOT.jar [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to copy file for artifact[org.sonatype.nexus.plugins:nexus-lvo-plugin:jar:1.3.3-SNAPSHOT:compile] Embedded error: C:\Development\Code\nexus-1.3.x\nexus-core-plugins\nexus-lvo-plugin\target\classes (Access is denied) [INFO] ------------------------------------------------------------------------ [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Failed to copy file for artifact[org.sonatype.nexus.plugins:nexus-lvo-plugin:jar:1.3.3-SNAPSHOT:compile] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute
with "Error copying artifact from .../target/classes to .../classes"Agile Board ExportXMLWordPrintableJSON Details Type: Bug Status: Closed Priority: Major Resolution: Duplicate Affects Version/s: 2.0, 2.1 Fix Version/s: None https://issues.apache.org/jira/browse/MDEP-259 Component/s: copy, copy-dependencies Labels: None Environment: Maven 2.0.9 maven-dependency-plugin 2.0, 2.1 or 2.2-SNAPSHOT (r922616) Flags: Patch Description Scenario: dependency:copy-dependencies is used to copy a dependency artifact that http://osdir.com/ml/issues.maven.apache.org/2010-04/msg00380.html is part of the same multi-module build. The compile phase is executed, but not the package phase. An example of this scenario is using maven-eclipse-plugin to access is import a Maven project with generated test (re)sources. In this case, one would execute "mvn generate-test-resources eclipse:eclipse" to make sure that the generated (re)sources are imported into the workspace (by default, maven-eclipse-plugin executes generate-sources and generate-resources, but not generate-test-sources and generate-test-resources). Result: The build fails with the following error: [INFO] [dependency:copy-dependencies {execution: default}] [INFO] access is denied Copying classes to /Users/veithen/dev/maven/axis/axis2/modules/fastinfoset/target/repo/modules/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error copying artifact from /Users/veithen/dev/maven/axis/axis2/modules/addressing/target/classes to /Users/veithen/dev/maven/axis/axis2/modules/fastinfoset/target/repo/modules/classes Embedded error: /Users/veithen/dev/maven/axis/axis2/modules/addressing/target/classes (No such file or directory) Steps to reproduce: Unpack the attached test project and build the entire project once with "mvn install". Execute "mvn generate-resources" from the root project -> success (because the compile phase is not executed) Execute "mvn package" from the root project -> success (because the package phase is executed) Execute "mvn generate-test-resources" from the root project -> fails (because the compile phase is executed, but not the package phase) Execute "mvn generate-test-resources" in project2 -> success (because the dependency is not part of the same build) Root cause analysis: In the scenario described above (compile phase executed, package phase not executed), Artifact#getFile() points to the target/classes directory instead of the output artifact. dependency:copy-dependencies doesn't detect this situation and blindly attempts to execute the copy operation. This fails with the error message shown above. Note
Andreas Veithen commented on MDEP-259: -------------------------------------- There is a similar issue in maven-war-plugin: MWAR-192. One of the proposed fixes for that issue is to build the artifact on-the-fly from the files in the target/classes folder of the dependency project (see the patch attached to MWAR-192). Something similar could also be implemented for the issue described here, but this would only work for JAR artifacts, not for other packagings (I originally encountered the issue in Axis2 with dependencies on MAR files and in another project with OSGi bundles produced by maven-bundle-plugin from Apache Felix). > copy-dependencies fails with "Error copying artifact from .../target/classes > to .../classes" > -------------------------------------------------------------------------------------------- > > Key: MDEP-259 > URL: http://jira.codehaus.org/browse/MDEP-259 > Project: Maven 2.x Dependency Plugin > Issue Type: Bug > Components: copy-dependencies > Affects Versions: 2.0, 2.1 > Environment: Maven 2.0.9 > maven-dependency-plugin 2.0, 2.1 or 2.2-SNAPSHOT (r922616) > Reporter: Andreas Veithen > Assignee: Brian Fox > Attachments: patch.txt, test-project.zip > > > Scenario: > * dependency:copy-dependencies is used to copy a dependency artifact that is > part of the same multi-module build. > * The compile phase is executed, but not the package phase. > An example of this scenario is using maven-eclipse-plugin to import a Maven > project with generated test (re)sources. In this case, one would execute "mvn > generate-test-resources eclipse:eclipse" to make sure that the generated > (re)sources are imported into the workspace (by default, maven-eclipse-plugin > executes generate-sources and generate-resources, but not > generate-test-sources and generate-test-resources). > Result: The build fails with the following error: > [INFO] [dependency:copy-dependencies {execution: default}] > [INFO] Copying classes to > /Users/veithen/dev/maven/axis/axis2/modules/fastinfoset/target/repo/modules/classes > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Error copying artifact from > /Users/veithen/dev/maven/axis/axis2/modules/addressing/target/classes to > /