I ran into this before.  The <localRepository> element is *NOT* a
property. Although it can be referenced like one, it does not behave as
expected.

<localRepository>/m2/repository</localRepository> 

I defined my own local.repository property that duplicates the path, so
I could reference it.

In the properties element in settings.xml:

<properties>
    <local.repository>/m2/repository</local.repository>
.. other properties
</properties>
        
Now you can write ${local.repository} in your pom.xml and use that in
profile activation conditions.

Richard Brewster
Senior Associate
Perrin Quarles Associates
[EMAIL PROTECTED]
(434) 817-2640


-----Original Message-----
From: Patrizio Munzi [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 16, 2008 9:00 AM
To: users@maven.apache.org
Subject: maven properties seem not to work in profile activation feature

Hi all,

I'm trying to manage profiles activations/deactivations by using the
activation tag among with the file tag.
What I would like to do is to activate a particular profile only if a
specified folder is present into the local repository.
The profile configuration I'm using is the following:

  <profiles>
    <profile>
      <id>apache</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <file>
          
<missing>${settings.localRepository}/org/apache/maven/plugins/maven-jar-
plugin/2.2-SNAPSHOT</missing>
        </file>
      </activation>
      <repositories>
        [...]
      </repositories>
      <pluginRepositories>
        [...]
      </pluginRepositories>
    </profile>
  </profiles>

Now, if I use the explicit path of the local repository everything works
well, instead if I use the property ${settings.localRepository} id
doesn't work. It seems that maven isn't able to give a value to the
property. I tried this profile configuration in both settings.xml and
pom.xml files.
Moreover I even tried to use different properties (e.g. ${user.dir}. 
${usr.home}) but in all the case I had no successful results.

Have I missed something...?

Is there any problem in managing properties..?

Thanks


---------------------------------------------------------------------
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