You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by aemm <am...@gmv.com> on 2007/06/13 11:13:17 UTC

Using profiles in a webapp

Hi! I'm a newbie in the utilization of Maven. 

I'm developing a webapp (with Spring) and I want to include profiles in my
app. This profiles will change de jdbc connection settings depending on
which profile I select.

Let's explain my problem.

I have jdbc.properties in ${project.root}\src\main\webapp\WEB-INF, and looks
like that

---------------------------------------------------------------------------------
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=${jdbc.url}
jdbc.username=${jdbc.username}
jdbc.password=${jdbc.password}

hibernate.dialect=${jdbc.dialect}
---------------------------------------------------------------------------------

When I deploy the application (make de war file with the "package" option)
the profile don't convert the labels in this file to the corresponding
values.

Anybody can help me?

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Using-profiles-in-a-webapp-tf3913491s177.html#a11095685
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Using profiles in a webapp

Posted by aemm <am...@gmv.com>.
Thanks!!

Perfect :computer-user:



Kristian Nordal wrote:
> 
> Hi,
> 
> Use the the "provided" scope on your dependencies.
> 
> --
> Cheers,
> Kristian
> 
> On 6/14/07, aemm <am...@gmv.com> wrote:
>>
>> it works!!!! Thanks a lot.
>>
>> another question: I want to exclude de /lib directory containing all the
>> jar's when I create de .war file to deploy in the server, because the
>> instance where I deploy my application already have a classpath
>> containing
>> all the libraries requiered.
>>
>> any idea? any solution?
>>
>> Thanks.
>>
>>
>>
>> Arnaud Bailly-3 wrote:
>> >
>> > aemm <am...@gmv.com> writes:
>> >
>> >> Hi! I'm a newbie in the utilization of Maven.
>> >>
>> >> I'm developing a webapp (with Spring) and I want to include profiles
>> in
>> >> my
>> >> app. This profiles will change de jdbc connection settings depending
>> on
>> >> which profile I select.
>> >>
>> >> Let's explain my problem.
>> >>
>> >> I have jdbc.properties in ${project.root}\src\main\webapp\WEB-INF,
>> >> and looks
>> >
>> > You need to configure the maven-war-plugin to do filtering and files
>> > in src/main/webapp are not filtered.
>> >
>> >
>> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
>> >
>> > BTW, this is not profile-specfic.
>> > 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
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Using-profiles-in-a-webapp-tf3913491s177.html#a11116169
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-profiles-in-a-webapp-tf3913491s177.html#a11121519
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Using profiles in a webapp

Posted by Kristian Nordal <kr...@gmail.com>.
Hi,

Use the the "provided" scope on your dependencies.

--
Cheers,
Kristian

On 6/14/07, aemm <am...@gmv.com> wrote:
>
> it works!!!! Thanks a lot.
>
> another question: I want to exclude de /lib directory containing all the
> jar's when I create de .war file to deploy in the server, because the
> instance where I deploy my application already have a classpath containing
> all the libraries requiered.
>
> any idea? any solution?
>
> Thanks.
>
>
>
> Arnaud Bailly-3 wrote:
> >
> > aemm <am...@gmv.com> writes:
> >
> >> Hi! I'm a newbie in the utilization of Maven.
> >>
> >> I'm developing a webapp (with Spring) and I want to include profiles in
> >> my
> >> app. This profiles will change de jdbc connection settings depending on
> >> which profile I select.
> >>
> >> Let's explain my problem.
> >>
> >> I have jdbc.properties in ${project.root}\src\main\webapp\WEB-INF,
> >> and looks
> >
> > You need to configure the maven-war-plugin to do filtering and files
> > in src/main/webapp are not filtered.
> >
> > http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> >
> > BTW, this is not profile-specfic.
> > 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
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Using-profiles-in-a-webapp-tf3913491s177.html#a11116169
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Using profiles in a webapp

Posted by aemm <am...@gmv.com>.
it works!!!! Thanks a lot.

another question: I want to exclude de /lib directory containing all the
jar's when I create de .war file to deploy in the server, because the
instance where I deploy my application already have a classpath containing
all the libraries requiered.

any idea? any solution?

Thanks.



Arnaud Bailly-3 wrote:
> 
> aemm <am...@gmv.com> writes:
> 
>> Hi! I'm a newbie in the utilization of Maven. 
>>
>> I'm developing a webapp (with Spring) and I want to include profiles in
>> my
>> app. This profiles will change de jdbc connection settings depending on
>> which profile I select.
>>
>> Let's explain my problem.
>>
>> I have jdbc.properties in ${project.root}\src\main\webapp\WEB-INF,
>> and looks
> 
> You need to configure the maven-war-plugin to do filtering and files
> in src/main/webapp are not filtered. 
> 
> http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html
> 
> BTW, this is not profile-specfic.
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-profiles-in-a-webapp-tf3913491s177.html#a11116169
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Using profiles in a webapp

Posted by Arnaud Bailly <ab...@oqube.com>.
aemm <am...@gmv.com> writes:

> Hi! I'm a newbie in the utilization of Maven. 
>
> I'm developing a webapp (with Spring) and I want to include profiles in my
> app. This profiles will change de jdbc connection settings depending on
> which profile I select.
>
> Let's explain my problem.
>
> I have jdbc.properties in ${project.root}\src\main\webapp\WEB-INF,
> and looks

You need to configure the maven-war-plugin to do filtering and files
in src/main/webapp are not filtered. 

http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html

BTW, this is not profile-specfic.
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