You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Richardson, Simon (Treasury)" <Si...@hbosts.com> on 2005/10/06 15:01:20 UTC

M1 - More than 1 artefact

I would like the ability to create more than 1 artefact from a single
project.xml file.

 

The project structure would resemble the following:

 

+---src

|   +---java

|   |   \---com

|   |       \---hbosts

|   |           \---ss

|   +---test

|   |   \---com

|   |       \---hbosts

|   |           \---ss

|   \---conf

|       +---uat

|       +---dev

|       \---prod

 

 

I would like 3 jar files:

 

App-dev.jar

App-uat.jar

App-prod.jar

 

Where the App-[env].jar file would contain configuration from src/conf/[env]
and no other src/conf directory.

 

I understand the underlying philosophy is 1 pom 1 artefact but I'm sure that
others must have come across similar problems and worked round them.

 

Regards

 

Simon

 

Simon Richardson
Technology
Tel: 020 7574 8838
E Mail: simonrichardson2@hbosts.com <ma...@hbosts.com> 

 

HBOS Treasury Services plc
33 Old Broad Street
London
EC2N 1HZ

 


"MMS <hbosplc.com>" made the following annotations.
------------------------------------------------------------------------------
For more information on HBOS Treasury Services, please visit http://www.HBOSTS.com

Or for details of our online FX & Deposit services, please go to http://www.HBOSdeal.com

HBOS Treasury Services plc is part of the HBOS Group, which also includes Halifax plc and Bank of Scotland.
Registered Office: 33 Old Broad Street, London EC2N 1HZ. Registered No. 2692890. Registered in England.
Authorised and regulated by the Financial Services Authority.

The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error or there are any problems please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. This mail and any attachments have been scanned for viruses prior to leaving the HBOS Treasury Services plc network. HBOS Treasury Services plc will not be liable for direct, special, indirect or consequential damages arising from alteration of the contents of this message by a third party or as a result of any virus being passed on.

HBOS Treasury Services plc reserves the right to monitor and record e-mail messages sent to and from this address for the purposes of investigating or detecting any unauthorised use of its system and ensuring its effective operation.
==============================================================================

Re: M1 - More than 1 artefact

Posted by Bent André Solheim <be...@gmail.com>.
Hi Simon,

