I'm having a problem with the maven-castor-plugin.  On the castor website (
http://www.castor.org/srcgen-maven-plugin.html) it states...

By default, the Maven Castor plugin has been built and tested against a
particular version of Castor. To switch to a newer version of Castor (not
the plugin itself), please use a <dependencies> section as shown below to
point the plugin to e.g. a newer version of Castor:

<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>castor-maven-plugin</artifactId>
   <version>1.0</version>
   <dependencies>




     <dependency>
       <groupId>org.codehaus.castor</groupId>
       <artifactId>castor</artifactId>
       <version>1.1-M3-SNAPSHOT</version>
     </dependency>




   </dependencies>
 </plugin>              

so I've changed my pom as described above...

<?xml version="1.0" encoding="UTF-8"?>
<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>hcp-has</groupId>
  <artifactId>castor1A</artifactId>
  <version>1.0-SNAPSHOT</version>
      <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>castor-maven-plugin</artifactId>
        <version>1.0</version>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.castor</groupId>
            <artifactId>castor</artifactId>
            <version>1.1.2.1</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>

        <configuration>
          <schemaDirectory>src/test/resources/1A</schemaDirectory>
          <packaging>com.example.binding</packaging>

<properties>src/test/resources/1A/castorbuilder.properties</properties>
        </configuration>
      </plugin>

    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.castor</groupId>
      <artifactId>castor</artifactId>
      <version> 1.1.2.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version> 3.8.1</version>
    </dependency>
  </dependencies>
</project>

 I've noticed that in the generated code I see the following in the comments
at the top.

/*
 * This class was automatically generated with
 * <a href="http://www.castor.org";>Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

so it appears to me if "overloading" the castor dependency in the plugin
configuration is not working.

Do you know how this problem can be fixed?

Thanks,

Bryan

Reply via email to