pavan
pavan

Reputation: 791

How to get the scm connnectionurl from an external file into the pom.xml?

I want to get the connectionUrl and other properties such as modules to checkout the repositories from an external file(not necessarily xml file) into the pom file.

My pom file looks like:

<project>...
<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-scm-plugin</artifactId>
       <version>1.5</version>
       <configuration>
         <username>${svn.username}</username>
         <password>${svn.pass}</password>`enter code here`
         <checkoutDirectory>${path}</checkoutDirectory>
         <skipCheckoutIfExists/>
       </configuration>
       <executions>
         <execution>
           <id>checkout_a</id>
           <configuration>
             <connectionUrl>I want to get the url and other properties from a xml file</connectionUrl>
             <checkoutDirectory>${path}</checkoutDirectory>
           </configuration>
           <phase>process-resources</phase>
             <goals>
               <goal>checkout</goal>
             </goals>
        </execution>
      </executions>
  </plugin>     
</plugins>
</build>
</project>

Upvotes: 1

Views: 736

Answers (2)

Ryan Stewart
Ryan Stewart

Reputation: 128909

Use the properties plugin to read pom properties from a properties file. If not a properties file, then you'll probably need to use GMaven, write some groovy code to parse the file, and then update the pom properties yourself.

Upvotes: 1

VonC
VonC

Reputation: 1327784

The simplest approach would be to declare the svn url as a property in your pom.xml, as illustrated in this (french) article (translated here).

<connection>scm:svn:http://my.svn.server/trunk</connection> 

However, like this thread illustrates, you cannot get the "current" repo (through svn info).

And you can see here for an scm ClearCase URL:

scm:clearcase<delimiter>[viewName]<delimiter>[loadCommand]<delimiter>[VOBName]<delimiter>[streamName]<delimiter>/main/fooBar/LATEST

Upvotes: 0

Related Questions