You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nitko2 <ni...@gmail.com> on 2005/11/11 13:05:47 UTC

Profiles in pom.xml, settings.xml and profiles.xml

I have two profile definitions:

<profiles>
    <profile>
       <id>test</id>
     	<build>
	   <filters>
		<filter>filters/test-filter.properties</filter>
	   </filters>
         </build>
    </profile>
    <profile>
        <id>prod-fina</id>
        <build>
          <filters>
             <filter>filters/prod-filter.properties</filter>
          </filters>
        </build>
    </profile>
</profiles>



Everything works OK as long as I place this snippet in pom.xml. If I move it to profiles.xml or 
settings.xml, file can't be parsed with error:

Cannot parse profiles.xml resource from directory:........


Is this normal behaviour?

Thanks.

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


Re: Profiles in pom.xml, settings.xml and profiles.xml

Posted by John Casey <jd...@commonjava.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Profiles are a little strange, in that there are two different types.
The profiles specified in the POM are allowed to modify many, many
things, but are specific to that POM. They are also inextricably linked
to that POM, obviously.

The profiles specified in the settings.xml and profiles.xml are much
more restricted, only allowing modification of things like repository lists.

The reason for this is that the POM-profiles are portable, where the
other two are not. Anything that seems to stand a high chance of
changing the result of the build is restricted to the inline profiles in
the POM. Things like repository lists could simply be a proprietary
repository of approved artifacts, and won't change the outcome of the
build (provided the integrity of those artifacts is preserved).
Therefore, it's basically ok to specify them outside the POM in a file
that won't get distributed via the repository system.

Make sense?

- -john

Nitko2 wrote:
| I have two profile definitions:
|
| <profiles>
|    <profile>
|       <id>test</id>
|         <build>
|        <filters>
|         <filter>filters/test-filter.properties</filter>
|        </filters>
|         </build>
|    </profile>
|    <profile>
|        <id>prod-fina</id>
|        <build>
|          <filters>
|             <filter>filters/prod-filter.properties</filter>
|          </filters>
|        </build>
|    </profile>
| </profiles>
|
|
|
| Everything works OK as long as I place this snippet in pom.xml. If I
| move it to profiles.xml or settings.xml, file can't be parsed with error:
|
| Cannot parse profiles.xml resource from directory:........
|
|
| Is this normal behaviour?
|
| Thanks.
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
| For additional commands, e-mail: users-help@maven.apache.org
|
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFDdMQwK3h2CZwO/4URApWKAKCpIXE6ps7x8W7l3WuxHIfj+kyZvwCaAlu1
oIQlPCnlf7lu/awUMzEtuw0=
=ruoh
-----END PGP SIGNATURE-----

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