http://jira.codehaus.org/browse/MAPPASM-82
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<!-- new gateway start script -->
<id>new-start-script</id>
<phase>prepare-package</phase>
<configuration>
<assembleDirectory>${project.build.directory}</assembleDirectory>
<extraJvmArguments>-Xms256m -Xmx512m -Dapp.name=${SERVER_NAME}_svr -Dlogfile=$LOGFILE
</extraJvmArguments>
<repositoryName>lib</repositoryName>
<repositoryLayout>flat</repositoryLayout>
<configurationDirectory>config</configurationDirectory>
<copyConfigurationDirectory>false</copyConfigurationDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<binFileExtensions>
<unix>.sh</unix>
</binFileExtensions>
<platforms>
<platform>unix</platform>
</platforms>
<programs>
<program>
<name>start0</name>
<mainClass>gravity.framework.core.ApplicationContextGateway</mainClass>
<platforms>
<platform>windows</platform>
<platform>unix</platform>
</platforms>
</program>
</programs>
</configuration>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
[ERROR] Failed to execute goal org.codehaus.mojo:appassembler-maven-plugin:1.1.1:assemble (new-start-script) on project child-ticketing: Failed to copy artifact. Failed to install artifact xxx: xxx\classes (Access is denied) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:appassembler-maven-plugin:1.1.1:assemble (new-start-script) on project xxx: Failed to copy artifact.
if appassembler's execution is bound to the package phase - instead of generate-resources, the original test case works
Description
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.
-
-
appassembler_debug.txt
- 02/Apr/09 6:26 PM
- 3 kB
- Joseph S. Butler
-
Hide
-
appassembler-test.zip
- 24/Feb/12 9:51 AM
- 2 kB
- Lukasz Szelag
- Download Zip
-
-
appassembler-without-workspace-resolution.txt
- 11/May/09 3:43 AM
- 25 kB
- Henrik Dohlmann
-
-
appassembler-with-workspace-resolution.txt
- 11/May/09 3:43 AM
- 21 kB
- Henrik Dohlmann
Activity
Console output of appassembler-maven-plugin:1.0:create-repository
Any updates on the root cause of this issue? I have encountered this in Galileo as well, but have seen co-workers with the same versions have no issues.
I found out that this issue is not necessarily specific to Eclipse, as I'm getting the same error from the command line.
Nevertheless, the above error occurs only when running the build on Linuxcorrected below and works on Windows. Eclipse is not even installed on the Linux server.
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.7.0_01
Java home: C:\programs\jse-1.7.0_01\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.7.0
Java home: /data/riskengine2/jse-1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.18-238.12.1.el5" arch: "amd64" Family: "unix"
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.7.0_01
Java home: C:\programs\jse-1.7.0_01\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.7.0
Java home: /data/riskengine2/jse-1.7.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.18-238.12.1.el5" arch: "amd64" Family: "unix"
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
Can you add an example project which reproduces this behavior..
I did some more testing and found out that the above error shows up when generating a site (mvn site). This is not isolated to Linux as I assumed before (we generate site only from the Linux build server, not from a Windows-based developer PC). Building and deploying the artifact works without an error (mvn clean deploy).
Name: Maven Site Plugin 3
Description: The Maven Site Plugin is a plugin that generates a site for the
current project.
Group Id: org.apache.maven.plugins
Artifact Id: maven-site-plugin
Version: 3.0
Also (I'm not sure if that matters), but the appassembler plugin goals are invoked from genenerate-resources phase.
When I have some more time I will try to recreate this issue and then will post an example project.
Name: Maven Site Plugin 3
Description: The Maven Site Plugin is a plugin that generates a site for the
current project.
Group Id: org.apache.maven.plugins
Artifact Id: maven-site-plugin
Version: 3.0
Attached is a sample project that can be used to reproduce this issue.
+ 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
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.
<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>
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.
+ 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
<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>
After diving a little bit into this issue i found the root cause (hope so ) here (last line in execute method of GenerateDaemonsMojo):
installArtifact ( artifactRepository, projectArtifact );
whereas the projectArtifact is defined like the following:
/**
* @readonly
* @parameter expression="${project.artifact}"
*/
private Artifact projectArtifact;
I'm not sure what can cause the problem in this case. I don't see a problem with this (Maven 2.2.1 vs. Maven 3.0.X) ?
![](http://jira.codehaus.org/images/icons/emoticons/wink.gif)
installArtifact ( artifactRepository, projectArtifact );
/**
* @readonly
* @parameter expression="${project.artifact}"
*/
private Artifact projectArtifact;
I have only tested this using Maven 2.2.1 and don't know if this behaves differently with a different version.
I think that this is caused by the fact that the main artifact or project classes are not available (compiled/packaged yet) in the generate-resources phase, so the above construct fails. This works fine if appassembler goal is bound to the package phase.
Do you have any objection to close the issue based on the differences in phase. I assume that the appassembler-plugin will be used in the package phase only or may be later but in my opinion it does not make sense to do it in earlier phases.
Same problem for me: Eclipse 3.4.2, m2eclipse 0.9.8, appassembler-maven-plugin 1.0.
Same workaround: Disable Workspace Resolution.
Attaching console output with and without Workspace Resolution enabled.
Snippet of log when Workspace resolution is enabled:
[INFO] [appassembler:create-repository]
[INFO] Installing artifact C:\Users\hdohlmann\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar to D:\3dwork\acadGenerator\acadGenerator-installer\target\staging\jsw\AcadGenerator\lib\log4j-1.2.14.jar
[INFO] Installing artifact D:\3dwork\jobAgent\jobAgent-main\target\classes to D:\3dwork\acadGenerator\acadGenerator-installer\target\staging\jsw\AcadGenerator\lib\jobAgent-main-1.0.0-SNAPSHOT.jar
[ERROR]
The following mojo encountered an error while executing:
Group-Id: org.codehaus.mojo
Artifact-Id: appassembler-maven-plugin
Version: 1.0
Mojo: create-repository
brought in via: POM
While building project:
Group-Id: com._3dfacto
Artifact-Id: acadGenerator-installer
Version: 1.0.0-SNAPSHOT
From file: D:\3dwork\acadGenerator\acadGenerator-installer\pom.xml
Reason: Failed to copy artifact