> -----Original Message-----
==////==
> 
> > -----Original Message-----
> > From: Pilgrim, Peter
> > Sent: 01 November 2006 17:46
> > To: 'Maven Users List'
> > Subject: [m2] XMLBeans Plugin
> > 
> > 
> > Maven 2 XMLBean Plugin
> > http://mojo.codehaus.org/xmlbeans-maven-plugin/index.html
> > 
> > I am trying to get the plugin to generate the java classes from XSD 
> > files in the same way as the `scomp' program.
> > 
> > I stored the schema in the `src/main/xsd' folder.
> > Is the command `mvn xmlbeans:xmlbeans' suppose to execute the scomp 
> > program?
> 
> I think the plugin is doing the functional equivalent of the 
> schema compile (scomp) when I grokked the verbose flag.
> 
> > 
> > I want to configure the plugin to use the same directory 
> for the xsd 
> > and xsdconfig.
> > 
> > For example
> > 
> > src/main/xsd/magic/numbers/ipod.xsd
> > src/main/xsd/magic/numbers/ipod.xsdconfig
> > 
> > We find it convenient to have the .xsd and .xsdconfig in the same 
> > folders.
> > How do you configure this?
> > 
> 
> Don't worry it is easier to run with the flow. So I moved a 
> few the xsdconfigs to the src/main/xsdconfig directory instead.
> 
> I am trying to understand the outputJar parameter. I want to 
> generate an XmlBean JAR that I can stuff into the M2 Repository.
> 
> 1) xmlbeans does not seem to generate the jar (e.b. mvn 
> xmlbeans:xmlbeans) How do I product it?
> 
> 2) If I can generate the XMLBean Jar, do I use the install 
> plugin to load into the repository or can the xmlbean-plugin 
> do it all for me?
> 
> 
>     <build>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>xmlbeans-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>xmlbeans</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <inherited>true</inherited>
>                 <configuration>
>                     <memoryInitialSize>32m</memoryInitialSize>
>                     <memoryMaximumSize>64m</memoryMaximumSize>
>                     <outputJar>valuationSchema-0.4.jar</outputJar>
>                     <schemaDirectory>src/main/xsd</schemaDirectory>
>                     <verbose>true</verbose>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
> 
> Getting there

Another day, another chance to progress. 

The plug-in did generate output jar, however in ${basedir}. 
Great! Now I can do it


 
<outputJar>${basedir}/target/valuationSchema-0.4.jar</outputJar>


But wait a minute here! This is not the Maven way to do things, is it?

One primary artifact per project was the general rule, I remember. 
I going at this really wrong.

What I really need is:

1) I want to generate the XML Beans classes.
2) Compile Java code against the generated classes in (1) 
3) Run unit test against (1) and (2)
4) Package the project excluding some classes e.g. unit test
5) Install the whole as project artifact
in the M2 repository 

This means I can chuck away the `valuationSchema-0.4.jar' thing and rely
on good old' maven project definitions instead i.e. 
set up group id / artifact id / version and off we go!

My question is therefore about step (4). Can I include and exclude 
classes during the packaging.

The `xmlbeans-maven-plugin' generates my schema classes under

`target/classes/com/ubs/firc/ptsp/**'
`target/schemaoorg_apache_xmlbeans/**'
`target/xmlbeans-source/com/ubs/firc/ptsp/**'

The first two of the above are very useful to me, but the last is not
useful for third party projects unless they want the XMLBeans Schema 
source code.

What is the best packager here `maven-assembly-plugin'
( http://maven.apache.org/plugins/maven-assembly-plugin/index.html )
or the `maven-jar-plugin' 
( http://maven.apache.org/plugins/maven-jar-plugin/ )?

TIA

--
Peter Pilgrim
UBS Investment Bank, 
PTS Portal / IT FIRC OPS LDN,
100 Liverpool Street, London EC2M 2RH, United Kingdom
+44 (0) 20 75 75692
:: Java EE / E-Commerce / Enterprise Integration / Development ::
  

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to