You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Les Hazlewood <le...@hazlewood.com> on 2009/02/26 01:33:10 UTC

Profiles & Filters - sharing common config

I have a webapp that can be deployed as one .war (development) or as two
separate .war files (production w/ firewall in between the two).  I have 3
web modules to reflect this.

web-colocated
web-front
web-back

The web.xml file for each .war is nearly identical, save the spring files
listed to start up an ApplicationContext in each .war.

How can I share a single web.xml file across all 3, but filter in different
values for the comma-delimited spring file list based on profile?  Where
would that master "template" web.xml file live?  Or is there another way to
go about this?

Thanks,

Les

Re: Profiles & Filters - sharing common config

Posted by Brett Porter <br...@apache.org>.
On 26/02/2009, at 11:33 AM, Les Hazlewood wrote:

> I have a webapp that can be deployed as one .war (development) or as  
> two
> separate .war files (production w/ firewall in between the two).  I  
> have 3
> web modules to reflect this.
>
> web-colocated
> web-front
> web-back
>
> The web.xml file for each .war is nearly identical, save the spring  
> files
> listed to start up an ApplicationContext in each .war.
>
> How can I share a single web.xml file across all 3, but filter in  
> different
> values for the comma-delimited spring file list based on profile?   
> Where
> would that master "template" web.xml file live?  Or is there another  
> way to
> go about this?

Use the dependency plugin to grab the file (perhaps several files from  
an archive) - this can be generated in a separate module of your build  
- and unpack it into a location that is then included in your web  
resources configuration.

(Though in this situation, my preference is almost always to adjust  
the application to ensure such variable configuration lives outside  
the WAR, so that you have one release artifact)

- Brett

--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/


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


RE: Profiles & Filters - sharing common config

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>>But the reference  
>>is created to the ${sibling_project}/target/classes directory not to  
>>the artifact produced. So whatever you were going to put into the JAR

>>will be in the ${sibling_project}/target/classes directory 

It's actually a little more screwy than that. It depends on the phase
that you have run. In phases < compile, you get nothing. Compile -
<Package gets you the classes folder. Package + gets you the jar in
/target/


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


Re: Profiles & Filters - sharing common config

Posted by Jason van Zyl <jv...@sonatype.com>.
On 28-Feb-09, at 4:47 PM, Les Hazlewood wrote:

> Does the remote-resources and dependency plugins require the artifact
> they're depending on to be in a repository (even the local one)?
>

Yes. The assumption for both of those plugins is that you're  
requesting the given resource or artifact from a maven repository.

> My 'producer' module is a peer to my 'consumer' module.  The consumer
> requires the resources .jar from the producer.
>
> I want to run 'mvn package' and have my build work, but things are  
> failing.
>
> Is it absolutely mandatory that an 'install' be executed in order to  
> use the
> remote-resources and dependency plugins?  Is there a way to get them  
> to
> point to the .jar files that already exist on disk in the peer  
> modules?  Or
> is that not the Maven Way?

It's called a reactor when a set of projects are build together, and  
in that case dependency references are made to the projects in the  
reactor before querying the local/remote repository. But the reference  
is created to the ${sibling_project}/target/classes directory not to  
the artifact produced. So whatever you were going to put into the JAR  
will be in the ${sibling_project}/target/classes directory and  
therefore available on the classpath. So you can access it as a  
resource. There is no reference in Maven 2.x to get hold of the base  
directory of the reactor so a reliable file reference is not possible.

>
> My desire is to not install to any repo (even my local $HOME/.m2  
> one) unless
> I can guarantee that all modules in a project package correctly.  It  
> just
> doesn't seem right to put anything in a repo as consumable unless the
> project as a whole can package in its entirety...

Sure, but in the example I gave you I assume you were intentionally  
storing the resources in a repository to be shared. You can access the  
resource you need in-situ using a resource reference if you want to  
access something in the build.

