I'm currently trying to move away from a clunky ant-based database
creation system to a transitory hybrid system using Maven as I
refactor the database creation scripts. As one portion of the database
build process requires two java classes that have dependencies, I
thought I would use the antrun task to handle this piece.
Unfortunately, the maven.dependency.classpath is returning null!

Here is a standalone example:

<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/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>

  <groupId>test.group.id</groupId>
  <artifactId>testArtifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>Test Artifact</name>
  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.0.4</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>run-new-db</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
                <echo message="maven depend classpath:
${maven.dependency.classpath}"/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

gives the results:

mvn install
[INFO] Scanning for projects...
[INFO] -------------------------------------------------------------------------
[INFO] Building Test Artifact
[INFO]    task-segment: [install]
[INFO] -------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [antrun:run {execution: run-new-db}]
[INFO] Executing tasks
     [echo] maven depend classpath: null
[INFO] Executed tasks
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: c:\work\tmp\target\testArtifact-1.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing c:\work\tmp\target\testArtifact-1.0-SNAPSHOT.jar to
C:\Documents and
Settings\ebiester\.m2\repository\test\group\id\testArtifact\1.0-SNAPSHOT\testArtifact-1.0-SNAPSHOT.jar
[INFO] -------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] -------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon Dec 19 15:41:48 MST 2005
[INFO] Final Memory: 3M/7M
[INFO] -------------------------------------------------------------------------
___

   [echo] maven depend classpath: null

is the key here. How do I get the classpath?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to