You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jordan Zimmerman <jo...@jordanzimmerman.com> on 2015/09/16 01:50:07 UTC

Reactor projects and ${project.version}

Is there any way (using plugins, whatever) to get a stable reference to the root project version? Here is what I’m trying to do. I have a reactor project:

pom.xml
        module1/pom.xml
        module2/pom.xml

The wrinkle is that the root pom.xml has a parent (for example foo:bar:1.2). foo.bar has several of its own modules that I want to use. So, in the root pom.xml I want to have a dependency from foo, in module1’s pom I want to have a dependency from foo etc. There seems to be no way to create a Maven property that matches foo’s version. If in the root pom I have:

<properties>
        <foo-version>${project.parent.version}</foo-version>
</properties>
		
This won’t work in module1/2’s pom as it will reference the root pom’s version, not foo. The only thing that works is to hard code:

<properties>
        <foo-version>1.2</foo-version>
</properties>

But this means that I’m specifying foo’s version twice. Once in the parent tag and once as a property. Is there no way around this?

-Jordan

Re: Reactor projects and ${project.version}

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 9/16/15 1:50 AM, Jordan Zimmerman wrote:
> Is there any way (using plugins, whatever) to get a stable reference to the root project version? Here is what I’m trying to do. I have a reactor project:
>
> pom.xml
>          module1/pom.xml
>          module2/pom.xml
>
> The wrinkle is that the root pom.xml has a parent (for example foo:bar:1.2).
 > foo.bar has several of its own modules that I want to use.
 >  So, in the root pom.xml I want to have a dependency from foo,
 > in module1’s pom I want to have a dependency from foo etc.

If you are making a multi module build you can always use 
${project.version} ...? Can you make an example project of what you have 
tried and put it on github or something similar that we have something 
concrete where we can talk about...

Kind regards
Karl Heinz Marbaise

 >
There seems to be no way to create a Maven property that matches foo’s 
version. If in the root pom I have:
>
> <properties>
>          <foo-version>${project.parent.version}</foo-version>
> </properties>
> 		
> This won’t work in module1/2’s pom as it will reference the root pom’s version, not foo. The only thing that works is to hard code:
>
> <properties>
>          <foo-version>1.2</foo-version>
> </properties>
>
> But this means that I’m specifying foo’s version twice. Once in the parent tag and once as a property. Is there no way around this?
>
> -Jordan
>


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


Re: Reactor projects and ${project.version}

Posted by Hervé BOUTEMY <he...@free.fr>.
the only difference I see, and which makes a huge difference, is that the value 
has to be calculated also when effective model is built from repository 
(instead of project direct build, with its reactor)

I fear it is not so trivial in the context of repository calculation, since 
there is no more reactor available

http://maven.apache.org/ref/3-LATEST/maven-model-builder/

Regards,

Hervé

Le mercredi 16 septembre 2015 19:36:53 Jason van Zyl a écrit :
> Or a core extension but this change is likely not that hard and meshes with
> what we’ve done with the .mvn directory which is to signify the root of the
> reactor.
> > On Sep 16, 2015, at 12:20 PM, Jordan Zimmerman
> > <jo...@jordanzimmerman.com> wrote:
> > 
> > I spoke with Jason and it turns out what I want to do requires a
> > change to core. Therefore:
> > https://issues.apache.org/jira/browse/MNG-5890
> > 
> > On Wed, Sep 16, 2015 at 9:01 AM, Ron Wheeler
> > 
> > <rw...@artifact-software.com> wrote:
> >> Why not make three new separate projects that produce the required war
> >> files.
> >> Only put the minimum configuration in the new projects and let them
> >> depend
> >> on jars that contain the shared code and resources.
> >> 
> >> Maven prefers to produce 1 artifact per project.
> >> 
> >> On 16/09/2015 2:29 AM, Neeraj Malik wrote:
> >>> Dear All,
> >>> 
> >>> I am using maven 3.2.5
> >>> 
> >>> i want to use difference property files to build war for diff
> >>> environments
> >>> and deploy it on local, test and prod accordingly based on maven command
> >>> -
> >>> mvn -Plocal clean install
> >>> 
> >>> 
> >>> /resources/local/env.properties
> >>> /resources/test/env.properties
> >>> /resources/prod/env.properties
> >>> 
> >>> local env property file -
> >>> weblogic.splitDevelopmentDirectoryMode = false
> >>> weblogic.targetName = AdminServer
> >>> weblogic.protocal = http
> >>> weblogic.url = localhost
> >>> weblogic.port = 7001
> >>> weblogic.user = user
> >>> weblogic.password = pass123
> >>> weblogic.upload = false
> >>> weblogic.remote = false
> >>> weblogic.verbose = false
> >>> weblogic.debug = false
> >>> weblogic.noExit = true
> >>> project.build.directory =
> >>> 
> >>> 
> >>> Can you please suggest whats wrong with given POM.
> >>> 
> >>> Thanks.
> >>> 
> >>> Regards
> >>> Neeraj
> >>> 
> >>> 
> >>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> >>> http://www.w3.org/2001/XMLSchema-instance"
> >>> 
> >>>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> >>> 
> >>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> >>> 
> >>>     <modelVersion>4.0.0</modelVersion>
> >>>     <groupId>com.purchase</groupId>
> >>>     <artifactId>Invoice</artifactId>
> >>>     <version>1.0</version>
> >>>     <packaging>war</packaging>
> >>>     
> >>>     
> >>>     <profiles>
> >>>     
> >>>        <profile>
> >>>        
> >>>                <id>local</id>
> >>>             
> >>>             <activation>
> >>>             
> >>>                    <activeByDefault>false</activeByDefault>
> >>>             
> >>>             </activation>
> >>>             
> >>>             <resources>
> >>>             
> >>>                 <resource>
> >>> 
> >>> <directory>${project.basedir}/src/main/resources</directory>
> >>> 
> >>>                 </resource>
> >>>             
> >>>             </resources>
> >>>             
> >>>             <testResources>
> >>>             
> >>>                 <testResource>
> >>> 
> >>> <directory>${project.basedir}/src/test/resources</directory>
> >>> 
> >>>                 </testResource>
> >>>             
> >>>             </testResources>
> >>>             
> >>>              <build>
> >>>              
> >>>                <plugins>
> >>>                
> >>>                     <plugin>
> >>>                     
> >>>                         <groupId>com.oracle.weblogic</groupId>
> >>>                         <artifactId>weblogic-maven-plugin</artifactId>
> >>>                         <version>10.3.4</version>
> >>>                         
> >>>                            <executions>
> >>>                            
> >>>                             <execution>
> >>>                             
> >>>                                 <phase>install</phase>
> >>>                                 <goals>
> >>>                                 
> >>>                                     <goal>deploy</goal>
> >>>                                 
> >>>                                 </goals>
> >>>                             
> >>>                             </execution>
> >>>                         
> >>>                         </executions>
> >>>                     
> >>>                     </plugin>
> >>>                    
> >>>                    </plugins>
> >>>              
> >>>              </build>
> >>>            
> >>>            </profile>
> >>>       
> >>>       </profiles>
> >>>     
> >>>     <dependencies>
> >>>     
> >>>         <dependency>
> >>>         
> >>>             <groupId>weblogic-path</groupId>
> >>>             <artifactId>weblogic-path</artifactId>
> >>>             <scope>system</scope>
> >>>             <systemPath>${WL_HOME}/server/lib/weblogic.jar</systemPath>
> >>>             <version>10.3.5</version>
> >>>         
> >>>         </dependency>
> >>>         
> >>>         <dependency>
> >>>         
> >>>             <groupId>log4j</groupId>
> >>>             <artifactId>log4j</artifactId>
> >>>             <version>1.2.15</version>
> >>>         
> >>>         </dependency>
> >>>     
> >>>     </dependencies>
> >>>     
> >>>     <build>
> >>>     
> >>>         <resources>
> >>>         
> >>>             <resource>
> >>>             
> >>>                 <directory>src/main/resources</directory>
> >>>                 <excludes>
> >>>                 
> >>>                     <exclude>**/*.java</exclude>
> >>>                 
> >>>                 </excludes>
> >>>             
> >>>             </resource>
> >>>             <resource>
> >>>             
> >>>                 <directory>src/main/webapp</directory>
> >>>                 <excludes>
> >>>                 
> >>>                     <exclude>**/*.java</exclude>
> >>>                 
> >>>                 </excludes>
> >>>             
> >>>             </resource>
> >>>         
> >>>         </resources>
> >>>         
> >>>         <plugins>
> >>>         
> >>>             <plugin>
> >>>             
> >>>                 <artifactId>maven-compiler-plugin</artifactId>
> >>>                 <version>3.1</version>
> >>>                 <configuration>
> >>>                 
> >>>                     <source>1.6</source>
> >>>                     <target>1.6</target>
> >>>                 
> >>>                 </configuration>
> >>>             
> >>>             </plugin>
> >>>             <plugin>
> >>>             
> >>>                 <artifactId>maven-war-plugin</artifactId>
> >>>                 <version>2.4</version>
> >>>                 <configuration>
> >>>                 
> >>>                     <failOnMissingWebXml>false</failOnMissingWebXml>
> >>>                 
> >>>                 </configuration>
> >>>             
> >>>             </plugin>
> >>>             
> >>>             <!-- required or not -->
> >>>             <plugin>
> >>>             
> >>>                 <groupId>org.apache.maven.plugins</groupId>
> >>>                 <artifactId>maven-antrun-plugin</artifactId>
> >>>                 <dependencies>
> >>>                 
> >>>                     <dependency>
> >>>                     
> >>>                         <groupId>com.sun</groupId>
> >>>                         <artifactId>tools</artifactId>
> >>>                         <version>1.6</version>
> >>>                         <scope>system</scope>
> >>> 
> >>> <systemPath>${java.home}/../lib/tools.jar</systemPath>
> >>> 
> >>>                     </dependency>
> >>>                 
> >>>                 </dependencies>
> >>>                 
> >>>                  <version>1.7</version>
> >>>             
> >>>             </plugin>
> >>>             
> >>>             
> >>>             <plugin>
> >>>             
> >>>                 <groupId>com.maven.plugins</groupId>
> >>>                 <artifactId>weblogic-10.3.3.0-maven-plugin</artifactId>
> >>>                 <version>2.9.1.2</version>
> >>>                 
> >>>                 <configuration>
> >>> 
> >>> <splitDevelopmentDirectoryMode>${weblogic.splitDevelopmentDirectoryMode}
> >>> </splitDevelopmentDirectoryMode>>>> 
> >>>                     <targetNames>${weblogic.targetName}</targetNames>
> >>> 
> >>> <adminServerProtocol>${weblogic.protocal}</adminServerProtocol>
> >>> 
> >>> <adminServerHostName>${weblogic.url}</adminServerHostName>
> >>> 
> >>>                     <adminServerPort>${weblogic.port}</adminServerPort>
> >>>                     <userId>${weblogic.user}</userId>
> >>>                     <password>${weblogic.password}</password>
> >>>                     
> >>>                     <upload>${weblogic.upload}</upload>
> >>>                     <remote>${weblogic.remote}</remote>
> >>>                     
> >>>                     <verbose>false</verbose>
> >>>                     <debug>false</debug>
> >>>                     <noExit>true</noExit>
> >>> 
> >>> <artifactPath>${project.build.directory}/InvoiceBAS-${version}</artifact
> >>> Path>>>> 
> >>>                </configuration>
> >>>             
> >>>             </plugin>
> >>>         
> >>>         </plugins>
> >>>     
> >>>     </build>
> >>> 
> >>> </project>
> >> 
> >> --
> >> Ron Wheeler
> >> President
> >> Artifact Software Inc
> >> email: rwheeler@artifact-software.com
> >> skype: ronaldmwheeler
> >> phone: 866-970-2435, ext 102
> >> 
> >> 
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> Thanks,
> 
> Jason
> 
> ----------------------------------------------------------
> Jason van Zyl
> Founder, Takari and Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
> 
> To think is easy. To act is hard. But the hardest thing in the world is to
> act in accordance with your thinking.
> 
>  -- Johann von Goethe
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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


Re: Reactor projects and ${project.version}

Posted by Jason van Zyl <ja...@takari.io>.
Or a core extension but this change is likely not that hard and meshes with what we’ve done with the .mvn directory which is to signify the root of the reactor.

> On Sep 16, 2015, at 12:20 PM, Jordan Zimmerman <jo...@jordanzimmerman.com> wrote:
> 
> I spoke with Jason and it turns out what I want to do requires a
> change to core. Therefore:
> https://issues.apache.org/jira/browse/MNG-5890
> 
> On Wed, Sep 16, 2015 at 9:01 AM, Ron Wheeler
> <rw...@artifact-software.com> wrote:
>> Why not make three new separate projects that produce the required war
>> files.
>> Only put the minimum configuration in the new projects and let them depend
>> on jars that contain the shared code and resources.
>> 
>> Maven prefers to produce 1 artifact per project.
>> 
>> 
>> 
>> On 16/09/2015 2:29 AM, Neeraj Malik wrote:
>>> 
>>> Dear All,
>>> 
>>> I am using maven 3.2.5
>>> 
>>> i want to use difference property files to build war for diff environments
>>> and deploy it on local, test and prod accordingly based on maven command -
>>> mvn -Plocal clean install
>>> 
>>> 
>>> /resources/local/env.properties
>>> /resources/test/env.properties
>>> /resources/prod/env.properties
>>> 
>>> local env property file -
>>> weblogic.splitDevelopmentDirectoryMode = false
>>> weblogic.targetName = AdminServer
>>> weblogic.protocal = http
>>> weblogic.url = localhost
>>> weblogic.port = 7001
>>> weblogic.user = user
>>> weblogic.password = pass123
>>> weblogic.upload = false
>>> weblogic.remote = false
>>> weblogic.verbose = false
>>> weblogic.debug = false
>>> weblogic.noExit = true
>>> project.build.directory =
>>> 
>>> 
>>> Can you please suggest whats wrong with given POM.
>>> 
>>> Thanks.
>>> 
>>> Regards
>>> Neeraj
>>> 
>>> 
>>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
>>> http://www.w3.org/2001/XMLSchema-instance"
>>>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>>     <modelVersion>4.0.0</modelVersion>
>>>     <groupId>com.purchase</groupId>
>>>     <artifactId>Invoice</artifactId>
>>>     <version>1.0</version>
>>>     <packaging>war</packaging>
>>> 
>>> 
>>>     <profiles>
>>>        <profile>
>>>                <id>local</id>
>>>             <activation>
>>>                    <activeByDefault>false</activeByDefault>
>>>             </activation>
>>> 
>>>             <resources>
>>>                 <resource>
>>> 
>>> <directory>${project.basedir}/src/main/resources</directory>
>>>                 </resource>
>>>             </resources>
>>> 
>>>             <testResources>
>>>                 <testResource>
>>> 
>>> <directory>${project.basedir}/src/test/resources</directory>
>>>                 </testResource>
>>>             </testResources>
>>> 
>>>              <build>
>>>                <plugins>
>>>                     <plugin>
>>>                         <groupId>com.oracle.weblogic</groupId>
>>>                         <artifactId>weblogic-maven-plugin</artifactId>
>>>                         <version>10.3.4</version>
>>>                            <executions>
>>>                             <execution>
>>>                                 <phase>install</phase>
>>>                                 <goals>
>>>                                     <goal>deploy</goal>
>>>                                 </goals>
>>>                             </execution>
>>>                         </executions>
>>>                     </plugin>
>>>                    </plugins>
>>>              </build>
>>>            </profile>
>>>       </profiles>
>>> 
>>> 
>>>     <dependencies>
>>> 
>>>         <dependency>
>>>             <groupId>weblogic-path</groupId>
>>>             <artifactId>weblogic-path</artifactId>
>>>             <scope>system</scope>
>>>             <systemPath>${WL_HOME}/server/lib/weblogic.jar</systemPath>
>>>             <version>10.3.5</version>
>>>         </dependency>
>>> 
>>>         <dependency>
>>>             <groupId>log4j</groupId>
>>>             <artifactId>log4j</artifactId>
>>>             <version>1.2.15</version>
>>>         </dependency>
>>> 
>>>     </dependencies>
>>> 
>>>     <build>
>>>         <resources>
>>>             <resource>
>>>                 <directory>src/main/resources</directory>
>>>                 <excludes>
>>>                     <exclude>**/*.java</exclude>
>>>                 </excludes>
>>>             </resource>
>>>             <resource>
>>>                 <directory>src/main/webapp</directory>
>>>                 <excludes>
>>>                     <exclude>**/*.java</exclude>
>>>                 </excludes>
>>>             </resource>
>>>         </resources>
>>> 
>>>         <plugins>
>>>             <plugin>
>>>                 <artifactId>maven-compiler-plugin</artifactId>
>>>                 <version>3.1</version>
>>>                 <configuration>
>>>                     <source>1.6</source>
>>>                     <target>1.6</target>
>>>                 </configuration>
>>>             </plugin>
>>>             <plugin>
>>>                 <artifactId>maven-war-plugin</artifactId>
>>>                 <version>2.4</version>
>>>                 <configuration>
>>>                     <failOnMissingWebXml>false</failOnMissingWebXml>
>>>                 </configuration>
>>>             </plugin>
>>> 
>>>             <!-- required or not -->
>>>             <plugin>
>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>                 <artifactId>maven-antrun-plugin</artifactId>
>>>                 <dependencies>
>>>                     <dependency>
>>>                         <groupId>com.sun</groupId>
>>>                         <artifactId>tools</artifactId>
>>>                         <version>1.6</version>
>>>                         <scope>system</scope>
>>> 
>>> <systemPath>${java.home}/../lib/tools.jar</systemPath>
>>>                     </dependency>
>>>                 </dependencies>
>>>                  <version>1.7</version>
>>>             </plugin>
>>> 
>>> 
>>>             <plugin>
>>>                 <groupId>com.maven.plugins</groupId>
>>>                 <artifactId>weblogic-10.3.3.0-maven-plugin</artifactId>
>>>                 <version>2.9.1.2</version>
>>> 
>>>                 <configuration>
>>> 
>>> 
>>> <splitDevelopmentDirectoryMode>${weblogic.splitDevelopmentDirectoryMode}</splitDevelopmentDirectoryMode>
>>> 
>>> 
>>>                     <targetNames>${weblogic.targetName}</targetNames>
>>> 
>>> <adminServerProtocol>${weblogic.protocal}</adminServerProtocol>
>>> 
>>> <adminServerHostName>${weblogic.url}</adminServerHostName>
>>> 
>>>                     <adminServerPort>${weblogic.port}</adminServerPort>
>>>                     <userId>${weblogic.user}</userId>
>>>                     <password>${weblogic.password}</password>
>>> 
>>>                     <upload>${weblogic.upload}</upload>
>>>                     <remote>${weblogic.remote}</remote>
>>> 
>>>                     <verbose>false</verbose>
>>>                     <debug>false</debug>
>>>                     <noExit>true</noExit>
>>> 
>>> 
>>> <artifactPath>${project.build.directory}/InvoiceBAS-${version}</artifactPath>
>>> 
>>>                </configuration>
>>>             </plugin>
>>> 
>>>         </plugins>
>>>     </build>
>>> 
>>> 
>>> 
>>> </project>
>>> 
>> 
>> 
>> --
>> Ron Wheeler
>> President
>> Artifact Software Inc
>> email: rwheeler@artifact-software.com
>> skype: ronaldmwheeler
>> phone: 866-970-2435, ext 102
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder, Takari and Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