>
> Thanks,
>
> Les
>
> On Fri, Feb 27, 2009 at 11:16 AM, Les Hazlewood <le...@hazlewood.com>  
> wrote:
>
>> Ahh - I see your approach Jason - using a .vm template.  Nice -  
>> I'll work
>> with that.
>>
>> Thanks again!
>>
>> Best,
>>
>> Les
>>
>>
>> On Fri, Feb 27, 2009 at 11:03 AM, Les Hazlewood <lhazlewood@apache.org 
>> >wrote:
>>
>>> Before trying the .tgz file, I wanted to see if I could make it  
>>> work as
>>> suggested.  However, placing the template web.xml file in
>>> src/main/resources didn't work - the consumer's
>>> target\maven-shared-archive-resources directory is empty.  Here is  
>>> my
>>> relevant config:
>>>
>>> ==== producer module ====
>>> <plugin>
>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>  <executions>
>>>    <execution>
>>>      <goals>
>>>        <goal>bundle</goal>
>>>      </goals>
>>>      <configuration>
>>>        <includes>
>>>          <param>**/*.xml</param>
>>>        </includes>
>>>      </configuration>
>>>    </execution>
>>>  </executions>
>>> </plugin>
>>>
>>> The web.xml file *is* listed in the
>>> target\classes\META-INF\maven\remote-resources.xml file:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
>>>  <remoteResources>
>>>    <remoteResource>web.xml</remoteResource>
>>>  </remoteResources>
>>> </remoteResourcesBundle>
>>>
>>> Here is how I was trying to consume it from another module:
>>>
>>> ==== consumer module ====
>>> <plugin>
>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>  <executions>
>>>    <execution>
>>>      <goals>
>>>        <goal>process</goal>
>>>      </goals>
>>>      <configuration>
>>>        <resourceBundles>
>>>
>>> <resourceBundle>${project.groupId}:producerModuleName:$ 
>>> {project.version}</resourceBundle>
>>>        </resourceBundles>
>>>      </configuration>
>>>    </execution>
>>>  </executions>
>>> </plugin>
>>> <plugin>
>>>  <artifactId>maven-war-plugin</artifactId>
>>>  <configuration>
>>>
>>> <webXml>${basedir}/target/maven-shared-archive-resources/web.xml</ 
>>> webXml>
>>>  </configuration>
>>> </plugin>
>>>
>>> Any ideas?  Now I'm going to try the tarball...
>>>
>>> - Les
>>>
>>>
>>> On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jvanzyl@sonatype.com 
>>> >wrote:
>>>
>>>> There is a bug in the remote-resources-plugin it seems. So I  
>>>> adjusted
>>>> slightly and here's a version that works:
>>>>
>>>> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz 
>>>> >
>>>>
>>>> I put the resources in the standard src/main/resources, and then
>>>> specified the web.xml in the WAR plugin. Not a hard bug to fix  
>>>> but this will
>>>> let you use the released version of the remote resources plugin.
>>>>
>>>> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>>>>
>>>> Hi all,
>>>>>
>>>>> I'm having a hell of a time getting this to work with web.xml  
>>>>> files.  Is
>>>>> there an example I can look at that produces a bundle and then  
>>>>> consumes
>>>>> one?  If there are any uses of this where the template file is  
>>>>> an XML
>>>>> file,
>>>>> that'd be really useful.
>>>>>
>>>>> I'm trying to do this using a web.xml file as the 'template' to be
>>>>> exported
>>>>> to other modules.  Here is what I have so far:
>>>>>
>>>>> === Creating the bundle (source module) ===
>>>>> <plugin>
>>>>> <artifactId>maven-remote-resources-plugin</artifactId>
>>>>> <executions>
>>>>>  <execution>
>>>>>    <goals>
>>>>>      <goal>bundle</goal>
>>>>>    </goals>
>>>>>    <configuration>
>>>>>
>>>>> <resourcesDirectory>${basedir}/src/main/webapp</ 
>>>>> resourcesDirectory>
>>>>>      <includes>
>>>>>        <param>**/*.xml</param>
>>>>>      </includes>
>>>>>    </configuration>
>>>>>  </execution>
>>>>> </executions>
>>>>> </plugin>
>>>>>
>>>>> == Consuming the bundle (dependent module) ==
>>>>> <plugin>
>>>>> <artifactId>maven-remote-resources-plugin</artifactId>
>>>>> <executions>
>>>>>  <execution>
>>>>>    <goals>
>>>>>      <goal>process</goal>
>>>>>    </goals>
>>>>>    <configuration>
>>>>>      <resourceBundles>
>>>>>
>>>>>
>>>>> <resourceBundle>${project.groupId}:moduleName:$ 
>>>>> {project.version}</resourceBundle>
>>>>>      </resourceBundles>
>>>>>    </configuration>
>>>>>  </execution>
>>>>> </executions>
>>>>> </plugin>
>>>>>
>>>>> When I look in the dependent module's
>>>>> target\maven-shared-archive-resources\WEB-INF directory, there is
>>>>> nothing
>>>>> there - no web.xml file.  Any ideas?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Les
>>>>>
>>>>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>>>>>> wrote:
>>>>>
>>>>> The remote-resources-plugin. This is exactly how we share license
>>>>>> templates
>>>>>> across projects. So if you have a web.xml template you want to  
>>>>>> be used
>>>>>> across many projects I would take a look at  ^^^^^^^^
>>>>>>
>>>>>>
>>>>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>>>>
>>>>>> I have a webapp that can be deployed as one .war (development)  
>>>>>> or as
>>>>>> two
>>>>>>
>>>>>>> separate .war files (production w/ firewall in between the  
>>>>>>> two).  I
>>>>>>> have 3
>>>>>>> web modules to reflect this.
>>>>>>>
>>>>>>> web-colocated
>>>>>>> web-front
>>>>>>> web-back
>>>>>>>
>>>>>>> The web.xml file for each .war is nearly identical, save the  
>>>>>>> spring
>>>>>>> files
>>>>>>> listed to start up an ApplicationContext in each .war.
>>>>>>>
>>>>>>> How can I share a single web.xml file across all 3, but filter  
>>>>>>> in
>>>>>>> different
>>>>>>> values for the comma-delimited spring file list based on  
>>>>>>> profile?
>>>>>>> Where
>>>>>>> would that master "template" web.xml file live?  Or is there  
>>>>>>> another
>>>>>>> way
>>>>>>> to
>>>>>>> go about this?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Les
>>>>>>>
>>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Jason
>>>>>>
>>>>>> ----------------------------------------------------------
>>>>>> Jason van Zyl
>>>>>> Founder,  Apache Maven
>>>>>> http://twitter.com/jvanzyl
>>>>>> ----------------------------------------------------------
>>>>>>
>>>>>> A party which is not afraid of letting culture,
>>>>>> business, and welfare go to ruin completely can
>>>>>> be omnipotent for a while.
>>>>>>
>>>>>> -- Jakob Burckhardt
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>> Thanks,
>>>>
>>>> Jason
>>>>
>>>> ----------------------------------------------------------
>>>> Jason van Zyl
>>>> Founder,  Apache Maven
>>>> http://twitter.com/jvanzyl
>>>> ----------------------------------------------------------
>>>>
>>>> Three may keep a secret if two of them are dead.
>>>>
>>>> -- Benjamin Franklin
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

First, the taking in of scattered particulars under one Idea,
so that everyone understands what is being talked about ... Second,
the separation of the Idea into parts, by dividing it at the joints,
as nature directs, not breaking any limb in half as a bad carver might.

   -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)


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


Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <le...@hazlewood.com>.
Brian, thanks so much for the quick response - I'm gonna try it out!

Cheers,

Les

On Sat, Feb 28, 2009 at 8:45 PM, Brian E. Fox <br...@reply.infinity.nu>wrote:

