JiBX
  1. JiBX
  2. JIBX-384

maven-jibx-plugin requires listing the jibx runtime jar as a compile dependency

    Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.5, JiBX 1.2.2
    • Fix Version/s: JiBX 1.2.3
    • Component/s: maven plugin
    • Labels:
      None
    • Environment:
      windows xp, maven 2.2.1, maven-jibx-plugin 1.2.2
    • Number of attachments :
      1

      Description

      JIBX is nicely divided up into JARs, each of which serves a precise purpose and is required in different phases of the code life cycle.

      For example, the jibx-run.jar is the only one which is required at run-time, and you do not need to include it at compile-time (Maven terms).

      This is great stuff, which unfortunately is broken by maven-jibx-plugin, which requires (AFAIKT) the jibx-run JAR to be included as a compile-time dependency.

      I have tried:

      1) Only including jibx-run.jar as a run-time dependency (not listed in the attached file): I get an error when running "mvn jibx:bind" because classes from jibx-run.jar are not available.

      2) Including jibx-run.jar as a build extension (this is (A) in the attached file): Same error as 1.

      3) Including jibx-run.jar as a plugin dependency (this is (B) in the attached file): Same error as 1.

      There is of course the workaround of simply changing the scope of the dependency ("C" in the attached file) to "compile", but this would make jibx-run.jar classes available in my code, which is undesirable.

      Why isn't the jibx-run.jar included in maven-jibx-plugin - the other jibx JARs seem to be?

      1. jibx.xml
        1 kB
        Morten Lauritsen Khodabocus

        Activity

        Don Corley made changes -
        Field Original Value New Value
        Assignee Don Corley [ doncorley ]
        Hide
        Don Corley added a comment - - edited

        Morton,
        The maven-jibx-plugin has been re-written for version 1.2.3 (which should be out within the next few weeks).
        It now uses includes the jibx-run module.
        To use the new code, please check it out of the cvs dev repository and build it. ie., type:

        cvs -z3 -d:pserver:anonymous@jibx.cvs.sourceforge.net:/cvsroot/jibx co -P maven-jibx-plugin
        cd maven-jibx-plugin (or dir maven-jibx-plugin if you are using windows)
        mvn install
        mvn site (this will install the new documentation on your hard disk at target/site
        (ignore any warnings)

        This will overwrite your maven-jibx-plugin version 1.2.2 with the new code.
        Now try to build your maven project. I believe that you
        will still need to include the jibx-run (and possibly the jibx-extra and joda-time
        modules in your project dependencies). The plugin dependencies are
        only relevant while the plugin is running. This should not be a problem, just include
        the following dependencies in your project:

        <dependencies>
        <dependency>
        <groupId>org.jibx</groupId>
        <artifactId>jibx-run</artifactId>
        <version>$

        {jibx-version}</version>
        </dependency>
        <dependency> <!-- You may need this module depending on what you are doing -->
        <groupId>org.jibx</groupId>
        <artifactId>jibx-extras</artifactId>
        <version>${jibx-version}

        </version>
        </dependency>
        <dependency> <!-- If you are using joda-time you will need this -->
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>$

        {joda-time-version}

        </version>
        </dependency>
        </dependencies>

        For your program to work, you will need jibx-run.jar in the classpath. This dependency declaration will insure that the jibx-run.jar (and others) are included in your runtime distribution.

        I am marking this bug as fixed, but I'll wait for the 1.2.3 release to close it.
        Thanks,
        Don

        Show
        Don Corley added a comment - - edited Morton, The maven-jibx-plugin has been re-written for version 1.2.3 (which should be out within the next few weeks). It now uses includes the jibx-run module. To use the new code, please check it out of the cvs dev repository and build it. ie., type: cvs -z3 -d:pserver:anonymous@jibx.cvs.sourceforge.net:/cvsroot/jibx co -P maven-jibx-plugin cd maven-jibx-plugin (or dir maven-jibx-plugin if you are using windows) mvn install mvn site (this will install the new documentation on your hard disk at target/site (ignore any warnings) This will overwrite your maven-jibx-plugin version 1.2.2 with the new code. Now try to build your maven project. I believe that you will still need to include the jibx-run (and possibly the jibx-extra and joda-time modules in your project dependencies). The plugin dependencies are only relevant while the plugin is running. This should not be a problem, just include the following dependencies in your project: <dependencies> <dependency> <groupId>org.jibx</groupId> <artifactId>jibx-run</artifactId> <version>$ {jibx-version}</version> </dependency> <dependency> <!-- You may need this module depending on what you are doing --> <groupId>org.jibx</groupId> <artifactId>jibx-extras</artifactId> <version>${jibx-version} </version> </dependency> <dependency> <!-- If you are using joda-time you will need this --> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>$ {joda-time-version} </version> </dependency> </dependencies> For your program to work, you will need jibx-run.jar in the classpath. This dependency declaration will insure that the jibx-run.jar (and others) are included in your runtime distribution. I am marking this bug as fixed, but I'll wait for the 1.2.3 release to close it. Thanks, Don
        Don Corley made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s JiBX 1.2.3 [ 16349 ]
        Resolution Fixed [ 1 ]
        Hide
        Morten Lauritsen Khodabocus added a comment -

        Thanks for the quick fix! Excellent response time.

        When you say that I still need jibx-run.jar in my project dependencies, you mean because I need it in my classpath at runtime right?

        The scope of this dependency really should be runtime, since there is no good reason for me to reference it at compiletime?

        Thanks again for the fix!

        Show
        Morten Lauritsen Khodabocus added a comment - Thanks for the quick fix! Excellent response time. When you say that I still need jibx-run.jar in my project dependencies, you mean because I need it in my classpath at runtime right? The scope of this dependency really should be runtime, since there is no good reason for me to reference it at compiletime? Thanks again for the fix!
        Hide
        Don Corley added a comment -

        Morton,
        Yes, you are correct. You will need jibx-run available at runtime.
        Compile-time dependencies set up automatically by this maven plug-in.
        Don

        Show
        Don Corley added a comment - Morton, Yes, you are correct. You will need jibx-run available at runtime. Compile-time dependencies set up automatically by this maven plug-in. Don

          People

          • Assignee:
            Don Corley
            Reporter:
            Morten Lauritsen Khodabocus
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: