You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by thomas2004 <th...@yahoo.de> on 2008/11/01 21:53:13 UTC

Re: Does Java 1.4 support "maven-jaxb-plugin"?

Many thanks. I will try.



The plugin you use is for JAXB 2.x which requires you to use at least
java 1.5. For java 1.4 you need JAXB 1.x. You may want to use this JAXB
1.0 plugin.

      <plugin>
        <groupId>org.jvnet.jaxb1.maven2</groupId>
        <artifactId>maven-jaxb1-plugin</artifactId>
        <executions>
          <execution>
            <id>generate</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <extension>true</extension>
              <strict>true</strict>
              <bindingDirectory>src/main/jaxb</bindingDirectory>
              <schemaDirectory>src/main/jaxb</schemaDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

For this to work you need some additional repositories, since that
plugin is not available via the central repository.

  <repositories>
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <layout>legacy</layout>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>maven-repository.dev.java.net</id>
      <name>Java.net Maven 1 Repository (legacy)</name>
      <url>http://download.java.net/maven/1/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <layout>legacy</layout>
    </pluginRepository>
  </pluginRepositories>

And you will need the corresponding JAXB dependencies for java 1.4.

      <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
        <exclusions>
          <!--
          Excluded because of certificate problems.
          Classes must be provided by additional jaxp-api
          dependency when used.
          -->
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>namespace</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.xml</groupId>
            <artifactId>jax-qname</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>1.0.6</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <groupId>javax.xml.parsers</groupId>
        <artifactId>jaxp-api</artifactId>
        <version>1.4</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>com.sun.xml.parsers</groupId>
        <artifactId>jaxp-ri</artifactId>
        <version>1.4</version>
        <scope>runtime</scope>
      </dependency>

Give it a try.

-- 
Christian

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




-- 
View this message in context: http://www.nabble.com/Does-Java-1.4-support-%22maven-jaxb-plugin%22--tp20226200p20284336.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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