You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dušan Rychnovský <ge...@gmail.com> on 2012/07/13 19:56:46 UTC

Artifact with external configuration - the Maven way

Hi!

I'm using Maven at work to organize my software projects. I will first of
all describe you my current build process.

-------------------------------------------------------------------------------------------------------------------------


The typical deployment assembly contains at least:

 - the application JAR file,
 - a JAR file for every dependency,
 - an application configuration file (an XML file with an XSD schema file),
 - Log4J configuration file (a single XML file).

It is important that the application configuration file is not packaged
inside the application JAR file - I could not change configuration in
production otherwise.

The Maven assembly plugin is used to package all those files into a single
ZIP to allow convenient deploy at the target machine.

-------------------------------------------------------------------------------------------------------------------------

For every environment (e.g. development, test, acceptance, production)
there is a single Maven profile. The configuration files contain property
placeholders. When building the assembly, the values of properties used in
the configuration files (e.g. the default configuration values) are
resolved according to the active profile.

-------------------------------------------------------------------------------------------------------------------------


The question I have is how to store the builds to be available for
deployment - so that I don't have to build the project every time I need to
deploy the application to a new machine. To my understanding, a Nexus
repository is typically used for that. I have found out though that a Maven
repository is only capable of storing simple artifacts, not ZIP assemblies.

I am convinced that there are plenty of projects that need external
configuration files in addition to the application JARs. What is the
commonly used way to handle my issue?

Thank you in advance for all replies.

Dusan R.

Re: Artifact with external configuration - the Maven way

Posted by Aliaksei Lahachou <al...@gmail.com>.
Hello,

Maven repository may contain anything, you just have to set appropriate
classifier and type/packaging. I never deployed zip archives using Maven
plugins, but I often upload zips to our company Nexus using web-front.


Regards,
htfv (Aliaksei Lahachou)


On Fri, Jul 13, 2012 at 7:56 PM, Dušan Rychnovský <ge...@gmail.com>wrote:

> Hi!
>
> I'm using Maven at work to organize my software projects. I will first of
> all describe you my current build process.
>
>
> -------------------------------------------------------------------------------------------------------------------------
>
>
> The typical deployment assembly contains at least:
>
>  - the application JAR file,
>  - a JAR file for every dependency,
>  - an application configuration file (an XML file with an XSD schema file),
>  - Log4J configuration file (a single XML file).
>
> It is important that the application configuration file is not packaged
> inside the application JAR file - I could not change configuration in
> production otherwise.
>
> The Maven assembly plugin is used to package all those files into a single
> ZIP to allow convenient deploy at the target machine.
>
>
> -------------------------------------------------------------------------------------------------------------------------
>
> For every environment (e.g. development, test, acceptance, production)
> there is a single Maven profile. The configuration files contain property
> placeholders. When building the assembly, the values of properties used in
> the configuration files (e.g. the default configuration values) are
> resolved according to the active profile.
>
>
> -------------------------------------------------------------------------------------------------------------------------
>
>
> The question I have is how to store the builds to be available for
> deployment - so that I don't have to build the project every time I need to
> deploy the application to a new machine. To my understanding, a Nexus
> repository is typically used for that. I have found out though that a Maven
> repository is only capable of storing simple artifacts, not ZIP assemblies.
>
> I am convinced that there are plenty of projects that need external
> configuration files in addition to the application JARs. What is the
> commonly used way to handle my issue?
>
> Thank you in advance for all replies.
>
> Dusan R.
>