To think is easy. To act is hard. But the hardest thing in the world is to act in accordance with your thinking.

 -- Johann von Goethe













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


Re: Reactor projects and ${project.version}

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
I spoke with Jason and it turns out what I want to do requires a
change to core. Therefore:
https://issues.apache.org/jira/browse/MNG-5890

On Wed, Sep 16, 2015 at 9:01 AM, Ron Wheeler
<rw...@artifact-software.com> wrote:
> Why not make three new separate projects that produce the required war
> files.
> Only put the minimum configuration in the new projects and let them depend
> on jars that contain the shared code and resources.
>
> Maven prefers to produce 1 artifact per project.
>
>
>
> On 16/09/2015 2:29 AM, Neeraj Malik wrote:
>>
>> Dear All,
>>
>> I am using maven 3.2.5
>>
>> i want to use difference property files to build war for diff environments
>> and deploy it on local, test and prod accordingly based on maven command -
>> mvn -Plocal clean install
>>
>>
>> /resources/local/env.properties
>> /resources/test/env.properties
>> /resources/prod/env.properties
>>
>> local env property file -
>> weblogic.splitDevelopmentDirectoryMode = false
>> weblogic.targetName = AdminServer
>> weblogic.protocal = http
>> weblogic.url = localhost
>> weblogic.port = 7001
>> weblogic.user = user
>> weblogic.password = pass123
>> weblogic.upload = false
>> weblogic.remote = false
>> weblogic.verbose = false
>> weblogic.debug = false
>> weblogic.noExit = true
>> project.build.directory =
>>
>>
>> Can you please suggest whats wrong with given POM.
>>
>> Thanks.
>>
>> Regards
>> Neeraj
>>
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
>> http://www.w3.org/2001/XMLSchema-instance"
>>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>>      <modelVersion>4.0.0</modelVersion>
>>      <groupId>com.purchase</groupId>
>>      <artifactId>Invoice</artifactId>
>>      <version>1.0</version>
>>      <packaging>war</packaging>
>>
>>
>>      <profiles>
>>         <profile>
>>                 <id>local</id>
>>              <activation>
>>                     <activeByDefault>false</activeByDefault>
>>              </activation>
>>
>>              <resources>
>>                  <resource>
>>
>> <directory>${project.basedir}/src/main/resources</directory>
>>                  </resource>
>>              </resources>
>>
>>              <testResources>
>>                  <testResource>
>>
>> <directory>${project.basedir}/src/test/resources</directory>
>>                  </testResource>
>>              </testResources>
>>
>>               <build>
>>                 <plugins>
>>                      <plugin>
>>                          <groupId>com.oracle.weblogic</groupId>
>>                          <artifactId>weblogic-maven-plugin</artifactId>
>>                          <version>10.3.4</version>
>>                             <executions>
>>                              <execution>
>>                                  <phase>install</phase>
>>                                  <goals>
>>                                      <goal>deploy</goal>
>>                                  </goals>
>>                              </execution>
>>                          </executions>
>>                      </plugin>
>>                     </plugins>
>>               </build>
>>             </profile>
>>        </profiles>
>>
>>
>>      <dependencies>
>>
>>          <dependency>
>>              <groupId>weblogic-path</groupId>
>>              <artifactId>weblogic-path</artifactId>
>>              <scope>system</scope>
>>              <systemPath>${WL_HOME}/server/lib/weblogic.jar</systemPath>
>>              <version>10.3.5</version>
>>          </dependency>
>>
>>          <dependency>
>>              <groupId>log4j</groupId>
>>              <artifactId>log4j</artifactId>
>>              <version>1.2.15</version>
>>          </dependency>
>>
>>      </dependencies>
>>
>>      <build>
>>          <resources>
>>              <resource>
>>                  <directory>src/main/resources</directory>
>>                  <excludes>
>>                      <exclude>**/*.java</exclude>
>>                  </excludes>
>>              </resource>
>>              <resource>
>>                  <directory>src/main/webapp</directory>
>>                  <excludes>
>>                      <exclude>**/*.java</exclude>
>>                  </excludes>
>>              </resource>
>>          </resources>
>>
>>          <plugins>
>>              <plugin>
>>                  <artifactId>maven-compiler-plugin</artifactId>
>>                  <version>3.1</version>
>>                  <configuration>
>>                      <source>1.6</source>
>>                      <target>1.6</target>
>>                  </configuration>
>>              </plugin>
>>              <plugin>
>>                  <artifactId>maven-war-plugin</artifactId>
>>                  <version>2.4</version>
>>                  <configuration>
>>                      <failOnMissingWebXml>false</failOnMissingWebXml>
>>                  </configuration>
>>              </plugin>
>>
>>              <!-- required or not -->
>>              <plugin>
>>                  <groupId>org.apache.maven.plugins</groupId>
>>                  <artifactId>maven-antrun-plugin</artifactId>
>>                  <dependencies>
>>                      <dependency>
>>                          <groupId>com.sun</groupId>
>>                          <artifactId>tools</artifactId>
>>                          <version>1.6</version>
>>                          <scope>system</scope>
>>
>> <systemPath>${java.home}/../lib/tools.jar</systemPath>
>>                      </dependency>
>>                  </dependencies>
>>                   <version>1.7</version>
>>              </plugin>
>>
>>
>>              <plugin>
>>                  <groupId>com.maven.plugins</groupId>
>>                  <artifactId>weblogic-10.3.3.0-maven-plugin</artifactId>
>>                  <version>2.9.1.2</version>
>>
>>                  <configuration>
>>
>>
>> <splitDevelopmentDirectoryMode>${weblogic.splitDevelopmentDirectoryMode}</splitDevelopmentDirectoryMode>
>>
>>
>>                      <targetNames>${weblogic.targetName}</targetNames>
>>
>> <adminServerProtocol>${weblogic.protocal}</adminServerProtocol>
>>
>> <adminServerHostName>${weblogic.url}</adminServerHostName>
>>
>>                      <adminServerPort>${weblogic.port}</adminServerPort>
>>                      <userId>${weblogic.user}</userId>
>>                      <password>${weblogic.password}</password>
>>
>>                      <upload>${weblogic.upload}</upload>
>>                      <remote>${weblogic.remote}</remote>
>>
>>                      <verbose>false</verbose>
>>                      <debug>false</debug>
>>                      <noExit>true</noExit>
>>
>>
>> <artifactPath>${project.build.directory}/InvoiceBAS-${version}</artifactPath>
>>
>>                 </configuration>
>>              </plugin>
>>
>>          </plugins>
>>      </build>
>>
>>
>>
>> </project>
>>
>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: Reactor projects and ${project.version}

