Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.1
-
Fix Version/s: JiBX 1.2.3
-
Component/s: maven plugin
-
Labels:None
-
Environment:Windows 7, Maven 3.0.2
-
Number of attachments :
Description
I have a multi module project like this:
- A
- A.I
- A.I.OXM
- A.I.COMMON
- A.I
The A.I.OXM module contains the following:
<build> <plugins> <plugin> <groupId>org.jibx</groupId> <artifactId>maven-jibx-plugin</artifactId> <executions> <execution> <id>generate-java-code-from-schema</id> <goals> <goal>schema-codegen</goal> </goals> <configuration> <options> <directory>src/main/resources/jibx</directory> <package>foo.bar</package> </options> </configuration> </execution> <execution> <id>compile-binding</id> <goals> <goal>bind</goal> </goals> <configuration> <directory>target/generated-sources</directory> <load>true</load> <validate>true</validate> <verbose>true</verbose> <verify>true</verify> </configuration> </execution> </executions> </plugin> </plugins> </build>
If I build the A.I.OXM module by going into it and issuing "mvn clean install", the codes are generated correctly and the jar file installed to local maven repo contains the generated sources.
But if I go into module A and do a "mvn clean install --projects=A.I/A.I.COMMON --also-make" the A.I.OXM module is not built properly. The xsd schema file available in the specified directory is not picked up.
Also doing a "mvn clean install" in the A module has the same effect.
A solution to this problem seems to be to remove the <directory> option and use the default location.
When I did this, all three ways of building the module were successful.
The problem might be mostly with documentation that used <directory>src/something</directory> as an example. Should it have some maven property references too?
My environment is:
Apache Maven 3.0.2 (r1056850; 2011-01-09 02:58:10+0200)
Java version: 1.6.0_23, vendor: Sun Microsystems Inc.
Java home: C:\java\jdk6u23\jre
Default locale: fi_FI, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Antti,
Please try the following and tell me if problem is solved:
1) Maven now strongly recommends that you always include a version number in your pom. The current version is 1.2.2. We are very close to releasing 1.2.3. (so add:
<version>1.2.2</version>
right after this line: <artifactId>maven-jibx-plugin</artifactId>
2) I'm alway confused where maven is looking for files, so I try to include a full path name. Try to change your two paths to look like this:
{basedir}<directory>$
/src/main/resources/jibx</directory>
{project.build.directory}and
<directory>$
/target/generated-sources</directory>
If you are still having problems, this plugin has been completely redesigned for 1.2.3. You can try it now by doing this:
Download the new plugin from cvs. Just follow the instructions at:
The module you want is:
cvs -z3 -d:pserver:anonymous@jibx.cvs.sourceforge.net:/cvsroot/jibx co -P maven-jibx-plugin
Then type:
cd maven-jibx-plugin
mvn install
Tell me if any of these work
Don