0

親の pom.xml と子の pom.xml でmvn install -P profile name定義されたプロファイルがありますが、親プロジェクトから実行しようとすると、プロファイル ファイルで定義されたプロパティがコピーされません。

私の親 pom.xml は次のようになります。

            <dependencies>
              <dependency>
              <groupId>xxx</groupId> 
              <artifactId>xxx</artifactId> 
              <version>0.0.1-SNAPSHOT</version>
              <type>pom</type>
            </dependency>
            </dependencies>

            <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
            <execution>
            <id>copy-resources</id>
            <phase>verify</phase>
                <goals>
                <goal>copy-resources</goal>
                </goals>
            <configuration>
                <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory>                               <resources>
            <resource>
            <directory>deployment/${environment}</directory>
            </resource>
            </resources>
            </configuration>
            </execution>
            </plugin>

私の子 pom.xml:

        <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
        <execution>
        <id>copy-resources</id>
        <phase>verify</phase>
            <goals>
            <goal>copy-resources</goal>
            </goals>

        </execution>
        </plugin>
4

1 に答える 1

1

あなたは子供からあなたの親を参照する必要があります:

<parent>
    <groupId>org.company.groupid</groupId>
     <!-- Artifact id of the parent here -->
    <artifactId>parentArtifactId</artifactId>
     <!-- Version of the parent here -->
    <version>1.0-SNAPSHOT</version>
</parent>
于 2013-03-25T09:59:44.533 に答える