Posted by Ron Wheeler <rw...@artifact-software.com>.
Why not make three new separate projects that produce the required war 
files.
Only put the minimum configuration in the new projects and let them 
depend on jars that contain the shared code and resources.

Maven prefers to produce 1 artifact per project.


On 16/09/2015 2:29 AM, Neeraj Malik wrote:
> Dear All,
>
> I am using maven 3.2.5
>
> i want to use difference property files to build war for diff environments
> and deploy it on local, test and prod accordingly based on maven command -
> mvn -Plocal clean install
>
>
> /resources/local/env.properties
> /resources/test/env.properties
> /resources/prod/env.properties
>
> local env property file -
> weblogic.splitDevelopmentDirectoryMode = false
> weblogic.targetName = AdminServer
> weblogic.protocal = http
> weblogic.url = localhost
> weblogic.port = 7001
> weblogic.user = user
> weblogic.password = pass123
> weblogic.upload = false
> weblogic.remote = false
> weblogic.verbose = false
> weblogic.debug = false
> weblogic.noExit = true
> project.build.directory =
>
>
> Can you please suggest whats wrong with given POM.
>
> Thanks.
>
> Regards
> Neeraj
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>      <modelVersion>4.0.0</modelVersion>
>      <groupId>com.purchase</groupId>
>      <artifactId>Invoice</artifactId>
>      <version>1.0</version>
>      <packaging>war</packaging>
>
>
>      <profiles>
>         <profile>
>                 <id>local</id>
>              <activation>
>                     <activeByDefault>false</activeByDefault>
>              </activation>
>
>              <resources>
>                  <resource>
>
> <directory>${project.basedir}/src/main/resources</directory>
>                  </resource>
>              </resources>
>
>              <testResources>
>                  <testResource>
>
> <directory>${project.basedir}/src/test/resources</directory>
>                  </testResource>
>              </testResources>
>
>               <build>
>                 <plugins>
>                      <plugin>
>                          <groupId>com.oracle.weblogic</groupId>
>                          <artifactId>weblogic-maven-plugin</artifactId>
>                          <version>10.3.4</version>
>                             <executions>
>                              <execution>
>                                  <phase>install</phase>
>                                  <goals>
>                                      <goal>deploy</goal>
>                                  </goals>
>                              </execution>
>                          </executions>
>                      </plugin>
>                     </plugins>
>               </build>
>             </profile>
>        </profiles>
>
>
>      <dependencies>
>
>          <dependency>
>              <groupId>weblogic-path</groupId>
>              <artifactId>weblogic-path</artifactId>
>              <scope>system</scope>
>              <systemPath>${WL_HOME}/server/lib/weblogic.jar</systemPath>
>              <version>10.3.5</version>
>          </dependency>
>
>          <dependency>
>              <groupId>log4j</groupId>
>              <artifactId>log4j</artifactId>
>              <version>1.2.15</version>
>          </dependency>
>
>      </dependencies>
>
>      <build>
>          <resources>
>              <resource>
>                  <directory>src/main/resources</directory>
>                  <excludes>
>                      <exclude>**/*.java</exclude>
>                  </excludes>
>              </resource>
>              <resource>
>                  <directory>src/main/webapp</directory>
>                  <excludes>
>                      <exclude>**/*.java</exclude>
>                  </excludes>
>              </resource>
>          </resources>
>
>          <plugins>
>              <plugin>
>                  <artifactId>maven-compiler-plugin</artifactId>
>                  <version>3.1</version>
>                  <configuration>
>                      <source>1.6</source>
>                      <target>1.6</target>
>                  </configuration>
>              </plugin>
>              <plugin>
>                  <artifactId>maven-war-plugin</artifactId>
>                  <version>2.4</version>
>                  <configuration>
>                      <failOnMissingWebXml>false</failOnMissingWebXml>
>                  </configuration>
>              </plugin>
>
>              <!-- required or not -->
>              <plugin>
>                  <groupId>org.apache.maven.plugins</groupId>
>                  <artifactId>maven-antrun-plugin</artifactId>
>                  <dependencies>
>                      <dependency>
>                          <groupId>com.sun</groupId>
>                          <artifactId>tools</artifactId>
>                          <version>1.6</version>
>                          <scope>system</scope>
>
> <systemPath>${java.home}/../lib/tools.jar</systemPath>
>                      </dependency>
>                  </dependencies>
>                   <version>1.7</version>
>              </plugin>
>
>
>              <plugin>
>                  <groupId>com.maven.plugins</groupId>
>                  <artifactId>weblogic-10.3.3.0-maven-plugin</artifactId>
>                  <version>2.9.1.2</version>
>
>                  <configuration>
>
> <splitDevelopmentDirectoryMode>${weblogic.splitDevelopmentDirectoryMode}</splitDevelopmentDirectoryMode>
>
>
>                      <targetNames>${weblogic.targetName}</targetNames>
>
> <adminServerProtocol>${weblogic.protocal}</adminServerProtocol>
>
> <adminServerHostName>${weblogic.url}</adminServerHostName>
>
>                      <adminServerPort>${weblogic.port}</adminServerPort>
>                      <userId>${weblogic.user}</userId>
>                      <password>${weblogic.password}</password>
>
>                      <upload>${weblogic.upload}</upload>
>                      <remote>${weblogic.remote}</remote>
>
>                      <verbose>false</verbose>
>                      <debug>false</debug>
>                      <noExit>true</noExit>
>
> <artifactPath>${project.build.directory}/InvoiceBAS-${version}</artifactPath>
>
>                 </configuration>
>              </plugin>
>
>          </plugins>
>      </build>
>
>
>
> </project>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Re: Reactor projects and ${project.version}

