Skip to content

Configuration Cheat Sheet

highsource edited this page Oct 21, 2014 · 13 revisions

Work in progress

<configuration>
	<!-- # Specifying what to compile # -->

	<!-- ## Specifying schemas ## -->

	<!-- ### Basic usage, from directory ## -->

	<!-- Specifies the schema directory, src/main/resources by default -->
	<schemaDirectory>src/main/resources</schemaDirectory>
	<!-- Specifies file patterns to include as schemas. By default all *.xsd files will be included. -->
	<schemaIncludes>
		<include>*.xsd</include>
	</schemaIncludes>
	<!-- Specifies file patterns of schemas to exclude. By default, nothing is excluded. -->
	<schemaExcludes>
		<include>*.xs</include>
	</schemaExcludes>

	<!-- ### Extended usage ### -->

	<!-- Specifies schemas as filesets, URLs or Maven artifact resources. -->
	<schemas>
		<schema>
			<!-- Specifies a schema from the Maven artifact. -->
			<dependencyResource>
				<!-- Group id of the artifact, required. -->
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<!-- Artifact id of the artifact, required. -->
				<artifactId>maven-jaxb2-plugin-tests-po</artifactId>
				<!--  Version of the artifact. May be omitted.
				The plugin will then try to find the version using
				the dependencyManagement and dependencies of the project. -->
				<version>${project.version}</version>
				<!-- Path of the resource within the artifact. -->
				<resource>purchaseorder.xsd</resource>
			</dependencyResource>
		</schema>
		<schema>
			<!-- Specifies a schema URL to compile. -->
			<url>http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd</url>
		</schema>
		<schema>
			<!-- Specifies a schema in the Maven artifact. -->
			<url>maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-po:${project.version}!/po.xsd</url>
		</schema>
		<schema>
			<!-- Specifies a fileset to compile. -->
			<fileset>
				<!-- Base directory of the fileset. Optional, defaults to schemaDirectory. -->
				<directory>${basedir}/src/main/schemas</directory>
                                <!-- File patterns to include. Optional, defaults to schemaIncludes. -->
				<includes>
					<include>*.*</include>
				</includes>
				<!-- File patterns to exclude. Optional, defaults to schemaIncludes -->
				<excludes>
					<exclude>*.xs</exclude>
				</excludes>
			</fileset>
		</schema>
	</schemas>

	<!-- Type of input schema language.
	DTD, XMLSCHEMA, RELAXNG, RELAXNG_COMPACT, WSDL, AUTODETECT (defult). -->
	<schemaLanguage>AUTODETECT</schemaLanguage>

	<!-- ## Specifying bindings ## -->

	<!-- ### Basic usage, from directory ## -->

	<!-- Specifies the binding directory, default to the schemaDirectory -->
	<bindingDirectory>src/main/resources</bindingDirectory>
	<!-- Specifies file patterns to include as bindings. By default all *.xjb files will be included. -->
	<bindingIncludes>
		<include>**/*.xjb</include>
	</bindingIncludes>
	<!-- Specifies file patterns of bindings to exclude. By default, nothing is excluded. -->
	<bindingExcludes>
		<include>**/*.xj</include>
	</bindingExcludes>

	<!-- ### Extended usage ### -->

	<!-- Specifies bindings as filesets, URLs or Maven artifact resources. -->
	<bindings>
		<binding>
			<!-- Specifies a binding from the Maven artifact. -->
			<dependencyResource>...</dependencyResource>
		</binding>
		<binding>
			<!-- Specifies an URL of the binding to use. -->
			<url>...</url>
		</binding>
		<binding>
			<!-- Specifies a fileset of bindings to use. -->
			<fileset>
				<!-- Base directory of the fileset. Optional, defaults to bindingDirectory. -->
				<directory>${basedir}/src/main/bindings</directory>
                                <!-- File patterns to include. Optional, defaults to bindingIncludes. -->
				<includes>
					<include>*.xjb</include>
				</includes>
				<!--  File patterns to exclude. Optional, defaults to bindingExcludes. -->
				<excludes>
					<exclude>*.xj</exclude>
				</excludes>
			</fileset>
		</binding>
	</bindings>

	<!-- # Using catalogs # -->

	<!-- Specify the catalog file to resolve external entity references. -->
	<catalog>src/main/resources/catalog.cat</catalog>

	<!-- Specifies catalogs as filesets, URLs or Maven artifact resources. -->
	<catalogs>
		<catalog>
			<!-- Specifies a catalog from the Maven artifact. -->
			<dependencyResource>...</dependencyResource>
		</catalog>
		<catalog>
			<!-- Specifies an URL of the catalog to use. -->
			<url>...</url>
		</catalog>
		<catalog>
			<!-- Specifies a fileset of the catalogs to use. -->
			<fileset>
				<!-- Base directory of the fileset. Optional, defaults to schemaDirectory. -->
				<directory>${basedir}/src/main/catalogs</directory>
                                <!-- File patterns to include. Optional, defaults to *.cat. -->
				<includes>
					<include>*.cat</include>
				</includes>
				<!--  File patterns to exclude. Optional, by default nothing is excluded. -->
				<excludes>
					<exclude>*.ct</exclude>
				</excludes>
			</fileset>
		</catalog>
	</catalogs>

	<!-- # Using episodes # -->

	<!-- If true (default), the episode file (describing mapping of elements and types
	to classes for the compiled schema) will be generated. -->
	<episode>true</episode>
	<!-- Target location of the episode file. By default it is ${generateDirectory}/META-INF/sun-jaxb.episode -->
	<episodeFile>target/generated-sources/xjc/META-INF/sun-jaxb.episode</episodeFile>
	<!-- Use all of the compile-scope project dependencies as episode artifacts. -->
	<useDependenciesAsEpisodes>true</useDependenciesAsEpisodes>
	<!-- Episodes -->
	<episodes>
		<!-- Specifies a Maven artifact to use as an episode -->
		<episode>
			<groupId>org.jvnet.jaxb2.maven2</groupId>
			<artifactId>maven-jaxb2-plugin-tests-po</artifactId>
			<!--  Version of the artifact. May be omitted.
			The plugin will then try to find the version using
			the dependencyManagement and dependencies of the project. -->
			<version>${project.version}</version>
                </episode>
	</episodes>
</configuration>
Clone this wiki locally