so what is best practice here?

even my exclude statemnt doesn't help as i thought. If i run "production" 
profile after development profile without mvn clean i don't get the right 
version. thats all much too difficult in my opinion. 

regards
Janning

Am Dienstag, 12. Februar 2008 05:03 schrieb Clifton:
> I'll respond by saying there is no garaunteed order of operations with
> resource copying (as well as other actions that take place within the same
> build phase). Your pom states that both resources from development and
> production should be considered when the env property is set to
> development. (Incidentally you could more easily take a "-P development"
> switch on the cmd line to activate the dev profile. I'd only suggest
> property activation when you have something like an external script that
> will automatically set the property. Otherwise it's slightly less work to
> call the profile outright.) When considering resources from two locations
> there is no garauntee that on set of resources will overwrite the other.
> Profiles aren't meant to establish/imply fine grained execution order. What
> you really should do is conditionally include your prod resources for only
> production profiles. There is a much bigger problem of mixing dev and
> production resources in a build. If there are common resources between the
> two then the dir structure should be changed to reflect that.
>
> mljv wrote:
> > sorry, i clicked send to early... so here is my full post:
> >
> > Hi,
> >
> > i am struggeling with profiles and resources.
> >
> > I have
> >   src/main/resources/application.properties
> >   src/main/dev-resources/application.properties
> >
> > my profiles in pom.xml
> >
> >     <profiles>
> >             <profile>
> >                     <id>production</id>
> >                     <activation>
> >                             <activeByDefault>true</activeByDefault>
> >                     </activation>
> >                     <properties>
> >                             <env>production</env>
> >                     </properties>
> >             </profile>
> >             <profile>
> >                     <id>development</id>
> >                     <activation>
> >                             <property>
> >                                     <name>env</name>
> >                                     <value>development</value>
> >                             </property>
> >                     </activation>
> >                     <build>
> >                             <resources>
> >                                     <resource>
> >                                             
> > <directory>src/main/resources</directory>
> >
> >                                             <!-- this exclude is needed, 
> > why? -->
> >                                             <excludes>
> >                                                     
> > <exclude>application.properties</exclude>
> >                                             </excludes>
> >
> >                                     </resource>
> >                                     <resource>
> >                                             
> > <directory>src/main/development-resources</directory>
> >                                     </resource>
> >                             </resources>
> >                     </build>
> >             </profile>
> >     </profiles>
> >
> > then i do
> > $ mvn -Denv=development clean process-resources
> >
> > and it shows me that my   src/main/dev-resources/application.properties
> > was
> > copied to target/classes/
> >
> > If i drop exclude i see  src/main/resources/application.properties in
> > target/classes
> >
> > Why do i need to exclude it? It should be overwritten, shouldn't it?
> >
> > kind regards,
> > Janning
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]

-- 
kind regards,
janning


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to