I am trying to do this:
Properties

Maven properties are value placeholder, like properties in Ant. Their
values are accessible anywhere within a POM by using the notation ${X},
where X is the property. They come in five different styles, all accessible
from the settings.xml file:

   1. env.X: Prefixing a variable with “env.” will return the shell’s
   environment variable. For example, ${env.PATH} contains the \$path
   environment variable (%PATH% in Windows).
   2. project.x: A dot (.) notated path in the POM will contain the
   corresponding element’s value. For example:
   <project><version>1.0</version></project> is accessible via
   ${project.version}.
   3. settings.x: A dot (.) notated path in the settings.xml will contain
   the corresponding element’s value. For example:
   <settings><offline>false</offline></settings> is accessible via
   ${settings.offline}.
   4. Java System Properties: All properties accessible via
   java.lang.System.getProperties() are available as POM properties, such
   as ${java.home}.
   5. x: Set within a <properties /> element or an external files, the
   value may be used as ${someVar}.


   1. <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0";
   2.   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   3.   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
   4.                       http://maven.apache.org/xsd/settings-1.0.0.xsd";>
   5.   ...
   6.   <profiles>
   7.     <profile>
   8.       ...
   9.       <properties>
   10.         <user.install>${user.home}/our-project</user.install>
   11.       </properties>
   12.       ...
   13.     </profile>
   14.   </profiles>
   15.   ...
   16. </settings>

The property ${user.install} is accessible from a POM if this profile is
active



On Tue, Oct 13, 2015 at 2:30 AM, Brice Vandeputte <[email protected]
> wrote:

> Hi KRR
>  maybe profile is not activated by default, did you try to activate the
> profile?
>  https://maven.apache.org/settings.html#Profiles
> regards
>
> 2015-10-13 6:15 GMT+02:00 KRR001 <[email protected]>:
>
> > I trying to read port from settings.xml file and I get [echo] Port: ${
> > ftp-port }   and not port number.
> >
> > <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"; xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance";  xsi:schemaLocation="
> > http://maven.apache.org/SETTINGS/1.0.0
> > http://maven.apache.org/xsd/settings-1.0.0.xsd";>
> >         <profiles>
> >                 <profile>
> >                         <properties>
> >                                 < ftp-port >${user.home}22</ ftp-port >
> >                         </properties>
> >                 </profile>
> >         </profiles>
> > </settings>
> >
> >
> > <target>
> > <echo>Port: ${ftp-port}</echo>
> >
> > What am I missing?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>

Reply via email to