You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Markus Jostock <ma...@softwareag.com> on 2009/02/09 15:48:12 UTC

Weired classpath pb: class not found in parent dir

Dear all

In a sub-module of a multi-module project I parse an XML file via Xalan 
(using antrun and a <java> task).

While it works fine when I run mvn in the sub-module, it fails when I 
run mvn in the superior parent module, although I put a dependency to 
Xalan in the antrun plugin definition.

Would anyone have an idea what could cause this classpath problem (if it 
is any)?

Many thanks!

Cheers
 Markus






[INFO] [antrun:run {execution: generate-sources}]
[INFO] Executing tasks
     [java] Could not find org.apache.xalan.xslt.Process. Make sure you 
have it in your classpath
     [java]     at 
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:138)
     [java]     ...


pom.xml:
...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <tasks>
                <!-- generate the SQL scripts and documentation -->

                <java classname="org.apache.xalan.xslt.Process" 
fork="false">
                  <arg value="-IN" /><arg value="db.xml" />
                  <arg value="-XSL" /><arg value="db2sql.xsl" />
                  <arg value="-OUT" /><arg value="db.sql" />
                </java>

              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <scope>compile</scope>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Weired classpath pb: class not found in parent dir

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Markus,

Markus Jostock wrote at Montag, 9. Februar 2009 15:48:

> Dear all
> 
> In a sub-module of a multi-module project I parse an XML file via Xalan
> (using antrun and a <java> task).
> 
> While it works fine when I run mvn in the sub-module, it fails when I
> run mvn in the superior parent module, although I put a dependency to
> Xalan in the antrun plugin definition.
> 
> Would anyone have an idea what could cause this classpath problem (if it
> is any)?

If you run a different instacne of the ant-run-plugin first that does not
declare this dep. Each plugin is loaded once and only. Use a common parent
with a pluginMgmt section that declares this plugin with all necessary deps
for the overall build.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org