maven - What is happening in the below code it small part of my pom.xml? -


my pom.xml file contains below code means?

<profiles>     <profile>         <id>inmemory</id>         <properties>             <env>inmemory</env>         </properties>     </profile>     <profile>         <id>cloudbees</id>         <properties>             <env>cloudbees</env>         </properties>     </profile> </profiles> 

it means nothing in particular, declares 2 build profiles each 1 of them set value of env property.

the meaning depends on how such declaration used.

for example if in pom.xml there like:

<packaging>jar</packaging> ... <plugin>     <artifactid>maven-jar-plugin</artifactid>     <version>2.4</version>     <configuration>         <archive>             <manifest>                 <addclasspath>true</addclasspath>                 <adddefaultspecificationentries>true</adddefaultspecificationentries>                 <adddefaultimplementationentries>true</adddefaultimplementationentries>             </manifest>             <manifestentries>                 <built-for-environment>${env}</built-for-environment>             </manifestentries>         </archive>     </configuration> </plugin> ... <profiles>     <profile>         <id>inmemory</id>         <properties>             <env>inmemory</env>         </properties>     </profile>     <profile>         <id>cloudbees</id>         <properties>             <env>cloudbees</env>         </properties>     </profile> </profiles> 

and run:

mvn clean install -pinmemory 

than in generated manifest.mf can find row:

built-for-environment: inmemory 

so meaning, in example, add in manifest.mf entry row built-for-environment: followed name of profile id.

you can answer yourself, finding meaning project, searching ${env} in project.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -