You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Coleman <jo...@eurobase-international.com> on 2007/07/26 12:54:45 UTC

resources as dependencies

Hi,

 

We want to farm off some of our common resources (java scripts and
images) into a project that other projects can use as a dependency.

 

Does Maven2 have a way of getting such dependencies into a resources
phase?

 

Regards,

John


Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. 

Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited.  If you receive this transmission in error, please notify us immediately, and then delete this E-mail. 

Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments.

Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK.


RE: resources as dependencies

Posted by John Coleman <jo...@eurobase-international.com>.
Hi,

Yes that does the right kind of thing, was thinking of using
dependency:unpack. However, I'd like to use a zip file instead of JAR.
But nevermind. It looks like it can deal with Java source. Not quiet
what I want, but maybe it can be used anyway.

Thanks,
John

-----Original Message-----
From: John Patrick [mailto:nhoj.patrick@gmail.com] 
Sent: 26 July 2007 12:30
To: Maven Users List
Subject: Re: resources as dependencies

Initial thoughts are you could have it as a seperate project and get the
dependency plugin to unpack it.
http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html

On 26/07/07, John Coleman <jo...@eurobase-international.com>
wrote:
>
> Hi,
>
>
>
> We want to farm off some of our common resources (java scripts and
> images) into a project that other projects can use as a dependency.
>
>
>
> Does Maven2 have a way of getting such dependencies into a resources
> phase?
>
>
>
> Regards,
>
> John
>
>
> Eurobase International Limited and its subsidiaries (Eurobase) are
unable
> to exercise control over the content of information in E-Mails. Any
views
> and opinions expressed may be personal to the sender and are not
necessarily
> those of Eurobase. Eurobase will not enter into any contractual
obligations
> in respect of any part of its business in any E-mail.
>
> Privileged / confidential information may be contained in this message
and
> /or any attachments. This E-mail is intended for the use of the
addressee(s)
> only and may contain confidential information. If you are not the / an
> intended recipient, you are hereby notified that any use or
dissemination of
> this communication is strictly prohibited.  If you receive this
transmission
> in error, please notify us immediately, and then delete this E-mail.
>
> Neither the sender nor Eurobase accepts any liability whatsoever for
any
> defects of any kind either in or arising from this E-mail
transmission.
> E-Mail transmission cannot be guaranteed to be secure or error-free,
as
> messages can be intercepted, lost, corrupted, destroyed, contain
viruses, or
> arrive late or incomplete. Eurobase does not accept any responsibility
for
> viruses and it is your responsibility to scan any attachments.
>
> Eurobase Systems Limited is the main trading company in the Eurobase
> International Group; registered in England and Wales as company number
> 02251162; registered address: Essex House, 2 County Place, Chelmsford,
Essex
> CM2 0RE, UK.
>
>

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


Re: resources as dependencies

Posted by John Patrick <nh...@gmail.com>.
Initial thoughts are you could have it as a seperate project and get the
dependency plugin to unpack it.
http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html

On 26/07/07, John Coleman <jo...@eurobase-international.com> wrote:
>
> Hi,
>
>
>
> We want to farm off some of our common resources (java scripts and
> images) into a project that other projects can use as a dependency.
>
>
>
> Does Maven2 have a way of getting such dependencies into a resources
> phase?
>
>
>
> Regards,
>
> John
>
>
> Eurobase International Limited and its subsidiaries (Eurobase) are unable
> to exercise control over the content of information in E-Mails. Any views
> and opinions expressed may be personal to the sender and are not necessarily
> those of Eurobase. Eurobase will not enter into any contractual obligations
> in respect of any part of its business in any E-mail.
>
> Privileged / confidential information may be contained in this message and
> /or any attachments. This E-mail is intended for the use of the addressee(s)
> only and may contain confidential information. If you are not the / an
> intended recipient, you are hereby notified that any use or dissemination of
> this communication is strictly prohibited.  If you receive this transmission
> in error, please notify us immediately, and then delete this E-mail.
>
> Neither the sender nor Eurobase accepts any liability whatsoever for any
> defects of any kind either in or arising from this E-mail transmission.
> E-Mail transmission cannot be guaranteed to be secure or error-free, as
> messages can be intercepted, lost, corrupted, destroyed, contain viruses, or
> arrive late or incomplete. Eurobase does not accept any responsibility for
> viruses and it is your responsibility to scan any attachments.
>
> Eurobase Systems Limited is the main trading company in the Eurobase
> International Group; registered in England and Wales as company number
> 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex
> CM2 0RE, UK.
>
>

Re: resources as dependencies

Posted by Arnaud Bailly <ab...@oqube.com>.
"John Coleman" <jo...@eurobase-international.com> writes:

> The web.xml in the dependency war does seem to be ignored so this is
> quite a neat solution. :)
>
> We are using this to provide a library of resources all our web
> applications can draw from.
>
> I still don't have a good answer on how to do what I call client
> flavours. The client may need to have tweaked js, their own images and
> properties files instead of plain-vanilla.
>
> I don't see this as fitting the dependency concept very well - because
> we really need a switch at build time to control which set of assets
> to incorporate. The main nasty occurs if we have tweaked scripts
> because ideally we don't want to clone large pieces of script, just
> for small client tweaks. This is particularly unpleasant in terms of
> vcs. What we really need is all the tweaks to be parameterised in some
> way so they work like components and can be snapped in.
>
> We may have to create our own "flavour" plugin. Is there a way to have
> resource directories in the Maven project that are ignored by default,
> and then switch a selected one on to merge into the target? Possibly
> we might have a properties file that tells Maven to ignore certain
> resource directories? I don't really want to config this inside the
> POM.
>

