You are really not encouraged to use application-specific properties
in a settings.xml file, as your builds will not be portable. Instead,
these kinds of properties should be placed directly in the pom (parent
or children as appropriate) of the project you are working on.

I use a similar process for our Ant builds, with project-specific
properties in my user home loaded first, then all-projects properties,
etc. I'm pretty sure this is a common pattern across Ant users.

Wayne

On 3/12/07, mraible <[EMAIL PROTECTED]> wrote:

Since there's been no answers to this question, I'll assume the answer is
"No, it's not possible to use settings.xml to have application-specific
properties."

Matt


mraible wrote:
>
> I have a number of properties for database settings in my root pom.xml:
>
>         <!-- Database settings -->
>
>
<dbunit.dataTypeFactoryName>org.dbunit.dataset.datatype.DefaultDataTypeFactory</dbunit.dataTypeFactoryName>
>         <dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
>
>
<hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</hibernate.dialect>
>         <jdbc.groupId>mysql</jdbc.groupId>
>         <jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
>         <jdbc.version>5.0.3</jdbc.version>
>         <jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
>
>
<jdbc.url><![CDATA[jdbc:mysql://localhost/tutorial?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8]]></jdbc.url>
>         <jdbc.username>root</jdbc.username>
>         <jdbc.password></jdbc.password>
>
> This works great when I have a single project.  However, I've started to
> develop two applications with this setup, and I need to locally override
> the jdbc.url for one of my projects.  Is it possible to do this on an
> application-specific basis w/o affecting both applications.  AFAIK,
> settings.xml doesn't have anything fancy like (does it?):
>
> <activation>
>      <property>
>          <name>${pom.artifactId}</name>
>          <value>projecttoactivatefor</value>
>      </property>
> </activation>
>
> With Ant, I was able to accomplish this using:
>
>     <!-- Load user overrides -->
>     <property file="${user.home}/.${ant.project.name}-build.properties"/>
>     <property file="${user.home}/.build.properties"/>
>     <property file="build.properties"/>
>
> Thanks,
>
> Matt
>

--
View this message in context:
http://www.nabble.com/Is-it-possible-to-have-application-specific-properties-in-settings.xml--tf3363611s177.html#a9441555
Sent from the Maven - Users mailing list archive at Nabble.com.


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



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

Reply via email to