[
https://jira.codehaus.org/browse/MCASTOR-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=274822#comment-274822
]
Werner Guttmann edited comment on MCASTOR-37 at 8/2/11 10:10 AM:
-----------------------------------------------------------------
First finding: can you please change dependency override section of your
<plugin> definition as follows:
{code}
<dependencies>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-codegen</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-xml-schema</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
{code}
That should get you goinga against Castor 1.3.2, whilst I look into this
dependency resolution problem.
was (Author: wguttmn):
First finding: can you please change dependency override section of your
<plugin> definition as follows:
{code}
<dependencies>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-codegen</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-xml-schema</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
{code}
That should get you going, whilst I look into this dependency resolution
problem.
> Castor generates code which doesn't compile
> -------------------------------------------
>
> Key: MCASTOR-37
> URL: https://jira.codehaus.org/browse/MCASTOR-37
> Project: Maven 2.x Castor Plugin
> Issue Type: Bug
> Affects Versions: 2.1
> Reporter: Michiel Kalkman
>
> I am using the following xsd to generate java code:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://domain" xmlns:tns="http://domain"
> attributeFormDefault="unqualified" elementFormDefault="qualified">
> ...
> <xs:simpleType name="BFlowType">
> <xs:restriction base="xs:string">
> <xs:enumeration value="component2resource"/> <!--
> Component sends data -->
> <xs:enumeration value="resource2component"/> <!--
> Component receives data -->
> <xs:enumeration value="inout"/> <!-- Component
> receives and sends data -->
> </xs:restriction>
> </xs:simpleType>
> ...
> Using org.codehaus.mojo:castor-maven-plugin:2.0 I get compilable java code.
> With org.codehaus.mojo:castor-maven-plugin:2.1 I get code that does not
> compile:
> /*
> * This class was automatically generated with
> * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
> * Schema.
> * $Id$
> */
> ...
> /**
> * Field enumConstants.
> */
> private static final java.util.Map<java.lang.String, BFlowType>
> enumConstants = new java.util.HashMap<java.lang.String, BFlowType>();
> static {
> for (BFlowType c: BFlowType.values()) {
> BFlowType.enumConstants.put(c.value, c);
> }
> };
> The final semi-colon gives the compilation error.
> Perhaps the problem is already resolved in castor-codegen 1.3.2?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email