Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-119

build-classpath should create destination directory for the classpath file

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0-alpha-4
    • 2.0
    • build-classpath
    • None

    Description

      I am binding the build-classpath goal to the generate-resources phase, as follows:

      <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>
      

      However, it fails, because the target directory doesn't exist:

      [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.

      Attachments

        Activity

          People

            brianf Brian E Fox
            ahempel@atlassian.com Adrian Hempel
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: