You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2009/06/18 16:22:35 UTC
svn commit: r786076 - in /activemq/sandbox/activemq-flow: ./ activemq-broker/
activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/
Author: dejanb
Date: Thu Jun 18 14:22:35 2009
New Revision: 786076
URL: http://svn.apache.org/viewvc?rev=786076&view=rev
Log:
jaxb - fixing schema generation - moved from maven plugin to ant task due to classpath issues
Added:
activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/AsciiBufferAdapter.java
Modified:
activemq/sandbox/activemq-flow/activemq-broker/pom.xml
activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
activemq/sandbox/activemq-flow/pom.xml
Modified: activemq/sandbox/activemq-flow/activemq-broker/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/pom.xml?rev=786076&r1=786075&r2=786076&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/pom.xml (original)
+++ activemq/sandbox/activemq-flow/activemq-broker/pom.xml Thu Jun 18 14:22:35 2009
@@ -102,6 +102,11 @@
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ </dependency>
</dependencies>
@@ -137,7 +142,15 @@
</executions>
</plugin>
- <plugin>
+<!--
+
+ jaxb schemagen plugin does not work quite well for our use case (classpath problems),
+ so we're using it as an ant task (see below)
+ try to switch back to this in some future version
+
+-->
+<!--
+ <plugin>
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<executions>
@@ -155,7 +168,6 @@
<file>activemq-apollo.xsd</file>
</schema>
</schemas>
- <!--<verbose>false</verbose>-->
</configuration>
<goals>
<goal>generate</goal>
@@ -163,6 +175,36 @@
</execution>
</executions>
</plugin>
+-->
+
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <tasks>
+ <taskdef name="schemagen" classname="com.sun.tools.jxc.SchemaGenTask">
+ <classpath refid="maven.compile.classpath"/>
+ </taskdef>
+ <mkdir dir="${project.build.directory}/schema"/>
+ <schemagen srcdir="${project.build.sourceDirectory}" destdir="${project.build.directory}/schema">
+ <schema namespace="http://activemq.apache.org/schema/activemq/apollo" file="activemq-apollo.xsd" />
+ <classpath refid="maven.compile.classpath"/>
+ <include name="**/jaxb/package-info.java"/>
+ <include name="**/jaxb/*Xml.java"/>
+ </schemagen>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Added: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/AsciiBufferAdapter.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/AsciiBufferAdapter.java?rev=786076&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/AsciiBufferAdapter.java (added)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/AsciiBufferAdapter.java Thu Jun 18 14:22:35 2009
@@ -0,0 +1,16 @@
+package org.apache.activemq.apollo.jaxb;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.apache.activemq.protobuf.AsciiBuffer;
+
+class AsciiBufferAdapter extends XmlAdapter<String, AsciiBuffer> {
+ @Override
+ public String marshal(AsciiBuffer v) throws Exception {
+ return v.toString();
+ }
+ @Override
+ public AsciiBuffer unmarshal(String v) throws Exception {
+ return new AsciiBuffer(v);
+ }
+}
Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java?rev=786076&r1=786075&r2=786076&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java (original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/jaxb/VirtualHostXml.java Thu Jun 18 14:22:35 2009
@@ -33,17 +33,6 @@
@XmlRootElement(name = "virtual-host")
@XmlAccessorType(XmlAccessType.FIELD)
public class VirtualHostXml {
-
- public static class AsciiBufferAdapter extends XmlAdapter<String, AsciiBuffer> {
- @Override
- public String marshal(AsciiBuffer v) throws Exception {
- return v.toString();
- }
- @Override
- public AsciiBuffer unmarshal(String v) throws Exception {
- return new AsciiBuffer(v);
- }
- }
@XmlJavaTypeAdapter(AsciiBufferAdapter.class)
@XmlElement(name="host-name", required=true)
Modified: activemq/sandbox/activemq-flow/pom.xml
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/pom.xml?rev=786076&r1=786075&r2=786076&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/pom.xml (original)
+++ activemq/sandbox/activemq-flow/pom.xml Thu Jun 18 14:22:35 2009
@@ -75,6 +75,7 @@
<jaxb-api-version>2.1</jaxb-api-version>
<jaxb-version>2.1.6</jaxb-version>
+ <xjc-version>2.1.10.1</xjc-version>
<stax-api-version>1.0.1</stax-api-version>
<stax-version>1.2.0</stax-version>
@@ -409,6 +410,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>${xjc-version}</version>
+ </dependency>
<!-- camel testing -->
<dependency>