Thanks for your contribution Andreas! I was about to write a jibx plugin for maven but you've saved me the effort.

After looking at your plugin it looks like you're missing support for multiple binding definition files. I've modified your plugin.jelly and plugin.properties (see attached) to add this support. Can you add this to your next release?

One other thing you might consider is using the project's classpath (maven.dependency.classpath) as the classpath for the taskdef and jibx task. That way the project is able to use whatever version of JiBX is appropriate for their project.

Thanks,

Norm


Andreas Brenk wrote:
Hi,

browsing through the sf.net mailinglist archive I saw demand for a maven plugin which I already had lying around.

So I just used maven to generate a project site which you can find here:

    http://andreasbrenk.com/opensource/maven-jibx-plugin/

Regards,
Andreas


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users
<?xml version="1.0"?>
<project xmlns:ant="jelly:ant" xmlns:j="jelly:core">
  <goal name="jibx" description="Run the Jibx binding compiler" prereqs="jibx:bind"/>
  
  <goal name="jibx:taskdef" description="Define the Jibx task">
    <ant:taskdef name="jibx" classname="org.jibx.binding.ant.CompileTask">
      <ant:classpath>
        <ant:pathelement path="${plugin.getDependencyPath('jibx:jibx-bind')}"/>
        <ant:pathelement path="${plugin.getDependencyPath('jibx:jibx-run')}"/>
        <ant:pathelement path="${plugin.getDependencyPath('jibx:jibx-extras')}"/>
        <ant:pathelement path="${plugin.getDependencyPath('bcel')}"/>
        <ant:pathelement path="${plugin.getDependencyPath('xpp3')}"/>
      </ant:classpath>
    </ant:taskdef>
  </goal>
  
  <goal name="jibx:bind" description="Run the Jibx binding compiler" prereqs="jibx:taskdef">
    <ant:echo message="Running Jibx binding compiler..."/>
    
    <j:choose>
    
      <!-- Single binding file configured -->
      <j:when test="${context.getVariable('maven.jibx.binding') != null}">
         <ant:jibx verbose="${maven.jibx.verbose}" load="${maven.jibx.load}" binding="${maven.jibx.binding}">
            <ant:classpathset dir="${maven.build.dest}"/>
            <ant:classpathset dir="${plugin.getDependencyPath('jibx:jibx-run')}"/>
         </ant:jibx>
      </j:when>
      
      <!-- Binding fileset specified -->
      <j:otherwise>
         <ant:jibx verbose="${maven.jibx.verbose}" load="${maven.jibx.load}">
            <ant:bindingfileset 
                  dir="${maven.jibx.dir}" 
                  includes="${maven.jibx.includes}"
                  excludes="${maven.jibx.excludes}"/>
            <ant:classpathset dir="${maven.build.dest}"/>
            <ant:classpathset dir="${plugin.getDependencyPath('jibx:jibx-run')}"/>
         </ant:jibx>      
      </j:otherwise>
      
    </j:choose>
  </goal>
</project>
maven.jibx.verbose=false
maven.jibx.load=true

# For a single binding file
#maven.jibx.binding=${maven.conf.dir}/binding.xml

# For multiple binding files
maven.jibx.dir=${maven.conf.dir}
maven.jibx.includes=**/*Binding.xml
maven.jibx.excludes=

Reply via email to