[ 
https://jira.codehaus.org/browse/MCASTOR-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=274816#comment-274816
 ] 

Michiel Kalkman commented on MCASTOR-37:
----------------------------------------

You can ask, but my problem is with castor-maven-plugin. 

If I did what you asked, I would have to raise my issue at the CASTOR project 
(and then perhaps at subproject X, Y, Z, ...). Afterwards, I have to ask if 
this project is willing to use the most recent version of castor (although I 
can introduce it as a dependency to the plugin).

Is it not possible in jira to just pass my request to the castor project? I can 
imagine that this issue is then put ON HOLD until fixes are made in the castor 
project. And when that happens the status of this issue will turn into OPEN 
again.

I can imagine that my request at the castor project will be turned down, 
because I'm using version 1.3.1 of castor-codegen (through castor-maven-plugin).

BTW. castor-maven-plugin:2.1 does not use the most recent version of 
castor-codegen (i.e. 1.3.2). Indeed, they are incompatible as  

<plugin>
   ...
  <artifactId>castor-maven-plugin</artifactId>
  <version>2.1</version>
  ...
  <dependencies>
    <dependency>
      <groupId>org.codehaus.castor</groupId>
      <artifactId>castor-codegen</artifactId>
      <version>1.3.2</version>
    </dependency>
  </dependencies>
</plugin>

fails:

[ERROR] Failed to execute goal org.codehaus.mojo:castor-maven-plugin:2.1:generat
e (default) on project DocumentationSupport: Castor execution failed: org.exolab
.castor.xml.schema.Schema.getImportedSchema()Ljava/util/Collection; -> [Help 1]

Furthermore:

<plugin>
   ...
  <artifactId>castor-maven-plugin</artifactId>
  <version>2.0</version>
  ...
  <dependencies>
    <dependency>
      <groupId>org.codehaus.castor</groupId>
      <artifactId>castor-codegen</artifactId>
      <version>1.3.2</version>
    </dependency>
  </dependencies>

succeeds, so there seems some regression has occurred in 
castor-maven-plugin:2.1.

Can we first try to solve this problem by introducing castor-codegen:1.3.2 as a 
dependency of castor-maven-plugin?


> 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


Reply via email to