What I did was the following:
 - define the filter file to use as a property 
 - define profiles for the different flavo(u)rs, each setting its own
   dependencies 
 - at build time, choose profile and set the filter file(s)
   properties so that they correspond to the 'flavour' you build. 

I did this to build three different web apps:
 1. one with the real business layer and addresses
 2. one with the test dao layer 
 3. one with a mock business layer

out of the same presentation layer.

Regards,
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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


RE: resources as dependencies

Posted by John Coleman <jo...@eurobase-international.com>.
The web.xml in the dependency war does seem to be ignored so this is quite a neat solution. :)

We are using this to provide a library of resources all our web applications can draw from.

I still don't have a good answer on how to do what I call client flavours. The client may need to have tweaked js, their own images and properties files instead of plain-vanilla.

I don't see this as fitting the dependency concept very well - because we really need a switch at build time to control which set of assets to incorporate. The main nasty occurs if we have tweaked scripts because ideally we don't want to clone large pieces of script, just for small client tweaks. This is particularly unpleasant in terms of vcs. What we really need is all the tweaks to be parameterised in some way so they work like components and can be snapped in.

We may have to create our own "flavour" plugin. Is there a way to have resource directories in the Maven project that are ignored by default, and then switch a selected one on to merge into the target? Possibly we might have a properties file that tells Maven to ignore certain resource directories? I don't really want to config this inside the POM.

John


-----Original Message-----
From: Arnaud Bailly [mailto:abailly@oqube.com] 
Sent: 26 July 2007 17:11
To: Maven Users List
Subject: Re: resources as dependencies

"John Coleman" <jo...@eurobase-international.com> writes:

> Hi,
>
> The Maven war packaging forces me to have a web.xml which is not
> required in the dependency project. Perhaps I can switch that off? I

Hi John, 
Yes, It seems so. But it is not used in overlays and you can control 
it so this is not big deal. 
(see
http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html) 


> just want to pack generic script and images up for web projects. Or
> will my project web.xml simply overrule the dependency web.xml?
>

BTW, I used this in a real world project together with profiles to
generate different flavors of the same application.

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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


Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. 

Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited.  If you receive this transmission in error, please notify us immediately, and then delete this E-mail. 

Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments.

Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK.


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


Re: resources as dependencies

Posted by Arnaud Bailly <ab...@oqube.com>.
"John Coleman" <jo...@eurobase-international.com> writes:

> Hi,
>
> The Maven war packaging forces me to have a web.xml which is not
> required in the dependency project. Perhaps I can switch that off? I

Hi John, 
Yes, It seems so. But it is not used in overlays and you can control 
it so this is not big deal. 
(see
http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html) 


> just want to pack generic script and images up for web projects. Or
> will my project web.xml simply overrule the dependency web.xml?
>

BTW, I used this in a real world project together with profiles to
generate different flavors of the same application.

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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


RE: resources as dependencies

Posted by John Coleman <jo...@eurobase-international.com>.
Hi,

The Maven war packaging forces me to have a web.xml which is not required in the dependency project. Perhaps I can switch that off? I just want to pack generic script and images up for web projects. Or will my project web.xml simply overrule the dependency web.xml?

John

-----Original Message-----
From: Arnaud Bailly [mailto:abailly@oqube.com] 
Sent: 26 July 2007 14:02
To: Maven Users List
Subject: Re: resources as dependencies

"John Coleman" <jo...@eurobase-international.com> writes:

> Hi,
>
>  
>
> We want to farm off some of our common resources (java scripts and
> images) into a project that other projects can use as a dependency.
>
>  

Hello,
If you are using wars, then you could you use the war overlay
capability of maven: Just add a war dependency to another war and the
first one will 'overlaid' over the second. 

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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


Eurobase International Limited and its subsidiaries (Eurobase) are unable to exercise control over the content of information in E-Mails. Any views and opinions expressed may be personal to the sender and are not necessarily those of Eurobase. Eurobase will not enter into any contractual obligations in respect of any part of its business in any E-mail. 

Privileged / confidential information may be contained in this message and /or any attachments. This E-mail is intended for the use of the addressee(s) only and may contain confidential information. If you are not the / an intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited.  If you receive this transmission in error, please notify us immediately, and then delete this E-mail. 

Neither the sender nor Eurobase accepts any liability whatsoever for any defects of any kind either in or arising from this E-mail transmission. E-Mail transmission cannot be guaranteed to be secure or error-free, as messages can be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or incomplete. Eurobase does not accept any responsibility for viruses and it is your responsibility to scan any attachments.

Eurobase Systems Limited is the main trading company in the Eurobase International Group; registered in England and Wales as company number 02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex CM2 0RE, UK.


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


Re: resources as dependencies

Posted by Arnaud Bailly <ab...@oqube.com>.
"John Coleman" <jo...@eurobase-international.com> writes:

> Hi,
>
>  
>
> We want to farm off some of our common resources (java scripts and
> images) into a project that other projects can use as a dependency.
>
>  

Hello,
If you are using wars, then you could you use the war overlay
capability of maven: Just add a war dependency to another war and the
first one will 'overlaid' over the second. 

HTH
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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