[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    Re: [jibx-users] compile binding in maven with multiple projects
From:       "Caristi, Joe" <jcaristi () whisolutions ! com>
Date:       2010-04-16 13:45:50
Message-ID: 6BB0744217924741BF7EECBFE583D7DE160E783512 () whryemsx01 ! whisolutions ! com
[Download RAW message or body]

We have a similar setup, except that we run "mvn install" on the parent pro=
ject.  It works.

This seems like the right thing to do, since the Maven documentation descri=
bes the install phase as follows:

install - install the package into the local repository, for use as a depen=
dency in other projects locally

________________________________
From: Scott Dickerson [mailto:scott073078@gmail.com]
Sent: Thursday, April 15, 2010 2:54 PM
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] compile binding in maven with multiple projects

Hi,

I have a setup where my JiBX schema and binding files are in one maven proj=
ect and some classes referenced by the bindings are in other peer-level pro=
jects.  This works great at dev time but at test, run and package time I ha=
ve some problems.  Specifically, when the compile binding is executed with =
the process-classes phase, the updates are not included in the jar files ge=
nerated for the other projects.

A simplified setup...

Parent
   - SubJiBX (holds schema, binding files and other stuff)
   - SubOther (holds data objects reference by the binding files)

Parent POM has SubJiBX and SubOther as modules.  SubJiBX lists SubOther as =
both a standard dependency and a module in the configuration of the plugin'=
s execution compile-binding definition.  SubOther does not depend on SubJiB=
X (and can't since that would be a circular dependency which is not allowed=
).

In the Parent directory run "mvn package".  We need to do it here since Sub=
JiBX depends on SubOther and needs to be able to see a reference to it.

The generate-sources phase runs just fine (as long as the schema-codegen sc=
hema directory configuration is prepended with ${basedir}) on all projects.=
  The compile phase runs just fine on all projects.  The process-classes ph=
ase runs just fine on all projects, and the classes referenced in SubOther =
do get updated.

My problem is with the package phase.  What is happening is that SubOther i=
s being packaged BEFORE the JiBX bind goal is run in SubJiBX.  I have to re=
-run "mvn package" for the first set of JiBX generated changes to be includ=
ed.  The resulting JARs from the second mvn package seem to work ok, but I =
don't get the warm and fuzzies.

Does anyone know how I can get the bind goal in SubJiBX to run before SubOt=
her is packaged so I only need to run the mvn command once?  Moving classes=
 between the two modules is not an option.

Thanks for any insight!
Scott Dickerson

________________________________
STATEMENT OF CONFIDENTIALITY:



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,
and destroy all copies of this message and any attachments.

[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
tt
	{font-family:"Courier New";}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">We have a similar setup, except that we run \
&#8220;mvn install&#8221; on the parent project.&nbsp; It works. \
&nbsp;<o:p></o:p></span></font></p> <p class="MsoNormal"><font size="2" color="navy" \
face="Arial"><span style="font-size: \
10.0pt;font-family:Arial;color:navy"><o:p>&nbsp;</o:p></span></font></p> <p \
class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: \
10.0pt;font-family:Arial;color:navy">This seems like the right thing to do, since the \
Maven documentation describes the install phase as \
follows:<o:p></o:p></span></font></p> <p class="MsoNormal"><font size="2" \
color="navy" face="Arial"><span style="font-size: \
10.0pt;font-family:Arial;color:navy"><o:p>&nbsp;</o:p></span></font></p> <p \
class="MsoNormal"><tt><font size="2" color="navy" face="Arial"><span \
style="font-size:10.0pt;font-family:Arial;color:navy">install</span></font></tt><font \
size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial; \
color:navy"> -  install the package into the local repository, for use as a \
dependency in other projects locally<o:p></o:p></span></font></p> <p \
class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: \
10.0pt;font-family:Arial;color:navy"><o:p>&nbsp;</o:p></span></font></p> <div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" \
face="Times New Roman"><span style="font-size:12.0pt"> <hr size="2" width="100%" \
align="center" tabindex="-1"> </span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;
font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" \
face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> Scott Dickerson \
[mailto:scott073078@gmail.com] <br>
<b><span style="font-weight:bold">Sent:</span></b> Thursday, April 15, 2010 2:54 \
PM<br> <b><span style="font-weight:bold">To:</span></b> \
jibx-users@lists.sourceforge.net<br> <b><span \
style="font-weight:bold">Subject:</span></b> [jibx-users] compile binding in maven \
with multiple projects</span></font><o:p></o:p></p> </div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Hi,<br>
<br>
I have a setup where my JiBX schema and binding files are in one maven project and \
some classes referenced by the bindings are in other peer-level projects.&nbsp; This \
works great at dev time but at test, run and package time I have some problems.&nbsp; \
Specifically,  when the compile binding is executed with the process-classes phase, \
the updates are not included in the jar files generated for the other projects.<br> \
<br> A simplified setup...<br>
<br>
Parent<br>
&nbsp;&nbsp; - SubJiBX (holds schema, binding files and other stuff)<br>
&nbsp;&nbsp; - SubOther (holds data objects reference by the binding files)<br>
<br>
Parent POM has SubJiBX and SubOther as modules.&nbsp; SubJiBX lists SubOther as both \
a standard dependency and a module in the configuration of the plugin's execution \
compile-binding definition.&nbsp; SubOther does not depend on SubJiBX (and can't \
since that would be  a circular dependency which is not allowed).<br>
<br>
In the Parent directory run &quot;mvn package&quot;.&nbsp; We need to do it here \
since SubJiBX depends on SubOther and needs to be able to see a reference to it.<br> \
<br> The generate-sources phase runs just fine (as long as the schema-codegen schema \
directory configuration is prepended with ${basedir}) on all projects.&nbsp; The \
compile phase runs just fine on all projects.&nbsp; The process-classes phase runs \
just fine on all projects,  and the classes referenced in SubOther do get \
updated.<br> <br>
My problem is with the package phase.&nbsp; What is happening is that SubOther is \
being packaged BEFORE the JiBX bind goal is run in SubJiBX.&nbsp; I have to re-run \
&quot;mvn package&quot; for the first set of JiBX generated changes to be \
included.&nbsp; The resulting JARs from the  second mvn package seem to work ok, but \
I don't get the warm and fuzzies.<br> <br>
Does anyone know how I can get the bind goal in SubJiBX to run before SubOther is \
packaged so I only need to run the mvn command once?&nbsp; Moving classes between the \
two modules is not an option.<br> <br>
Thanks for any insight!<br>
<font color="#888888"><span style="color:#888888">Scott Dickerson</span></font> <o:p>
</o:p></span></font></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">STATEMENT OF CONFIDENTIALITY:<br>
<br>
<br>
<br>
The information contained in this electronic message and any attachments to<br>
this message are intended for the exclusive use of the addressee(s) and may<br>
contain confidential or privileged information. If you are not the intended<br>
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,<br>
and destroy all copies of this message and any attachments.<br>
</font>
</body>
</html>


[Attachment #4 (--===============3520016541396911266==)]
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic