[
https://jira.codehaus.org/browse/MAPPASM-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=292696#comment-292696
]
Lukasz Szelag commented on MAPPASM-82:
--------------------------------------
Attached is a sample project that can be used to reproduce this issue.
{code:title=mvn -e clean site}
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - test:appassembler-test:jar:1.0-SNAPSHOT
[INFO] task-segment: [clean, site]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\eclipse-workspaces\main\appassembler-test\target
[INFO] Preparing cobertura:cobertura
[INFO] [appassembler:generate-daemons {execution: create-test-daemon}]
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\eclipse-workspaces\main\appassembler-test\src\main\resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to
C:\eclipse-workspaces\main\appassembler-test\target\classes
[INFO] [cobertura:instrument {execution: default-instrument}]
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Instrumenting 1 file to
C:\eclipse-workspaces\main\appassembler-test\target\generated-classes\cobertura
Cobertura: Saved information on 1 classes.
Instrument time: 86ms
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - test:appassembler-test:jar:1.0-SNAPSHOT
[INFO] task-segment: [clean, site]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\eclipse-workspaces\main\appassembler-test\target
[INFO] Preparing cobertura:cobertura
[INFO] [appassembler:generate-daemons {execution: create-test-daemon}]
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\eclipse-workspaces\main\appassembler-test\src\main\resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to
C:\eclipse-workspaces\main\appassembler-test\target\classes
[INFO] [cobertura:instrument {execution: default-instrument}]
[INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Instrumenting 1 file to
C:\eclipse-workspaces\main\appassembler-test\target\generated-classes\cobertura
Cobertura: Saved information on 1 classes.
Instrument time: 88ms
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory
C:\eclipse-workspaces\main\appassembler-test\src\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] Preparing jdepend:generate
[INFO] Installing C:\eclipse-workspaces\main\appassembler-test\target\classes
to C:\eclipse-workspaces\main\appassembler-test\target\generated-r
esources\appassembler\jsw\test\lib\test\appassembler-test\1.0-SNAPSHOT\appassembler-test-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to copy artifact.
Embedded error: Error installing artifact:
C:\eclipse-workspaces\main\appassembler-test\target\classes (Access is denied)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to copy artifact.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:663)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to copy
artifact.
at
org.codehaus.mojo.appassembler.GenerateDaemonsMojo.installArtifact(GenerateDaemonsMojo.java:302)
at
org.codehaus.mojo.appassembler.GenerateDaemonsMojo.execute(GenerateDaemonsMojo.java:275)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 21 more
Caused by: org.apache.maven.artifact.installer.ArtifactInstallationException:
Error installing artifact: C:\eclipse-workspaces\main\appassembler
-test\target\classes (Access is denied)
at
org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(DefaultArtifactInstaller.java:119)
at
org.codehaus.mojo.appassembler.GenerateDaemonsMojo.installArtifact(GenerateDaemonsMojo.java:297)
... 24 more
Caused by: java.io.FileNotFoundException:
C:\eclipse-workspaces\main\appassembler-test\target\classes (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at
hidden.org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:39)
at
hidden.org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1106)
at
hidden.org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1013)
at
org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(DefaultArtifactInstaller.java:98)
... 25 more
{code}
Interestingly, after commenting out *both* {{cobertura-maven-plugin}} and
{{jdepend-maven-plugin}}, the build is successfull. Also, I tested this
scenario using other reporting plugins (see below) and didn't encounter this
problem.
{code:title=These plugins don't cause an error}
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>project-team</report>
<report>dependencies</report>
<report>issue-tracking</report>
<report>scm</report>
<report>distribution-management</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<linkXref>true</linkXref>
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<threshold>Default</threshold>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</reporting>
{code}
Further, if appassembler's execution is bound to the *{{package}}* phase -
instead of {{generate-resources}}, the original test case works. I hope the
above will help to track down the root cause.
> "Failed to Copy Aritfact" in Eclipse Ganymede with Workspace Resolution
> Enabled
> -------------------------------------------------------------------------------
>
> Key: MAPPASM-82
> URL: https://jira.codehaus.org/browse/MAPPASM-82
> Project: Mojo AppAssembler Plugin
> Issue Type: Bug
> Affects Versions: 1.0
> Environment: eclipse ganymede SR2, JDK 1.5
> Reporter: Joseph S. Butler
> Priority: Minor
> Attachments: appassembler_debug.txt, appassembler-test.zip,
> appassembler-without-workspace-resolution.txt,
> appassembler-with-workspace-resolution.txt
>
>
> With Workspace resolution enabled in Eclipse Ganymede RC2, and the
> appassembler mojo in a module of a multi-module project - the following error
> occured while installing jars into the appassembler target lib.
> The following mojo encountered an error while executing:
> Group-Id: org.codehaus.mojo
> Artifact-Id: appassembler-maven-plugin
> Version: 1.0
> Mojo: assemble
> brought in via: POM
> While building project:
> Group-Id: package.name.changed.rcu.fdmd
> Artifact-Id: package.name.changed.rcu.fdmd
> Version: 1.0-SNAPSHOT
> From file: C:\devel\workspaces\ganymede-sr2-workspace\fdio-rcu\fdmd\pom.xml
> Reason: Failed to copy artifact.
> org.apache.maven.artifact.installer.ArtifactInstallationException: Error
> installing artifact:
> C:\devel\workspaces\ganymede-sr2-workspace\fdio-rcu\common\target\classes
> (Access is denied)
> As a work around, I disabled workspace resolution and appassembler worked as
> expected, however I noticed that a difference on the Installing printout.
> With workspace resolution turned off, appassembler correctly attempts to copy
> the correct jar. With workspace resolution turned on, appassembler attempts
> to copy the classes associated to the module - which I believe to be
> incorrect, and the reason why the copy failed.
> I have included the full printout from the console.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email