yes I have encountered the same problem, and the technique we used
where I work, was to have three projects. One for each artifact. We
prefixed the uat project uat_ and the prod project prod_. These two
projects inherts from the dev-project (which we didn't prefix). We set
the source folders in the two extended projects to the same folders as
the development ones. We set the configuration/resource folders to be
the ones in the extended projects.

This way the extended projects use the source code from the
development project, but it's own configuration and resource files.

The unprefixed development project contains resources and
configuration files for development.

This works very well for us, even considering the added complexity of
more projects since we only use this technique on projects that
produces deployable artifacts (webapps and such).


Hope this helps.

Best regards
Bent André Solheim

On 10/6/05, Richardson, Simon (Treasury) <Si...@hbosts.com> wrote:
> I would like the ability to create more than 1 artefact from a single
> project.xml file.
>
>
>
> The project structure would resemble the following:
>
>
>
> +---src
>
> |   +---java
>
> |   |   \---com
>
> |   |       \---hbosts
>
> |   |           \---ss
>
> |   +---test
>
> |   |   \---com
>
> |   |       \---hbosts
>
> |   |           \---ss
>
> |   \---conf
>
> |       +---uat
>
> |       +---dev
>
> |       \---prod
>
>
>
>
>
> I would like 3 jar files:
>
>
>
> App-dev.jar
>
> App-uat.jar
>
> App-prod.jar
>
>
>
> Where the App-[env].jar file would contain configuration from src/conf/[env]
> and no other src/conf directory.
>
>
>
> I understand the underlying philosophy is 1 pom 1 artefact but I'm sure that
> others must have come across similar problems and worked round them.
>
>
>
> Regards
>
>
>
> Simon
>
>
>
> Simon Richardson
> Technology
> Tel: 020 7574 8838
> E Mail: simonrichardson2@hbosts.com <ma...@hbosts.com>
>
>
>
> HBOS Treasury Services plc
> 33 Old Broad Street
> London
> EC2N 1HZ
>
>
>
>
> "MMS <hbosplc.com>" made the following annotations.
> ------------------------------------------------------------------------------
> For more information on HBOS Treasury Services, please visit http://www.HBOSTS.com
>
> Or for details of our online FX & Deposit services, please go to http://www.HBOSdeal.com
>
> HBOS Treasury Services plc is part of the HBOS Group, which also includes Halifax plc and Bank of Scotland.
> Registered Office: 33 Old Broad Street, London EC2N 1HZ. Registered No. 2692890. Registered in England.
> Authorised and regulated by the Financial Services Authority.
>
> The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error or there are any problems please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. This mail and any attachments have been scanned for viruses prior to leaving the HBOS Treasury Services plc network. HBOS Treasury Services plc will not be liable for direct, special, indirect or consequential damages arising from alteration of the contents of this message by a third party or as a result of any virus being passed on.
>
> HBOS Treasury Services plc reserves the right to monitor and record e-mail messages sent to and from this address for the purposes of investigating or detecting any unauthorised use of its system and ensuring its effective operation.
> ==============================================================================
>
>

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


Re: M1 - More than 1 artefact

Posted by Graham King <gr...@darkcoding.net>.
  Simon,

  We have the same problem. We use one project but three 
build.properties files (build.dev.properties, build.uat.properties and 
build.live.properties).

  In maven.xml we have three top level goals 'dev', 'uat' and 'live', 
which source the right properties file. We then use those properties as 
tokens to replace in files and to select files to copy to the target 
directory.
  For example the build.{env}.properties file would define both 
'tomcat.home' and 'log4j.properties.file', and then we would do:

       <ant:filter token="tomcat.home" value="${tomcat.home}" />
       <ant:copy file="${maven.src.dir}/conf/${log4j.properties.file}" 
 
tofile="${maven.war.webapp.dir}/WEB-INF/classes/log4j.properties" 
overwrite="true" filtering="true" />

   this puts the right log4j file, with the right paths, in to the 
webapp directory, before the war is built.

  I'm not sure this is the best way to do it, and I would love to hear 
how other people have done it. I like Bent André Solheim's solution as well.

  Is there a canonical way to do this ? Every significant project must 
have the same issue.

  All the best,
  Graham.

Richardson, Simon (Treasury) wrote:
> I would like the ability to create more than 1 artefact from a single
> project.xml file.
> 
> 
> Where the App-[env].jar file would contain configuration from src/conf/[env]
> and no other src/conf directory.
> 
>  
> 
> I understand the underlying philosophy is 1 pom 1 artefact but I'm sure that
> others must have come across similar problems and worked round them.
> 
>  
> 
> Regards
> 
>  
> 
> Simon
> 
>  
> 
> Simon Richardson
> Technology
> Tel: 020 7574 8838
> E Mail: simonrichardson2@hbosts.com <ma...@hbosts.com> 
> 
>  
> 
> HBOS Treasury Services plc
> 33 Old Broad Street
> London
> EC2N 1HZ
> 
>  
> 
> 
> "MMS <hbosplc.com>" made the following annotations.
> ------------------------------------------------------------------------------
> For more information on HBOS Treasury Services, please visit http://www.HBOSTS.com
> 
> Or for details of our online FX & Deposit services, please go to http://www.HBOSdeal.com
> 
> HBOS Treasury Services plc is part of the HBOS Group, which also includes Halifax plc and Bank of Scotland.
> Registered Office: 33 Old Broad Street, London EC2N 1HZ. Registered No. 2692890. Registered in England.
> Authorised and regulated by the Financial Services Authority.
> 
> The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error or there are any problems please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. This mail and any attachments have been scanned for viruses prior to leaving the HBOS Treasury Services plc network. HBOS Treasury Services plc will not be liable for direct, special, indirect or consequential damages arising from alteration of the contents of this message by a third party or as a result of any virus being passed on.
> 
> HBOS Treasury Services plc reserves the right to monitor and record e-mail messages sent to and from this address for the purposes of investigating or detecting any unauthorised use of its system and ensuring its effective operation.
> ==============================================================================
> 

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


RE: M1 - More than 1 artefact

Posted by Mattias Olofsson <ma...@xdin.com>.
I think it is easier to make these as separate projects and they all depends
on the App.jar artifact.
The App.jar artifact does not contains ANY configurations for a environment,
it is stored in the separate 
projects like this:
(
These projects takes the App.jar 
file and add the properties etc 
for that env and produces App-XXX.jar artifact
)


dev
   |	
   +---src
	
	|   
	
	|   
	
	|  
	
	|  
	
	|   +---test
	
	|   |   \---com
	
	|   |       \---hbosts
	
	|   |           \---ss
	
	|   \---conf
	
	|       app.properties   for dev

uat
   |	
   +---src
	
	|   
	
	|   
	
	|  
	
	|  
	
	|   +---test
	
	|   |   \---com
	
	|   |       \---hbosts
	
	|   |           \---ss
	
	|   \---conf
	
	|       app.properties   for uat

prod
   |	
   +---src
	
	|   
	
	|   
	
	|  
	
	|  
	
	|   +---test
	
	|   |   \---com
	
	|   |       \---hbosts
	
	|   |           \---ss
	
	|   \---conf
	
	|       app.properties   for prod



 


Mvh 

Mattias Olofsson

Software Developer, M. Sc. Physics 

 

XDIN AB
Gustaf Werners gata 12
SE-421 32 Västra Frölunda
Office: +46 (0)31 725 10 92
mail: mattias.olofsson@xdin.com   
 
This e-mail is confidential and may also be legally privileged.
If you are not the intended recipient, please notify us
immediately; you should not copy it or use it for any purpose,
nor disclose its contents to any other person.         

-----Original Message-----
From: Richardson, Simon (Treasury) [mailto:SimonRichardson2@hbosts.com] 
Sent: den 6 oktober 2005 15:01
To: 'Maven Users List'
Subject: M1 - More than 1 artefact

I would like the ability to create more than 1 artefact from a single
project.xml file.

 

The project structure would resemble the following:

 

+---src

|   +---java

|   |   \---com

|   |       \---hbosts

|   |           \---ss

|   +---test

|   |   \---com

|   |       \---hbosts

|   |           \---ss

|   \---conf

|       +---uat

|       +---dev

|       \---prod

 

 

I would like 3 jar files:

 

App-dev.jar

App-uat.jar

App-prod.jar

 

Where the App-[env].jar file would contain configuration from src/conf/[env]
and no other src/conf directory.

 

I understand the underlying philosophy is 1 pom 1 artefact but I'm sure that
others must have come across similar problems and worked round them.

 

Regards

 

Simon

 

Simon Richardson
Technology
Tel: 020 7574 8838
E Mail: simonrichardson2@hbosts.com <ma...@hbosts.com> 

 

HBOS Treasury Services plc
33 Old Broad Street
London
EC2N 1HZ

 


"MMS <hbosplc.com>" made the following annotations.
----------------------------------------------------------------------------
--

For more information on HBOS Treasury Services, please visit
http://www.HBOSTS.com

Or for details of our online FX & Deposit services, please go to
http://www.HBOSdeal.com

HBOS Treasury Services plc is part of the HBOS Group, which also includes
Halifax plc and Bank of Scotland.
Registered Office: 33 Old Broad Street, London EC2N 1HZ. Registered No.
2692890. Registered in England.
Authorised and regulated by the Financial Services Authority.

The information contained in this message is confidential and is intended
for the addressee only. If you have received this message in error or there
are any problems please notify the originator immediately. The unauthorised
use, disclosure, copying or alteration of this message is strictly
forbidden. This mail and any attachments have been scanned for viruses prior
to leaving the HBOS Treasury Services plc network. HBOS Treasury Services
plc will not be liable for direct, special, indirect or consequential
damages arising from alteration of the contents of this message by a third
party or as a result of any virus being passed on.

HBOS Treasury Services plc reserves the right to monitor and record e-mail
messages sent to and from this address for the purposes of investigating or
detecting any unauthorised use of its system and ensuring its effective
operation.
============================================================================
==


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