> It's pretty much not the maven way to expect that they will _never_ be in
> the local repo. However, dependencies are resolved in the "reactor" if it is
> built in the same mvn execution. The dependency:copy/unpack won't find
> things there, but copy-dependencies/unpack-dependencies will.
>
> -----Original Message-----
> From: les.hazlewood@anjinllc.com [mailto:les.hazlewood@anjinllc.com] On
> Behalf Of Les Hazlewood
> Sent: Saturday, February 28, 2009 7:48 PM
> To: Maven Users List
> Subject: Re: Profiles & Filters - sharing common config
>
> Does the remote-resources and dependency plugins require the artifact
> they're depending on to be in a repository (even the local one)?
>
> My 'producer' module is a peer to my 'consumer' module.  The consumer
> requires the resources .jar from the producer.
>
> I want to run 'mvn package' and have my build work, but things are failing.
>
> Is it absolutely mandatory that an 'install' be executed in order to use
> the
> remote-resources and dependency plugins?  Is there a way to get them to
> point to the .jar files that already exist on disk in the peer modules?  Or
> is that not the Maven Way?
>
> My desire is to not install to any repo (even my local $HOME/.m2 one)
> unless
> I can guarantee that all modules in a project package correctly.  It just
> doesn't seem right to put anything in a repo as consumable unless the
> project as a whole can package in its entirety...
>
> Thanks,
>
> Les
>
> On Fri, Feb 27, 2009 at 11:16 AM, Les Hazlewood <le...@hazlewood.com> wrote:
>
> > Ahh - I see your approach Jason - using a .vm template.  Nice - I'll work
> > with that.
> >
> > Thanks again!
> >
> > Best,
> >
> > Les
> >
> >
> > On Fri, Feb 27, 2009 at 11:03 AM, Les Hazlewood <lhazlewood@apache.org
> >wrote:
> >
> >> Before trying the .tgz file, I wanted to see if I could make it work as
> >> suggested.  However, placing the template web.xml file in
> >> src/main/resources didn't work - the consumer's
> >> target\maven-shared-archive-resources directory is empty.  Here is my
> >> relevant config:
> >>
> >> ==== producer module ====
> >> <plugin>
> >>   <artifactId>maven-remote-resources-plugin</artifactId>
> >>   <executions>
> >>     <execution>
> >>       <goals>
> >>         <goal>bundle</goal>
> >>       </goals>
> >>       <configuration>
> >>         <includes>
> >>           <param>**/*.xml</param>
> >>         </includes>
> >>       </configuration>
> >>     </execution>
> >>   </executions>
> >> </plugin>
> >>
> >> The web.xml file *is* listed in the
> >> target\classes\META-INF\maven\remote-resources.xml file:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
> >>   <remoteResources>
> >>     <remoteResource>web.xml</remoteResource>
> >>   </remoteResources>
> >> </remoteResourcesBundle>
> >>
> >> Here is how I was trying to consume it from another module:
> >>
> >> ==== consumer module ====
> >> <plugin>
> >>   <artifactId>maven-remote-resources-plugin</artifactId>
> >>   <executions>
> >>     <execution>
> >>       <goals>
> >>         <goal>process</goal>
> >>       </goals>
> >>       <configuration>
> >>         <resourceBundles>
> >>
> >>
> <resourceBundle>${project.groupId}:producerModuleName:${project.version}</resourceBundle>
> >>         </resourceBundles>
> >>       </configuration>
> >>     </execution>
> >>   </executions>
> >> </plugin>
> >> <plugin>
> >>   <artifactId>maven-war-plugin</artifactId>
> >>   <configuration>
> >>
> >>
> <webXml>${basedir}/target/maven-shared-archive-resources/web.xml</webXml>
> >>   </configuration>
> >> </plugin>
> >>
> >> Any ideas?  Now I'm going to try the tarball...
> >>
> >> - Les
> >>
> >>
> >> On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jvanzyl@sonatype.com
> >wrote:
> >>
> >>> There is a bug in the remote-resources-plugin it seems. So I adjusted
> >>> slightly and here's a version that works:
> >>>
> >>> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
> <http://people.apache.org/%7Ejvanzyl/les2.tgz>
> >>>
> >>> I put the resources in the standard src/main/resources, and then
> >>> specified the web.xml in the WAR plugin. Not a hard bug to fix but this
> will
> >>> let you use the released version of the remote resources plugin.
> >>>
> >>> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
> >>>
> >>>  Hi all,
> >>>>
> >>>> I'm having a hell of a time getting this to work with web.xml files.
>  Is
> >>>> there an example I can look at that produces a bundle and then
> consumes
> >>>> one?  If there are any uses of this where the template file is an XML
> >>>> file,
> >>>> that'd be really useful.
> >>>>
> >>>> I'm trying to do this using a web.xml file as the 'template' to be
> >>>> exported
> >>>> to other modules.  Here is what I have so far:
> >>>>
> >>>> === Creating the bundle (source module) ===
> >>>> <plugin>
> >>>>  <artifactId>maven-remote-resources-plugin</artifactId>
> >>>>  <executions>
> >>>>   <execution>
> >>>>     <goals>
> >>>>       <goal>bundle</goal>
> >>>>     </goals>
> >>>>     <configuration>
> >>>>
> >>>> <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
> >>>>       <includes>
> >>>>         <param>**/*.xml</param>
> >>>>       </includes>
> >>>>     </configuration>
> >>>>   </execution>
> >>>>  </executions>
> >>>> </plugin>
> >>>>
> >>>> == Consuming the bundle (dependent module) ==
> >>>> <plugin>
> >>>>  <artifactId>maven-remote-resources-plugin</artifactId>
> >>>>  <executions>
> >>>>   <execution>
> >>>>     <goals>
> >>>>       <goal>process</goal>
> >>>>     </goals>
> >>>>     <configuration>
> >>>>       <resourceBundles>
> >>>>
> >>>>
> >>>>
> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
> >>>>       </resourceBundles>
> >>>>     </configuration>
> >>>>   </execution>
> >>>>  </executions>
> >>>> </plugin>
> >>>>
> >>>> When I look in the dependent module's
> >>>> target\maven-shared-archive-resources\WEB-INF directory, there is
> >>>> nothing
> >>>> there - no web.xml file.  Any ideas?
> >>>>
> >>>> Cheers,
> >>>>
> >>>> Les
> >>>>
> >>>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
> >>>> >wrote:
> >>>>
> >>>>  The remote-resources-plugin. This is exactly how we share license
> >>>>> templates
> >>>>> across projects. So if you have a web.xml template you want to be
> used
> >>>>> across many projects I would take a look at  ^^^^^^^^
> >>>>>
> >>>>>
> >>>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
> >>>>>
> >>>>> I have a webapp that can be deployed as one .war (development) or as
> >>>>> two
> >>>>>
> >>>>>> separate .war files (production w/ firewall in between the two).  I
> >>>>>> have 3
> >>>>>> web modules to reflect this.
> >>>>>>
> >>>>>> web-colocated
> >>>>>> web-front
> >>>>>> web-back
> >>>>>>
> >>>>>> The web.xml file for each .war is nearly identical, save the spring
> >>>>>> files
> >>>>>> listed to start up an ApplicationContext in each .war.
> >>>>>>
> >>>>>> How can I share a single web.xml file across all 3, but filter in
> >>>>>> different
> >>>>>> values for the comma-delimited spring file list based on profile?
> >>>>>>  Where
> >>>>>> would that master "template" web.xml file live?  Or is there another
> >>>>>> way
> >>>>>> to
> >>>>>> go about this?
> >>>>>>
> >>>>>> Thanks,
> >>>>>>
> >>>>>> Les
> >>>>>>
> >>>>>>
> >>>>> Thanks,
> >>>>>
> >>>>> Jason
> >>>>>
> >>>>> ----------------------------------------------------------
> >>>>> Jason van Zyl
> >>>>> Founder,  Apache Maven
> >>>>> http://twitter.com/jvanzyl
> >>>>> ----------------------------------------------------------
> >>>>>
> >>>>> A party which is not afraid of letting culture,
> >>>>> business, and welfare go to ruin completely can
> >>>>> be omnipotent for a while.
> >>>>>
> >>>>> -- Jakob Burckhardt
> >>>>>
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>> Thanks,
> >>>
> >>> Jason
> >>>
> >>> ----------------------------------------------------------
> >>> Jason van Zyl
> >>> Founder,  Apache Maven
> >>> http://twitter.com/jvanzyl
> >>> ----------------------------------------------------------
> >>>
> >>> Three may keep a secret if two of them are dead.
> >>>
> >>>  -- Benjamin Franklin
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >>
> >
>

RE: Profiles & Filters - sharing common config

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
It's pretty much not the maven way to expect that they will _never_ be in the local repo. However, dependencies are resolved in the "reactor" if it is built in the same mvn execution. The dependency:copy/unpack won't find things there, but copy-dependencies/unpack-dependencies will.

-----Original Message-----
From: les.hazlewood@anjinllc.com [mailto:les.hazlewood@anjinllc.com] On Behalf Of Les Hazlewood
Sent: Saturday, February 28, 2009 7:48 PM
To: Maven Users List
Subject: Re: Profiles & Filters - sharing common config

Does the remote-resources and dependency plugins require the artifact
they're depending on to be in a repository (even the local one)?

My 'producer' module is a peer to my 'consumer' module.  The consumer
requires the resources .jar from the producer.

I want to run 'mvn package' and have my build work, but things are failing.

Is it absolutely mandatory that an 'install' be executed in order to use the
remote-resources and dependency plugins?  Is there a way to get them to
point to the .jar files that already exist on disk in the peer modules?  Or
is that not the Maven Way?

