You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Micah Craig <mc...@visiblepath.com> on 2005/04/04 22:07:35 UTC

multiproject and util:available, strange behavior all of a sudden

Hi,
    Last week we suddenly started experiencing problems with our 
multiproject deployment scripts, which had been working fine, and which 
we didn't change.  The issue manifests as a missing web.xml in our 
deployables.  A bit of background: we build a handful of distinct .war 
deployables which share code but differ in configuration.  Each 
deployable/sub-project lives in its own sub-directory off our main 
repository, and each sub-directory has a 'conf/' dir which contains a 
web.xml and other resources.  We define 
maven.war.webxml=./conf/web.xml.  We run multiproject:install to 
generate the .wars.  All this had been working fine, until suddenly we 
started getting .wars with no web.xmls in them.  When we run war:install 
on each sub-project by hand, the web.xml's are fine and the deployable 
works great.
    Digging into this, I was startled to discover that <util:available> 
and <ant:copy> seem to have different ideas about what the current 
working directory is when invoked under multiproject.  I found this by 
looking at the war plugin's war-resources goal, which does some setup on 
the WEB-INF directory and then
<util:available file="${maven.war.webxml}">
  <ant:copy file="${maven.war.webxml}"
    tofile="${webapp.build.webinf}/web.xml"
    overwrite="true" />
</util:available>
I realized that the <util:available> was not finding the web.xml, so I 
tried overriding the maven.war.webxml property in one of our 
sub-projects to give the path relative to our top level directory, 
instead of relative to the sub-project.  Our top level directory is 
called services, and the sub-project I chose is called searchengine, so 
in the services/searchengine/project.properties I set maven.war.webxml 
to ./searchengine/conf/web.xml instead of ./conf/web.xml.  Now, when I 
run multiproject:install, I get the error:
Unable to obtain goal [multiproject:install-callback] -- C:\Documents 
and 
Settings\mcraig\.maven\cache\maven-war-plugin-1.6.1\plugin.jelly:125:28: 
<ant:copy> Warning: Could not find file 
C:\workspace\services\searchengine\searchengine\conf\web.xml to copy.
Notice that 'searchengine' appears twice in the path that <ant:copy> is 
trying to find.  If I remove the <util:available> call from my local war 
plugin.jelly, and set maven.war.webxml back to ./conf/web.xml, 
multiproject:install works great and generates the wars that we're 
expecting.
    So, it seems that <util:available> is looking for maven.war.webxml 
relative to our top level, 'services' directory, and <ant:copy> is 
looking for it relative to the sub-project, 'searchengine' directory.  
This behavior is strange enough, but stranger still is that I can't for 
the life of me figure out what changed to make this happen.  If anyone 
could provide any insight into either or both of these mysteries, it 
would be hugely appreciated.

-- 
Micah Craig
Developer 
Visible Path Corporation
56 West 22nd Street, 9th Floor
New York, NY  10010
www.visiblepath.com
General Phone Number: (877) VIS-PATH
Office Phone Number:  (646) 253-1963 
Office Fax Number:    (646) 336-6651 
________________________________________________________________
The information contained in this email message and attached files may be privileged, confidential and protected from disclosure. If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited. If you think that you have received this email message in error, please notify the sender by reply email and delete the message and any attachments.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: multiproject and util:available, strange behavior all of a sudden

Posted by baleineca <ba...@gmail.com>.
Try defining the property with ${basedir} instead of .

maven.war.webxml=${basedir}/conf/web.xml



On Apr 4, 2005 1:07 PM, Micah Craig <mc...@visiblepath.com> wrote:
> Hi,
>     Last week we suddenly started experiencing problems with our
> multiproject deployment scripts, which had been working fine, and which
> we didn't change.  The issue manifests as a missing web.xml in our
> deployables.  A bit of background: we build a handful of distinct .war
> deployables which share code but differ in configuration.  Each
> deployable/sub-project lives in its own sub-directory off our main
> repository, and each sub-directory has a 'conf/' dir which contains a
> web.xml and other resources.  We define
> maven.war.webxml=./conf/web.xml.  We run multiproject:install to
> generate the .wars.  All this had been working fine, until suddenly we
> started getting .wars with no web.xmls in them.  When we run war:install
> on each sub-project by hand, the web.xml's are fine and the deployable
> works great.
>     Digging into this, I was startled to discover that <util:available>
> and <ant:copy> seem to have different ideas about what the current
> working directory is when invoked under multiproject.  I found this by
> looking at the war plugin's war-resources goal, which does some setup on
> the WEB-INF directory and then
> <util:available file="${maven.war.webxml}">
>   <ant:copy file="${maven.war.webxml}"
>     tofile="${webapp.build.webinf}/web.xml"
>     overwrite="true" />
> </util:available>
> I realized that the <util:available> was not finding the web.xml, so I
> tried overriding the maven.war.webxml property in one of our
> sub-projects to give the path relative to our top level directory,
> instead of relative to the sub-project.  Our top level directory is
> called services, and the sub-project I chose is called searchengine, so
> in the services/searchengine/project.properties I set maven.war.webxml
> to ./searchengine/conf/web.xml instead of ./conf/web.xml.  Now, when I
> run multiproject:install, I get the error:
> Unable to obtain goal [multiproject:install-callback] -- C:\Documents
> and
> Settings\mcraig\.maven\cache\maven-war-plugin-1.6.1\plugin.jelly:125:28:
> <ant:copy> Warning: Could not find file
> C:\workspace\services\searchengine\searchengine\conf\web.xml to copy.
> Notice that 'searchengine' appears twice in the path that <ant:copy> is
> trying to find.  If I remove the <util:available> call from my local war
> plugin.jelly, and set maven.war.webxml back to ./conf/web.xml,
> multiproject:install works great and generates the wars that we're
> expecting.
>     So, it seems that <util:available> is looking for maven.war.webxml
> relative to our top level, 'services' directory, and <ant:copy> is
> looking for it relative to the sub-project, 'searchengine' directory.
> This behavior is strange enough, but stranger still is that I can't for
> the life of me figure out what changed to make this happen.  If anyone
> could provide any insight into either or both of these mysteries, it
> would be hugely appreciated.
> 
> --
> Micah Craig
> Developer
> Visible Path Corporation
> 56 West 22nd Street, 9th Floor
> New York, NY  10010
> www.visiblepath.com
> General Phone Number: (877) VIS-PATH
> Office Phone Number:  (646) 253-1963
> Office Fax Number:    (646) 336-6651
> ________________________________________________________________
> The information contained in this email message and attached files may be privileged, confidential and protected from disclosure. If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited. If you think that you have received this email message in error, please notify the sender by reply email and delete the message and any attachments.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org