2

我在 pom.xml 中创建了两个配置文件,如何在其他模块的 pom.xml 中获取这些配置文件 ID?

这是 pom.xml 中的配置文件条目:-

<profiles>
   <profile>
     <id>Test1</id>
     <activation>
       <activeByDefault>true</activeByDefault>
       <jdk>1.5</jdk>
       <os>
         <name>Windows XP</name>
         <family>Windows</family>
         <arch>x86</arch>
         <version>5.1.2600</version>
       </os>
       <property>
         <name>sparrow-type</name>
         <value>African</value>
       </property>
    </activation>
   <dependencies>
     <dependency>
        <groupId>com.endeca</groupId>
        <artifactId>endeca_navigation_Test1</artifactId>
        <version>6.1</version>
    <!--<version>stable</version> -->
        <scope>compile</scope>
    </dependency>
  </dependencies>
</profile>

<profile>
   <id>Test2</id>
   <activation>
      <activeByDefault>false</activeByDefault>
      <jdk>1.5</jdk>
      <os>
       <name>Windows XP</name>
       <family>Windows</family>
       <arch>x86</arch>
       <version>5.1.2600</version>
     </os>
     <property>
       <name>sparrow-type</name>
       <value>African</value>
     </property>
  </activation>
   <dependencies>
    <dependency>
       <groupId>com.endeca</groupId>
       <artifactId>endeca_navigation_Test2</artifactId>
       <version>6.1</version>
   <!--<version>stable</version> -->
       <scope>compile</scope>
    </dependency>
  </dependencies>
  </profile>
</profiles>

其他模块的 pom.xml:-

<modules>
   <module>Common</module>
   <module>DataImporter</module>
   <module>Services</module>
   <module>ProductDataLibrary</module>
   <module>DataModelingTestTool</module>
   <module>NGPManager</module>
   <module>BuildTools</module>
   <module>ServicesClientLibrary</module>
</modules>

<build>
   <finalName>NGPOfficialBuild</finalName>  
   <plugins>
     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.6</version>
        <dependencies>
          <dependency>
             <groupId>com.forddirect.ngp</groupId>
             <artifactId>BuildTools</artifactId>
             <version>0.0.1-SNAPSHOT</version>
          </dependency>
        </dependencies>
     </plugin>
     <plugin>
       <artifactId>maven-antrun-plugin</artifactId>
       <version>1.6</version>
       <executions>
         <execution>
           <phase>package</phase>
           <configuration>
              <target>
                <echo>Creating Ford official builds via ANT</echo>
                <ant antfile="FordOfficialBuild.xml" target="FordOfficial"/>
                <echo>Ford Official builds completed</echo>
              </target>
           </configuration>
           <goals>
             <goal>run</goal>
           </goals>
         </execution>
      </executions>
    </plugin>
  </plugins>
</build>

我怎样才能在这个 maven-antrun-plugin 获得配置文件 ID?

4

0 回答 0