My desire is to not install to any repo (even my local $HOME/.m2 one) unless
I can guarantee that all modules in a project package correctly.  It just
doesn't seem right to put anything in a repo as consumable unless the
project as a whole can package in its entirety...

Thanks,

Les

On Fri, Feb 27, 2009 at 11:16 AM, Les Hazlewood <le...@hazlewood.com> wrote:

> Ahh - I see your approach Jason - using a .vm template.  Nice - I'll work
> with that.
>
> Thanks again!
>
> Best,
>
> Les
>
>
> On Fri, Feb 27, 2009 at 11:03 AM, Les Hazlewood <lh...@apache.org>wrote:
>
>> Before trying the .tgz file, I wanted to see if I could make it work as
>> suggested.  However, placing the template web.xml file in
>> src/main/resources didn't work - the consumer's
>> target\maven-shared-archive-resources directory is empty.  Here is my
>> relevant config:
>>
>> ==== producer module ====
>> <plugin>
>>   <artifactId>maven-remote-resources-plugin</artifactId>
>>   <executions>
>>     <execution>
>>       <goals>
>>         <goal>bundle</goal>
>>       </goals>
>>       <configuration>
>>         <includes>
>>           <param>**/*.xml</param>
>>         </includes>
>>       </configuration>
>>     </execution>
>>   </executions>
>> </plugin>
>>
>> The web.xml file *is* listed in the
>> target\classes\META-INF\maven\remote-resources.xml file:
>>
>> <?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
>>   <remoteResources>
>>     <remoteResource>web.xml</remoteResource>
>>   </remoteResources>
>> </remoteResourcesBundle>
>>
>> Here is how I was trying to consume it from another module:
>>
>> ==== consumer module ====
>> <plugin>
>>   <artifactId>maven-remote-resources-plugin</artifactId>
>>   <executions>
>>     <execution>
>>       <goals>
>>         <goal>process</goal>
>>       </goals>
>>       <configuration>
>>         <resourceBundles>
>>
>> <resourceBundle>${project.groupId}:producerModuleName:${project.version}</resourceBundle>
>>         </resourceBundles>
>>       </configuration>
>>     </execution>
>>   </executions>
>> </plugin>
>> <plugin>
>>   <artifactId>maven-war-plugin</artifactId>
>>   <configuration>
>>
>> <webXml>${basedir}/target/maven-shared-archive-resources/web.xml</webXml>
>>   </configuration>
>> </plugin>
>>
>> Any ideas?  Now I'm going to try the tarball...
>>
>> - Les
>>
>>
>> On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jv...@sonatype.com>wrote:
>>
>>> There is a bug in the remote-resources-plugin it seems. So I adjusted
>>> slightly and here's a version that works:
>>>
>>> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
>>>
>>> I put the resources in the standard src/main/resources, and then
>>> specified the web.xml in the WAR plugin. Not a hard bug to fix but this will
>>> let you use the released version of the remote resources plugin.
>>>
>>> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>>>
>>>  Hi all,
>>>>
>>>> I'm having a hell of a time getting this to work with web.xml files.  Is
>>>> there an example I can look at that produces a bundle and then consumes
>>>> one?  If there are any uses of this where the template file is an XML
>>>> file,
>>>> that'd be really useful.
>>>>
>>>> I'm trying to do this using a web.xml file as the 'template' to be
>>>> exported
>>>> to other modules.  Here is what I have so far:
>>>>
>>>> === Creating the bundle (source module) ===
>>>> <plugin>
>>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>>  <executions>
>>>>   <execution>
>>>>     <goals>
>>>>       <goal>bundle</goal>
>>>>     </goals>
>>>>     <configuration>
>>>>
>>>> <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
>>>>       <includes>
>>>>         <param>**/*.xml</param>
>>>>       </includes>
>>>>     </configuration>
>>>>   </execution>
>>>>  </executions>
>>>> </plugin>
>>>>
>>>> == Consuming the bundle (dependent module) ==
>>>> <plugin>
>>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>>  <executions>
>>>>   <execution>
>>>>     <goals>
>>>>       <goal>process</goal>
>>>>     </goals>
>>>>     <configuration>
>>>>       <resourceBundles>
>>>>
>>>>
>>>> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
>>>>       </resourceBundles>
>>>>     </configuration>
>>>>   </execution>
>>>>  </executions>
>>>> </plugin>
>>>>
>>>> When I look in the dependent module's
>>>> target\maven-shared-archive-resources\WEB-INF directory, there is
>>>> nothing
>>>> there - no web.xml file.  Any ideas?
>>>>
>>>> Cheers,
>>>>
>>>> Les
>>>>
>>>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>>>> >wrote:
>>>>
>>>>  The remote-resources-plugin. This is exactly how we share license
>>>>> templates
>>>>> across projects. So if you have a web.xml template you want to be used
>>>>> across many projects I would take a look at  ^^^^^^^^
>>>>>
>>>>>
>>>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>>>
>>>>> I have a webapp that can be deployed as one .war (development) or as
>>>>> two
>>>>>
>>>>>> separate .war files (production w/ firewall in between the two).  I
>>>>>> have 3
>>>>>> web modules to reflect this.
>>>>>>
>>>>>> web-colocated
>>>>>> web-front
>>>>>> web-back
>>>>>>
>>>>>> The web.xml file for each .war is nearly identical, save the spring
>>>>>> files
>>>>>> listed to start up an ApplicationContext in each .war.
>>>>>>
>>>>>> How can I share a single web.xml file across all 3, but filter in
>>>>>> different
>>>>>> values for the comma-delimited spring file list based on profile?
>>>>>>  Where
>>>>>> would that master "template" web.xml file live?  Or is there another
>>>>>> way
>>>>>> to
>>>>>> go about this?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Les
>>>>>>
>>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jason
>>>>>
>>>>> ----------------------------------------------------------
>>>>> Jason van Zyl
>>>>> Founder,  Apache Maven
>>>>> http://twitter.com/jvanzyl
>>>>> ----------------------------------------------------------
>>>>>
>>>>> A party which is not afraid of letting culture,
>>>>> business, and welfare go to ruin completely can
>>>>> be omnipotent for a while.
>>>>>
>>>>> -- Jakob Burckhardt
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>>
>>> Three may keep a secret if two of them are dead.
>>>
>>>  -- Benjamin Franklin
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>

Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <le...@hazlewood.com>.
Does the remote-resources and dependency plugins require the artifact
they're depending on to be in a repository (even the local one)?

My 'producer' module is a peer to my 'consumer' module.  The consumer
requires the resources .jar from the producer.

I want to run 'mvn package' and have my build work, but things are failing.

Is it absolutely mandatory that an 'install' be executed in order to use the
remote-resources and dependency plugins?  Is there a way to get them to
point to the .jar files that already exist on disk in the peer modules?  Or
is that not the Maven Way?

My desire is to not install to any repo (even my local $HOME/.m2 one) unless
I can guarantee that all modules in a project package correctly.  It just
doesn't seem right to put anything in a repo as consumable unless the
project as a whole can package in its entirety...

Thanks,

Les

On Fri, Feb 27, 2009 at 11:16 AM, Les Hazlewood <le...@hazlewood.com> wrote:

> Ahh - I see your approach Jason - using a .vm template.  Nice - I'll work
> with that.
>
> Thanks again!
>
> Best,
>
> Les
>
>
> On Fri, Feb 27, 2009 at 11:03 AM, Les Hazlewood <lh...@apache.org>wrote:
>
>> Before trying the .tgz file, I wanted to see if I could make it work as
>> suggested.  However, placing the template web.xml file in
>> src/main/resources didn't work - the consumer's
>> target\maven-shared-archive-resources directory is empty.  Here is my
>> relevant config:
>>
>> ==== producer module ====
>> <plugin>
>>   <artifactId>maven-remote-resources-plugin</artifactId>
>>   <executions>
>>     <execution>
>>       <goals>
>>         <goal>bundle</goal>
>>       </goals>
>>       <configuration>
>>         <includes>
>>           <param>**/*.xml</param>
>>         </includes>
>>       </configuration>
>>     </execution>
>>   </executions>
>> </plugin>
>>
>> The web.xml file *is* listed in the
>> target\classes\META-INF\maven\remote-resources.xml file:
>>
>> <?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
>>   <remoteResources>
>>     <remoteResource>web.xml</remoteResource>
>>   </remoteResources>
>> </remoteResourcesBundle>
>>
>> Here is how I was trying to consume it from another module:
>>
>> ==== consumer module ====
>> <plugin>
>>   <artifactId>maven-remote-resources-plugin</artifactId>
>>   <executions>
>>     <execution>
>>       <goals>
>>         <goal>process</goal>
>>       </goals>
>>       <configuration>
>>         <resourceBundles>
>>
>> <resourceBundle>${project.groupId}:producerModuleName:${project.version}</resourceBundle>
>>         </resourceBundles>
>>       </configuration>
>>     </execution>
>>   </executions>
>> </plugin>
>> <plugin>
>>   <artifactId>maven-war-plugin</artifactId>
>>   <configuration>
>>
>> <webXml>${basedir}/target/maven-shared-archive-resources/web.xml</webXml>
>>   </configuration>
>> </plugin>
>>
>> Any ideas?  Now I'm going to try the tarball...
>>
>> - Les
>>
>>
>> On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jv...@sonatype.com>wrote:
>>
>>> There is a bug in the remote-resources-plugin it seems. So I adjusted
>>> slightly and here's a version that works:
>>>
>>> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
>>>
>>> I put the resources in the standard src/main/resources, and then
>>> specified the web.xml in the WAR plugin. Not a hard bug to fix but this will
>>> let you use the released version of the remote resources plugin.
>>>
>>> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>>>
>>>  Hi all,
>>>>
>>>> I'm having a hell of a time getting this to work with web.xml files.  Is
>>>> there an example I can look at that produces a bundle and then consumes
>>>> one?  If there are any uses of this where the template file is an XML
>>>> file,
>>>> that'd be really useful.
>>>>
>>>> I'm trying to do this using a web.xml file as the 'template' to be
>>>> exported
>>>> to other modules.  Here is what I have so far:
>>>>
>>>> === Creating the bundle (source module) ===
>>>> <plugin>
>>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>>  <executions>
>>>>   <execution>
>>>>     <goals>
>>>>       <goal>bundle</goal>
>>>>     </goals>
>>>>     <configuration>
>>>>
>>>> <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
>>>>       <includes>
>>>>         <param>**/*.xml</param>
>>>>       </includes>
>>>>     </configuration>
>>>>   </execution>
>>>>  </executions>
>>>> </plugin>
>>>>
>>>> == Consuming the bundle (dependent module) ==
>>>> <plugin>
>>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>>  <executions>
>>>>   <execution>
>>>>     <goals>
>>>>       <goal>process</goal>
>>>>     </goals>
>>>>     <configuration>
>>>>       <resourceBundles>
>>>>
>>>>
>>>> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
>>>>       </resourceBundles>
>>>>     </configuration>
>>>>   </execution>
>>>>  </executions>
>>>> </plugin>
>>>>
>>>> When I look in the dependent module's
>>>> target\maven-shared-archive-resources\WEB-INF directory, there is
>>>> nothing
>>>> there - no web.xml file.  Any ideas?
>>>>
>>>> Cheers,
>>>>
>>>> Les
>>>>
>>>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>>>> >wrote:
>>>>
>>>>  The remote-resources-plugin. This is exactly how we share license
>>>>> templates
>>>>> across projects. So if you have a web.xml template you want to be used
>>>>> across many projects I would take a look at  ^^^^^^^^
>>>>>
>>>>>
>>>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>>>
>>>>> I have a webapp that can be deployed as one .war (development) or as
>>>>> two
>>>>>
>>>>>> separate .war files (production w/ firewall in between the two).  I
>>>>>> have 3
>>>>>> web modules to reflect this.
>>>>>>
>>>>>> web-colocated
>>>>>> web-front
>>>>>> web-back
>>>>>>
>>>>>> The web.xml file for each .war is nearly identical, save the spring
>>>>>> files
>>>>>> listed to start up an ApplicationContext in each .war.
>>>>>>
>>>>>> How can I share a single web.xml file across all 3, but filter in
>>>>>> different
>>>>>> values for the comma-delimited spring file list based on profile?
>>>>>>  Where
>>>>>> would that master "template" web.xml file live?  Or is there another
>>>>>> way
>>>>>> to
>>>>>> go about this?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Les
>>>>>>
>>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jason
>>>>>
>>>>> ----------------------------------------------------------
>>>>> Jason van Zyl
>>>>> Founder,  Apache Maven
>>>>> http://twitter.com/jvanzyl
>>>>> ----------------------------------------------------------
>>>>>
>>>>> A party which is not afraid of letting culture,
>>>>> business, and welfare go to ruin completely can
>>>>> be omnipotent for a while.
>>>>>
>>>>> -- Jakob Burckhardt
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>>
>>> Three may keep a secret if two of them are dead.
>>>
>>>  -- Benjamin Franklin
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>

Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <le...@hazlewood.com>.
Ahh - I see your approach Jason - using a .vm template.  Nice - I'll work
with that.

Thanks again!

Best,

Les

On Fri, Feb 27, 2009 at 11:03 AM, Les Hazlewood <lh...@apache.org>wrote:

> Before trying the .tgz file, I wanted to see if I could make it work as
> suggested.  However, placing the template web.xml file in
> src/main/resources didn't work - the consumer's
> target\maven-shared-archive-resources directory is empty.  Here is my
> relevant config:
>
> ==== producer module ====
> <plugin>
>   <artifactId>maven-remote-resources-plugin</artifactId>
>   <executions>
>     <execution>
>       <goals>
>         <goal>bundle</goal>
>       </goals>
>       <configuration>
>         <includes>
>           <param>**/*.xml</param>
>         </includes>
>       </configuration>
>     </execution>
>   </executions>
> </plugin>
>
> The web.xml file *is* listed in the
> target\classes\META-INF\maven\remote-resources.xml file:
>
> <?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
>   <remoteResources>
>     <remoteResource>web.xml</remoteResource>
>   </remoteResources>
> </remoteResourcesBundle>
>
> Here is how I was trying to consume it from another module:
>
> ==== consumer module ====
> <plugin>
>   <artifactId>maven-remote-resources-plugin</artifactId>
>   <executions>
>     <execution>
>       <goals>
>         <goal>process</goal>
>       </goals>
>       <configuration>
>         <resourceBundles>
>
> <resourceBundle>${project.groupId}:producerModuleName:${project.version}</resourceBundle>
>         </resourceBundles>
>       </configuration>
>     </execution>
>   </executions>
> </plugin>
> <plugin>
>   <artifactId>maven-war-plugin</artifactId>
>   <configuration>
>
> <webXml>${basedir}/target/maven-shared-archive-resources/web.xml</webXml>
>   </configuration>
> </plugin>
>
> Any ideas?  Now I'm going to try the tarball...
>
> - Les
>
>
> On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jv...@sonatype.com>wrote:
>
>> There is a bug in the remote-resources-plugin it seems. So I adjusted
>> slightly and here's a version that works:
>>
>> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
>>
>> I put the resources in the standard src/main/resources, and then specified
>> the web.xml in the WAR plugin. Not a hard bug to fix but this will let you
>> use the released version of the remote resources plugin.
>>
>> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>>
>>  Hi all,
>>>
>>> I'm having a hell of a time getting this to work with web.xml files.  Is
>>> there an example I can look at that produces a bundle and then consumes
>>> one?  If there are any uses of this where the template file is an XML
>>> file,
>>> that'd be really useful.
>>>
>>> I'm trying to do this using a web.xml file as the 'template' to be
>>> exported
>>> to other modules.  Here is what I have so far:
>>>
>>> === Creating the bundle (source module) ===
>>> <plugin>
>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>  <executions>
>>>   <execution>
>>>     <goals>
>>>       <goal>bundle</goal>
>>>     </goals>
>>>     <configuration>
>>>       <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
>>>       <includes>
>>>         <param>**/*.xml</param>
>>>       </includes>
>>>     </configuration>
>>>   </execution>
>>>  </executions>
>>> </plugin>
>>>
>>> == Consuming the bundle (dependent module) ==
>>> <plugin>
>>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>>  <executions>
>>>   <execution>
>>>     <goals>
>>>       <goal>process</goal>
>>>     </goals>
>>>     <configuration>
>>>       <resourceBundles>
>>>
>>>
>>> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
>>>       </resourceBundles>
>>>     </configuration>
>>>   </execution>
>>>  </executions>
>>> </plugin>
>>>
>>> When I look in the dependent module's
>>> target\maven-shared-archive-resources\WEB-INF directory, there is nothing
>>> there - no web.xml file.  Any ideas?
>>>
>>> Cheers,
>>>
>>> Les
>>>
>>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>>> >wrote:
>>>
>>>  The remote-resources-plugin. This is exactly how we share license
>>>> templates
>>>> across projects. So if you have a web.xml template you want to be used
>>>> across many projects I would take a look at  ^^^^^^^^
>>>>
>>>>
>>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>>
>>>> I have a webapp that can be deployed as one .war (development) or as two
>>>>
>>>>> separate .war files (production w/ firewall in between the two).  I
>>>>> have 3
>>>>> web modules to reflect this.
>>>>>
>>>>> web-colocated
>>>>> web-front
>>>>> web-back
>>>>>
>>>>> The web.xml file for each .war is nearly identical, save the spring
>>>>> files
>>>>> listed to start up an ApplicationContext in each .war.
>>>>>
>>>>> How can I share a single web.xml file across all 3, but filter in
>>>>> different
>>>>> values for the comma-delimited spring file list based on profile?
>>>>>  Where
>>>>> would that master "template" web.xml file live?  Or is there another
>>>>> way
>>>>> to
>>>>> go about this?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Les
>>>>>
>>>>>
>>>> Thanks,
>>>>
>>>> Jason
>>>>
>>>> ----------------------------------------------------------
>>>> Jason van Zyl
>>>> Founder,  Apache Maven
>>>> http://twitter.com/jvanzyl
>>>> ----------------------------------------------------------
>>>>
>>>> A party which is not afraid of letting culture,
>>>> business, and welfare go to ruin completely can
>>>> be omnipotent for a while.
>>>>
>>>> -- Jakob Burckhardt
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>> Three may keep a secret if two of them are dead.
>>
>>  -- Benjamin Franklin
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <lh...@apache.org>.
Before trying the .tgz file, I wanted to see if I could make it work as
suggested.  However, placing the template web.xml file in
src/main/resourcesdidn't work - the consumer's
target\maven-shared-archive-resources directory is empty.  Here is my
relevant config:

==== producer module ====
<plugin>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>bundle</goal>
      </goals>
      <configuration>
        <includes>
          <param>**/*.xml</param>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin>

The web.xml file *is* listed in the
target\classes\META-INF\maven\remote-resources.xml file:

<?xml version="1.0" encoding="UTF-8"?><remoteResourcesBundle>
  <remoteResources>
    <remoteResource>web.xml</remoteResource>
  </remoteResources>
</remoteResourcesBundle>

Here is how I was trying to consume it from another module:

==== consumer module ====
<plugin>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <resourceBundles>

<resourceBundle>${project.groupId}:producerModuleName:${project.version}</resourceBundle>
        </resourceBundles>
      </configuration>
    </execution>
  </executions>
</plugin>
<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>

<webXml>${basedir}/target/maven-shared-archive-resources/web.xml</webXml>
  </configuration>
</plugin>

Any ideas?  Now I'm going to try the tarball...

- Les

On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jv...@sonatype.com>wrote:

> There is a bug in the remote-resources-plugin it seems. So I adjusted
> slightly and here's a version that works:
>
> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
>
> I put the resources in the standard src/main/resources, and then specified
> the web.xml in the WAR plugin. Not a hard bug to fix but this will let you
> use the released version of the remote resources plugin.
>
> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>
>  Hi all,
>>
>> I'm having a hell of a time getting this to work with web.xml files.  Is
>> there an example I can look at that produces a bundle and then consumes
>> one?  If there are any uses of this where the template file is an XML
>> file,
>> that'd be really useful.
>>
>> I'm trying to do this using a web.xml file as the 'template' to be
>> exported
>> to other modules.  Here is what I have so far:
>>
>> === Creating the bundle (source module) ===
>> <plugin>
>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>  <executions>
>>   <execution>
>>     <goals>
>>       <goal>bundle</goal>
>>     </goals>
>>     <configuration>
>>       <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
>>       <includes>
>>         <param>**/*.xml</param>
>>       </includes>
>>     </configuration>
>>   </execution>
>>  </executions>
>> </plugin>
>>
>> == Consuming the bundle (dependent module) ==
>> <plugin>
>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>  <executions>
>>   <execution>
>>     <goals>
>>       <goal>process</goal>
>>     </goals>
>>     <configuration>
>>       <resourceBundles>
>>
>>
>> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
>>       </resourceBundles>
>>     </configuration>
>>   </execution>
>>  </executions>
>> </plugin>
>>
>> When I look in the dependent module's
>> target\maven-shared-archive-resources\WEB-INF directory, there is nothing
>> there - no web.xml file.  Any ideas?
>>
>> Cheers,
>>
>> Les
>>
>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>> >wrote:
>>
>>  The remote-resources-plugin. This is exactly how we share license
>>> templates
>>> across projects. So if you have a web.xml template you want to be used
>>> across many projects I would take a look at  ^^^^^^^^
>>>
>>>
>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>
>>> I have a webapp that can be deployed as one .war (development) or as two
>>>
>>>> separate .war files (production w/ firewall in between the two).  I have
>>>> 3
>>>> web modules to reflect this.
>>>>
>>>> web-colocated
>>>> web-front
>>>> web-back
>>>>
>>>> The web.xml file for each .war is nearly identical, save the spring
>>>> files
>>>> listed to start up an ApplicationContext in each .war.
>>>>
>>>> How can I share a single web.xml file across all 3, but filter in
>>>> different
>>>> values for the comma-delimited spring file list based on profile?  Where
>>>> would that master "template" web.xml file live?  Or is there another way
>>>> to
>>>> go about this?
>>>>
>>>> Thanks,
>>>>
>>>> Les
>>>>
>>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>>
>>> A party which is not afraid of letting culture,
>>> business, and welfare go to ruin completely can
>>> be omnipotent for a while.
>>>
>>> -- Jakob Burckhardt
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> Three may keep a secret if two of them are dead.
>
>  -- Benjamin Franklin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <le...@hazlewood.com>.
Thanks Jason, I'll give it a shot right now.

