[ http://jira.codehaus.org/browse/MDEP-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_119974 ]
David Biesack commented on MDEP-119: ------------------------------------ I'm running Maven version: 2.0.7 on Windows and this problem still seems to appear. I added the following to my parent POM {{plugins>}} (this project does not have a target directory) and got this same error. {noformat} mvn install ... [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error while opening/closing classpath file 'c:\dev\acl.maven.defaults\target\classpath.txt': java.io.FileNotFoundException: C:\dev\acl.maven.defaults\target\classpath.txt (The system cannot find the path specified) {noformat} If I create the target directory first, it runs without error. {noformat} <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>build-classpath</id> <phase>generate-sources</phase> <goals> <goal>build-classpath</goal> </goals> <configuration> <!-- http://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html says cpFile is deprecated, but outputFile does not seem to work --> <cpFile>${project.build.directory}/classpath.txt</cpFile> <regenerateFile>true</regenerateFile> <includeTypes>jar</includeTypes> <excludeClassifers>sources</excludeClassifers> <prefix>$M2_REPO</prefix> <pathSeparator>:</pathSeparator> <fileSeparator>/</fileSeparator> </configuration> </execution> </executions> </plugin> {noformat} > build-classpath should create destination directory for the classpath file > -------------------------------------------------------------------------- > > Key: MDEP-119 > URL: http://jira.codehaus.org/browse/MDEP-119 > Project: Maven 2.x Dependency Plugin > Issue Type: Improvement > Components: build-classpath > Affects Versions: 2.0-alpha-4 > Reporter: Adrian Hempel, Atlassian > Assignee: Brian Fox > Priority: Minor > Fix For: 2.0-alpha-5 > > > I am binding the build-classpath goal to the generate-resources phase, as > follows: > {code:xml} > <plugin> > <artifactId>maven-dependency-plugin</artifactId> > <executions> > <execution> > <id>build-classpath</id> > <phase>generate-resources</phase> > <goals> > <goal>build-classpath</goal> > </goals> > <configuration> > > <cpFile>${project.build.outputDirectory}/com/atlassian/bamboo/agent/classserver/Agent.classpath</cpFile> > </configuration> > </execution> > </executions> > </plugin> > {code} > However, it fails, because the target directory doesn't exist: > bq. {{[INFO] Error while opening/closing classpath file > '/Users/ahempel/workarea/private/atlassian/bamboo/trunk/bamboo-agent-classserver/target/classes/com/atlassian/bamboo/agent/classserver/Agent.classpath': > java.io.FileNotFoundException: > /Users/ahempel/workarea/private/atlassian/bamboo/trunk/bamboo-agent-classserver/target/classes/com/atlassian/bamboo/agent/classserver/Agent.classpath > (No such file or directory)}} > The build-classpath goal can be improved by creating the missing directory, > rather than throwing a FileNotFoundException. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira