maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dinesh Pandey <Dinesh.Pan...@india.techspan.com>
Subject RE: Using Maven's Castor Plugin
Date Tue, 26 Apr 2005 10:11:23 GMT
Hi Guillaume,

I tried the exact same thing but I get the following error:

________________________________________________________________________

__  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

Fatal Error [line 3, row 87]: The prefix "castor" for element
"castor:generate"
is not bound.
org.apache.maven.MavenException: Error parsing plugin script
        at
org.apache.maven.plugin.JellyScriptHousing.parse(JellyScriptHousing.j
ava:165)
        at
org.apache.maven.plugin.JellyScriptHousing.parse(JellyScriptHousing.j
ava:177)
        at
org.apache.maven.plugin.PluginManager.readMavenXml(PluginManager.java
:514)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:
580)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
        at org.apache.maven.cli.App.doMain(App.java:488)
        at org.apache.maven.cli.App.main(App.java:1239)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
--- Nested Exception ---
org.xml.sax.SAXParseException: The prefix "castor" for element
"castor:generate"
 is not bound.
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at
org.apache.maven.plugin.JellyScriptHousing.parse(JellyScriptHousing.j
ava:157)
        at
org.apache.maven.plugin.JellyScriptHousing.parse(JellyScriptHousing.j
ava:177)
        at
org.apache.maven.plugin.PluginManager.readMavenXml(PluginManager.java
:514)
        at
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:
580)
        at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
        at org.apache.maven.cli.App.doMain(App.java:488)
        at org.apache.maven.cli.App.main(App.java:1239)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)

You have encountered an unknown error running Maven. Please help us to
correct
this problem by following these simple steps:
- read the Maven FAQ at http://maven.apache.org/faq.html
- run the same command again with the '-e' parameter, eg maven -e jar
- search the maven-user archives for the error at
http://nagoya.apache.org/eyebrowse/SummarizeList?listName=users@maven.apache
.org

- post the output of maven -e to JIRA at
http://jira.codehaus.org/BrowseProject.jspa?id=10030 (you must sign up
first)
- run 'maven --info' and post the output as the environment to the bug above


Total time: 1 seconds
Finished at: Tue Apr 26 15:37:47 IST 2005

____________________________________________________________________________


Thanks and regards,
Dinesh


-----Original Message-----
From: Guillaume Laforge [mailto:glaforge@gmail.com] 
Sent: Tuesday, April 26, 2005 3:33 PM
To: Maven Users List
Subject: Re: Using Maven's Castor Plugin

Hello Dinesh,

You'll have to:

- create a maven.xml (if you don't have already one).

- define a new goal a bit like that:

  <goal name="my:castor">
    <attainGoal name="castor:prepare-filesystem"/>
    <castor:generate schema="${basedir}/xsd/some.xsd"
package="com.foo.bar" types="j2"/>
  </goal>

- call that goal before java:compile with:

  <preGoal name="java:compile">
    <attainGoal name="ae6-web:castor"/>
  </preGoal>

- you may have to use the castorbuilder.properties file to make some
namespace/package mappins if you don't use the package attribute
(especially if you have some more complex multi-file xsd system)

And you should be done!

Guillaume

On 26/04/05, Dinesh Pandey <Dinesh.Pandey@india.techspan.com> wrote:
> Hi,
> 
> I am trying to use the Maven's castor plugin for source code generation
> based on xsd file.
> 
> When I see the documentation it talks about only one goal
> castor:prepare-filesystem.
> 
> It also talks about a tag called castor:generate but its not clear how do
I
> use this tag into my project.
> 
> Could someone please help me with this?
> 
> Thanks in advance,
> 
> Dinesh
> 
> 


-- 
Guillaume Laforge
http://glaforge.free.fr/weblog/?catid=2

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message