Best,

Les

On Thu, Feb 26, 2009 at 11:54 PM, Jason van Zyl <jv...@sonatype.com>wrote:

> There is a bug in the remote-resources-plugin it seems. So I adjusted
> slightly and here's a version that works:
>
> http://people.apache.org/~jvanzyl/les2.tgz<http://people.apache.org/%7Ejvanzyl/les2.tgz>
>
> I put the resources in the standard src/main/resources, and then specified
> the web.xml in the WAR plugin. Not a hard bug to fix but this will let you
> use the released version of the remote resources plugin.
>
> On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:
>
>  Hi all,
>>
>> I'm having a hell of a time getting this to work with web.xml files.  Is
>> there an example I can look at that produces a bundle and then consumes
>> one?  If there are any uses of this where the template file is an XML
>> file,
>> that'd be really useful.
>>
>> I'm trying to do this using a web.xml file as the 'template' to be
>> exported
>> to other modules.  Here is what I have so far:
>>
>> === Creating the bundle (source module) ===
>> <plugin>
>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>  <executions>
>>   <execution>
>>     <goals>
>>       <goal>bundle</goal>
>>     </goals>
>>     <configuration>
>>       <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
>>       <includes>
>>         <param>**/*.xml</param>
>>       </includes>
>>     </configuration>
>>   </execution>
>>  </executions>
>> </plugin>
>>
>> == Consuming the bundle (dependent module) ==
>> <plugin>
>>  <artifactId>maven-remote-resources-plugin</artifactId>
>>  <executions>
>>   <execution>
>>     <goals>
>>       <goal>process</goal>
>>     </goals>
>>     <configuration>
>>       <resourceBundles>
>>
>>
>> <resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
>>       </resourceBundles>
>>     </configuration>
>>   </execution>
>>  </executions>
>> </plugin>
>>
>> When I look in the dependent module's
>> target\maven-shared-archive-resources\WEB-INF directory, there is nothing
>> there - no web.xml file.  Any ideas?
>>
>> Cheers,
>>
>> Les
>>
>> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jvanzyl@sonatype.com
>> >wrote:
>>
>>  The remote-resources-plugin. This is exactly how we share license
>>> templates
>>> across projects. So if you have a web.xml template you want to be used
>>> across many projects I would take a look at  ^^^^^^^^
>>>
>>>
>>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>>
>>> I have a webapp that can be deployed as one .war (development) or as two
>>>
>>>> separate .war files (production w/ firewall in between the two).  I have
>>>> 3
>>>> web modules to reflect this.
>>>>
>>>> web-colocated
>>>> web-front
>>>> web-back
>>>>
>>>> The web.xml file for each .war is nearly identical, save the spring
>>>> files
>>>> listed to start up an ApplicationContext in each .war.
>>>>
>>>> How can I share a single web.xml file across all 3, but filter in
>>>> different
>>>> values for the comma-delimited spring file list based on profile?  Where
>>>> would that master "template" web.xml file live?  Or is there another way
>>>> to
>>>> go about this?
>>>>
>>>> Thanks,
>>>>
>>>> Les
>>>>
>>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>>
>>> A party which is not afraid of letting culture,
>>> business, and welfare go to ruin completely can
>>> be omnipotent for a while.
>>>
>>> -- Jakob Burckhardt
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> Three may keep a secret if two of them are dead.
>
>  -- Benjamin Franklin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Profiles & Filters - sharing common config

Posted by Jason van Zyl <jv...@sonatype.com>.
There is a bug in the remote-resources-plugin it seems. So I adjusted  
slightly and here's a version that works:

http://people.apache.org/~jvanzyl/les2.tgz

I put the resources in the standard src/main/resources, and then  
specified the web.xml in the WAR plugin. Not a hard bug to fix but  
this will let you use the released version of the remote resources  
plugin.

On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:

> Hi all,
>
> I'm having a hell of a time getting this to work with web.xml  
> files.  Is
> there an example I can look at that produces a bundle and then  
> consumes
> one?  If there are any uses of this where the template file is an  
> XML file,
> that'd be really useful.
>
> I'm trying to do this using a web.xml file as the 'template' to be  
> exported
> to other modules.  Here is what I have so far:
>
> === Creating the bundle (source module) ===
> <plugin>
>  <artifactId>maven-remote-resources-plugin</artifactId>
>  <executions>
>    <execution>
>      <goals>
>        <goal>bundle</goal>
>      </goals>
>      <configuration>
>        <resourcesDirectory>${basedir}/src/main/webapp</ 
> resourcesDirectory>
>        <includes>
>          <param>**/*.xml</param>
>        </includes>
>      </configuration>
>    </execution>
>  </executions>
> </plugin>
>
> == Consuming the bundle (dependent module) ==
> <plugin>
>  <artifactId>maven-remote-resources-plugin</artifactId>
>  <executions>
>    <execution>
>      <goals>
>        <goal>process</goal>
>      </goals>
>      <configuration>
>        <resourceBundles>
>
> <resourceBundle>${project.groupId}:moduleName:${project.version}</ 
> resourceBundle>
>        </resourceBundles>
>      </configuration>
>    </execution>
>  </executions>
> </plugin>
>
> When I look in the dependent module's
> target\maven-shared-archive-resources\WEB-INF directory, there is  
> nothing
> there - no web.xml file.  Any ideas?
>
> Cheers,
>
> Les
>
> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl  
> <jv...@sonatype.com>wrote:
>
>> The remote-resources-plugin. This is exactly how we share license  
>> templates
>> across projects. So if you have a web.xml template you want to be  
>> used
>> across many projects I would take a look at  ^^^^^^^^
>>
>>
>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>
>> I have a webapp that can be deployed as one .war (development) or  
>> as two
>>> separate .war files (production w/ firewall in between the two).   
>>> I have 3
>>> web modules to reflect this.
>>>
>>> web-colocated
>>> web-front
>>> web-back
>>>
>>> The web.xml file for each .war is nearly identical, save the  
>>> spring files
>>> listed to start up an ApplicationContext in each .war.
>>>
>>> How can I share a single web.xml file across all 3, but filter in
>>> different
>>> values for the comma-delimited spring file list based on profile?   
>>> Where
>>> would that master "template" web.xml file live?  Or is there  
>>> another way
>>> to
>>> go about this?
>>>
>>> Thanks,
>>>
>>> Les
>>>
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>> A party which is not afraid of letting culture,
>> business, and welfare go to ruin completely can
>> be omnipotent for a while.
>>
>> -- Jakob Burckhardt
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

