1. Introduction

Introduction

CC-XJC is a JAXB 2.0 XJC plugin for adding a copy constructor to schema derived classes. The plugin provides a -copy-constructor option which is enabled by adding its jar file to the XJC classpath. That option takes no parameters.

Support

Development of CC-XJC is driven by the community. Please file any issues with the MantisBT bugracker or subscribe to the ccxjc-users mailing list for discussing issues or asking questions.

2. Maven

Maven Information

Maven users simply add the CC-XJC plugin as a dependency to a JAXB plugin of choice. For this to work, the CC-XJC repository needs to be put in a POM or the Maven settings.xml.

  <repository>
    <id>ccxjc.sourceforge.net</id>
    <url>http://ccxjc.sourceforge.net/maven2/releases</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>

Example

The following example demonstrates the use of the CC-XJC plugin with the Java.net maven-jaxb-plugin.

<plugin>
  <groupId>com.sun.tools.xjc.maven2</groupId>
  <artifactId>maven-jaxb-plugin</artifactId>
  <version>1.1</version>
  <dependencies>
    <dependency>
      <groupId>net.sourceforge.ccxjc</groupId>
      <artifactId>cc-xjc-plugin</artifactId>
      <version>1.0-beta-2</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <id>generate</id>
      <phase>generate-sources</phase>
      <goals>
        <goal>generate</goal>
      </goals>
      <configuration>
        <schemaDirectory>src/main/schemas</schemaDirectory>
        <args>-copy-constructor</args>
        <extension>true</extension>
      </configuration>
    </execution>
  </executions>
</plugin>

Note: To use the Java.net maven-jaxb-plugin, the Java.net repositories need to be used in addition to the CC-XJC repository.

<repositories>
  <repository>
    <id>maven1-repository.dev.java.net</id>
    <url>http://download.java.net/maven/1</url>
    <layout>legacy</layout>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
  <repository>
    <id>maven2-repository.dev.java.net</id>
    <url>http://download.java.net/maven/2</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

<pluginRepositories>
  <pluginRepository>
    <id>maven1-repository.dev.java.net</id>
    <url>http://download.java.net/maven/1</url>
    <layout>legacy</layout>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </pluginRepository>
  <pluginRepository>
    <id>maven2-repository.dev.java.net</id>
    <url>http://download.java.net/maven/2</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

3. License

The CC-XJC Project Copyright

Copyright (c) 2009 The CC-XJC Project. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE CC-XJC PROJECT AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CC-XJC PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.