Posted by Neeraj Malik <ne...@googlemail.com>.
Dear All,

I am using maven 3.2.5

i want to use difference property files to build war for diff environments
and deploy it on local, test and prod accordingly based on maven command -
mvn -Plocal clean install


/resources/local/env.properties
/resources/test/env.properties
/resources/prod/env.properties

local env property file -
weblogic.splitDevelopmentDirectoryMode = false
weblogic.targetName = AdminServer
weblogic.protocal = http
weblogic.url = localhost
weblogic.port = 7001
weblogic.user = user
weblogic.password = pass123
weblogic.upload = false
weblogic.remote = false
weblogic.verbose = false
weblogic.debug = false
weblogic.noExit = true
project.build.directory =


Can you please suggest whats wrong with given POM.

Thanks.

Regards
Neeraj


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.purchase</groupId>
    <artifactId>Invoice</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>


    <profiles>
       <profile>
               <id>local</id>
            <activation>
                   <activeByDefault>false</activeByDefault>
            </activation>

            <resources>
                <resource>

<directory>${project.basedir}/src/main/resources</directory>
                </resource>
            </resources>

            <testResources>
                <testResource>

<directory>${project.basedir}/src/test/resources</directory>
                </testResource>
            </testResources>

             <build>
               <plugins>
                    <plugin>
                        <groupId>com.oracle.weblogic</groupId>
                        <artifactId>weblogic-maven-plugin</artifactId>
                        <version>10.3.4</version>
                           <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                   </plugins>
             </build>
           </profile>
      </profiles>


    <dependencies>

        <dependency>
            <groupId>weblogic-path</groupId>
            <artifactId>weblogic-path</artifactId>
            <scope>system</scope>
            <systemPath>${WL_HOME}/server/lib/weblogic.jar</systemPath>
            <version>10.3.5</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/webapp</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>

            <!-- required or not -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.sun</groupId>
                        <artifactId>tools</artifactId>
                        <version>1.6</version>
                        <scope>system</scope>

<systemPath>${java.home}/../lib/tools.jar</systemPath>
                    </dependency>
                </dependencies>
                 <version>1.7</version>
            </plugin>


            <plugin>
                <groupId>com.maven.plugins</groupId>
                <artifactId>weblogic-10.3.3.0-maven-plugin</artifactId>
                <version>2.9.1.2</version>

                <configuration>

<splitDevelopmentDirectoryMode>${weblogic.splitDevelopmentDirectoryMode}</splitDevelopmentDirectoryMode>


                    <targetNames>${weblogic.targetName}</targetNames>

<adminServerProtocol>${weblogic.protocal}</adminServerProtocol>

<adminServerHostName>${weblogic.url}</adminServerHostName>

                    <adminServerPort>${weblogic.port}</adminServerPort>
                    <userId>${weblogic.user}</userId>
                    <password>${weblogic.password}</password>

                    <upload>${weblogic.upload}</upload>
                    <remote>${weblogic.remote}</remote>

                    <verbose>false</verbose>
                    <debug>false</debug>
                    <noExit>true</noExit>

<artifactPath>${project.build.directory}/InvoiceBAS-${version}</artifactPath>

               </configuration>
            </plugin>

        </plugins>
    </build>



</project>