Three may keep a secret if two of them are dead.

  -- Benjamin Franklin


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


Re: Profiles & Filters - sharing common config

Posted by Jason van Zyl <jv...@sonatype.com>.
Let me try and whip something up.

On 26-Feb-09, at 4:35 PM, Les Hazlewood wrote:

> Hi all,
>
> I'm having a hell of a time getting this to work with web.xml  
> files.  Is
> there an example I can look at that produces a bundle and then  
> consumes
> one?  If there are any uses of this where the template file is an  
> XML file,
> that'd be really useful.
>
> I'm trying to do this using a web.xml file as the 'template' to be  
> exported
> to other modules.  Here is what I have so far:
>
> === Creating the bundle (source module) ===
> <plugin>
>  <artifactId>maven-remote-resources-plugin</artifactId>
>  <executions>
>    <execution>
>      <goals>
>        <goal>bundle</goal>
>      </goals>
>      <configuration>
>        <resourcesDirectory>${basedir}/src/main/webapp</ 
> resourcesDirectory>
>        <includes>
>          <param>**/*.xml</param>
>        </includes>
>      </configuration>
>    </execution>
>  </executions>
> </plugin>
>
> == Consuming the bundle (dependent module) ==
> <plugin>
>  <artifactId>maven-remote-resources-plugin</artifactId>
>  <executions>
>    <execution>
>      <goals>
>        <goal>process</goal>
>      </goals>
>      <configuration>
>        <resourceBundles>
>
> <resourceBundle>${project.groupId}:moduleName:${project.version}</ 
> resourceBundle>
>        </resourceBundles>
>      </configuration>
>    </execution>
>  </executions>
> </plugin>
>
> When I look in the dependent module's
> target\maven-shared-archive-resources\WEB-INF directory, there is  
> nothing
> there - no web.xml file.  Any ideas?
>
> Cheers,
>
> Les
>
> On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl  
> <jv...@sonatype.com>wrote:
>
>> The remote-resources-plugin. This is exactly how we share license  
>> templates
>> across projects. So if you have a web.xml template you want to be  
>> used
>> across many projects I would take a look at  ^^^^^^^^
>>
>>
>> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>>
>> I have a webapp that can be deployed as one .war (development) or  
>> as two
>>> separate .war files (production w/ firewall in between the two).   
>>> I have 3
>>> web modules to reflect this.
>>>
>>> web-colocated
>>> web-front
>>> web-back
>>>
>>> The web.xml file for each .war is nearly identical, save the  
>>> spring files
>>> listed to start up an ApplicationContext in each .war.
>>>
>>> How can I share a single web.xml file across all 3, but filter in
>>> different
>>> values for the comma-delimited spring file list based on profile?   
>>> Where
>>> would that master "template" web.xml file live?  Or is there  
>>> another way
>>> to
>>> go about this?
>>>
>>> Thanks,
>>>
>>> Les
>>>
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>> A party which is not afraid of letting culture,
>> business, and welfare go to ruin completely can
>> be omnipotent for a while.
>>
>> -- Jakob Burckhardt
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

What matters is not ideas, but the people who have them. Good people  
can fix bad ideas, but good ideas can't save bad people.

  -- Paul Graham


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


Re: Profiles & Filters - sharing common config

Posted by Les Hazlewood <le...@hazlewood.com>.
Hi all,

I'm having a hell of a time getting this to work with web.xml files.  Is
there an example I can look at that produces a bundle and then consumes
one?  If there are any uses of this where the template file is an XML file,
that'd be really useful.

I'm trying to do this using a web.xml file as the 'template' to be exported
to other modules.  Here is what I have so far:

=== Creating the bundle (source module) ===
<plugin>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>bundle</goal>
      </goals>
      <configuration>
        <resourcesDirectory>${basedir}/src/main/webapp</resourcesDirectory>
        <includes>
          <param>**/*.xml</param>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin>

== Consuming the bundle (dependent module) ==
<plugin>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <resourceBundles>

<resourceBundle>${project.groupId}:moduleName:${project.version}</resourceBundle>
        </resourceBundles>
      </configuration>
    </execution>
  </executions>
</plugin>

When I look in the dependent module's
target\maven-shared-archive-resources\WEB-INF directory, there is nothing
there - no web.xml file.  Any ideas?

Cheers,

Les

On Thu, Feb 26, 2009 at 10:31 AM, Jason van Zyl <jv...@sonatype.com>wrote:

> The remote-resources-plugin. This is exactly how we share license templates
> across projects. So if you have a web.xml template you want to be used
> across many projects I would take a look at  ^^^^^^^^
>
>
> On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:
>
>  I have a webapp that can be deployed as one .war (development) or as two
>> separate .war files (production w/ firewall in between the two).  I have 3
>> web modules to reflect this.
>>
>> web-colocated
>> web-front
>> web-back
>>
>> The web.xml file for each .war is nearly identical, save the spring files
>> listed to start up an ApplicationContext in each .war.
>>
>> How can I share a single web.xml file across all 3, but filter in
>> different
>> values for the comma-delimited spring file list based on profile?  Where
>> would that master "template" web.xml file live?  Or is there another way
>> to
>> go about this?
>>
>> Thanks,
>>
>> Les
>>
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
> A party which is not afraid of letting culture,
> business, and welfare go to ruin completely can
> be omnipotent for a while.
>
>  -- Jakob Burckhardt
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Profiles & Filters - sharing common config

Posted by Jason van Zyl <jv...@sonatype.com>.
The remote-resources-plugin. This is exactly how we share license  
templates across projects. So if you have a web.xml template you want  
to be used across many projects I would take a look at  ^^^^^^^^

On 25-Feb-09, at 4:33 PM, Les Hazlewood wrote:

> I have a webapp that can be deployed as one .war (development) or as  
> two
> separate .war files (production w/ firewall in between the two).  I  
> have 3
> web modules to reflect this.
>
> web-colocated
> web-front
> web-back
>
> The web.xml file for each .war is nearly identical, save the spring  
> files
> listed to start up an ApplicationContext in each .war.
>
> How can I share a single web.xml file across all 3, but filter in  
> different
> values for the comma-delimited spring file list based on profile?   
> Where
> would that master "template" web.xml file live?  Or is there another  
> way to
> go about this?
>
> Thanks,
>
> Les

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------

A party which is not afraid of letting culture,
business, and welfare go to ruin completely can
be omnipotent for a while.

   -- Jakob Burckhardt


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