Hi all, SFTB, I'm facing an issue with Maven Dependency Plugin.
I have a project on which I have bound the copy-dependencies goal to generate-sources phase : <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/xsd/maven-4.0.0.xsd"> > > <modelVersion>4.0.0</modelVersion> > > <groupId>com.tibco.eclipse.plugins</groupId> > > <artifactId>eclipse-ext-archetype-plugin</artifactId> > > <version>1.3.0.qualifier-SNAPSHOT</version> > > <packaging>eclipse-plugin</packaging> > > >> <parent> > > <groupId>com.tibco.accelerators</groupId> > > <artifactId>parent</artifactId> > > <version>1.0.0-SNAPSHOT</version> > > <relativePath>../../../Parent/pom.xml</relativePath> > > </parent> > > >> <properties> > > <tycho.version>0.19.0</tycho.version> > > </properties> > > >> <repositories> > > <repository> > > <id>eclipse-indigo</id> > > <layout>p2</layout> > > <url>http://download.eclipse.org/releases/indigo/</url> > > </repository> > > </repositories> > > >> <!-- Given the size of the generated jar (> 60 Mo), it might be wise not > > to deploy this plugin in the Nexus. --> > > >> <dependencies> > > <dependency> > > <groupId>commons-io</groupId> > > <artifactId>commons-io</artifactId> > > <version>2.4</version> > > </dependency> > > <dependency> > > <groupId>com.tibco.conventions</groupId> > > <artifactId>naming-engine</artifactId> > > <version>1.0.2-SNAPSHOT</version> > > </dependency> > > <dependency> > > <groupId>com.tibco.maven.plugins</groupId> > > <artifactId>maven-ext-archetype-plugin</artifactId> > > <version>2.1.0-SNAPSHOT</version> > > [...] > </dependency> > > </dependencies> > > >> <build> > > <plugins> > > <plugin> > > <groupId>org.apache.maven.plugins</groupId> > > [...] > </plugin> <plugin> <!-- Copy non-Eclipse plugins to target/dependency so that may be > referenced for runtime use. --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <configuration> <transitive>false</transitive> <verbose>true</verbose> <excludeTransitive>true</excludeTransitive> <overWriteIfNewer>true</overWriteIfNewer> <stripVersion>true</stripVersion> </configuration> <executions> <execution> <id>import</id> <phase>generate-sources</phase> <goals> <goal>copy-dependencies</goal> </goals> </execution> </executions> </plugin> > <plugin> [...] > </plugin> </plugins> </pluginManagement> > </build> > </project> One time in two, the copy-dependencies works : [INFO] Scanning for projects... > > [INFO] Computing target platform for MavenProject: >> com.tibco.eclipse.plugins:eclipse-ext-archetype-plugin:1.3.0.qualifier-SNAPSHOT >> @ > > [...] > [INFO] >> > > [INFO] >> ------------------------------------------------------------------------ > > [INFO] Building eclipse-ext-archetype-plugin 1.3.0.qualifier-SNAPSHOT > > [INFO] >> ------------------------------------------------------------------------ > > [INFO] > > [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ >> eclipse-ext-archetype-plugin --- > > [INFO] Deleting >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target > > [...] > [INFO] > > [INFO] --- maven-dependency-plugin:2.9:copy-dependencies (import) @ >> eclipse-ext-archetype-plugin --- > > [INFO] Copying org.eclipse.core.filebuffers-3.5.200.v20110928-1504.jar to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\org.eclipse.core.filebuffers.jar > > [INFO] Copying maven-embedder-3.0.2.jar to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\org.eclipse.m2e.maven.runtime-jars\maven-embedder-3.0.2.jar.jar > > [INFO] Copying aether-connector-wagon-1.11.jar to >> C:\NWLS\workspaces\Accelerators > > [...] > [INFO] > ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] > ------------------------------------------------------------------------ [INFO] Total time: 42.189s [INFO] Finished at: Thu Jan 08 14:20:50 CET 2015 [INFO] Final Memory: 61M/370M [INFO] > ------------------------------------------------------------------------ And the other time, I get an error during the copy-dependencies goal execution : [INFO] --- maven-dependency-plugin:2.9:copy-dependencies (import) @ >> eclipse-ext-archetype-plugin --- > > [...] > [DEBUG] Excluded: classworlds:classworlds:jar:1.1 > > [DEBUG] Configuring mojo >> org.apache.maven.plugins:maven-dependency-plugin:2.9:copy-dependencies from >> plugin realm >> ClassRealm[plugin>org.apache.maven.plugins:maven-dependency-plugin:2.9, >> parent: sun.misc.Launcher$AppClassLoader@32f4a24a] > > [DEBUG] Configuring mojo >> 'org.apache.maven.plugins:maven-dependency-plugin:2.9:copy-dependencies' >> with basic configurator --> > > [DEBUG] (f) addParentPoms = false > > [DEBUG] (s) copyPom = false > > [DEBUG] (f) excludeTransitive = true > > [DEBUG] (s) failOnMissingClassifierArtifact = false > > [DEBUG] (s) local = id: local > > url: file:///C:/Users/SEGHAIE/.m2/repository/ > > layout: none > > >> [DEBUG] (s) markersDirectory = >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency-maven-plugin-markers > > [DEBUG] (f) outputAbsoluteArtifactFilename = false > > [DEBUG] (s) outputDirectory = >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency > > [DEBUG] (f) overWriteIfNewer = true > > [DEBUG] (f) overWriteReleases = false > > [DEBUG] (f) overWriteSnapshots = false > > [DEBUG] (s) prependGroupId = false > > [DEBUG] (f) project = MavenProject: >> com.tibco.eclipse.plugins:eclipse-ext-archetype-plugin:1.3.0.qualifier-SNAPSHOT >> @ >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\pom.xml > > [DEBUG] (f) reactorProjects = [MavenProject: >> com.tibco.eclipse.plugins:eclipse-ext-archetype-plugin:1.3.0.qualifier-SNAPSHOT >> @ >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\pom.xml] > > [DEBUG] (s) remoteRepos = [ id: nexus > > url: http://srvnexus/nexus/content/groups/public > > layout: default > > snapshots: [enabled => true, update => always] > > releases: [enabled => true, update => daily] > > , id: eclipse-indigo > > url: http://download.eclipse.org/releases/indigo/ > > layout: org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout@379f167a > > snapshots: [enabled => false, update => never] > > releases: [enabled => false, update => never] > > ] > > [DEBUG] (f) silent = false > > [DEBUG] (s) skip = false > > [DEBUG] (f) stripClassifier = false > > [DEBUG] (s) stripVersion = true > > [DEBUG] (f) useBaseVersion = true > > [DEBUG] (s) useRepositoryLayout = false > > [DEBUG] (s) useSubDirectoryPerArtifact = false > > [DEBUG] (s) useSubDirectoryPerScope = false > > [DEBUG] (s) useSubDirectoryPerType = false > > [DEBUG] -- end configuration -- > > [INFO] Copying commons-logging.jar to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\eclipse-ext-archetype-plugin-target\dependency\commons-logging.jar.jar > > [INFO] >> ------------------------------------------------------------------------ > > [INFO] BUILD FAILURE > > [INFO] >> ------------------------------------------------------------------------ > > [INFO] Total time: 30.263s > > [INFO] Finished at: Thu Jan 08 14:31:14 CET 2015 > > [INFO] Final Memory: 58M/371M > > [INFO] >> ------------------------------------------------------------------------ > > [ERROR] Failed to execute goal >> org.apache.maven.plugins:maven-dependency-plugin:2.9:copy-dependencies >> (import) on project eclipse-ext-archetype-plugin: Error copying artifact >> from >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\commons-logging.jar >> to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\eclipse-ext-archetype-plugin-target\dependency\commons-logging.jar.jar: >> File >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\commons-logging.jar >> does not exist -> [Help 1] > > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute >> goal org.apache.maven.plugins:maven-dependency-plugin:2.9:copy-dependencies >> (import) on project eclipse-ext-archetype-plugin: Error copying artifact >> from >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\commons-logging.jar >> to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\eclipse-ext-archetype-plugin-target\dependency\commons-logging.jar.jar > > 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:39) > > at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > 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: Error copying >> artifact from >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\commons-logging.jar >> to >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\eclipse-ext-archetype-plugin-target\dependency\commons-logging.jar.jar > > at >> org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:232) > > at >> org.apache.maven.plugin.dependency.fromDependencies.CopyDependenciesMojo.copyArtifact(CopyDependenciesMojo.java:266) > > at >> org.apache.maven.plugin.dependency.fromDependencies.CopyDependenciesMojo.doExecute(CopyDependenciesMojo.java:129) > > at >> org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167) > > 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.IOException: File >> C:\NWLS\workspaces\Accelerators\Generator\GUI\eclipse-ext-archetype-plugin\target\dependency\commons-logging.jar >> does not exist > > at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1039) > > at >> org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:228) > > ... 24 more > > [ERROR] > > [ERROR] > > [ERROR] For more information about the errors and possible solutions, >> please read the following articles: > > [ERROR] [Help 1] >> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > > Does someone have an idea of the root of this problem ? Thanks in advance for your help. Gilles Seghaier aa