Masalah Profil Anak Orang Tua Maven Pom

Saya memiliki profil yang ditentukan di pom.xml induk dan pom.xml anak tetapi ketika saya mencoba menjalankan mvn install -P profile name dari proyek induk, properti yang ditentukan dalam file profil tidak disalin

Pom.xml Induk saya terlihat seperti:

            <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 anak saya:

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

        </execution>
        </plugin>

person user665837    schedule 25.03.2013    source sumber


Jawaban (1)


Anda perlu merujuk ke orang tua Anda dari anak:

<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>
person Wim Deblauwe    schedule 25.03.2013
comment
dari pom.xml anak saya mencoba membuat file jar, saya telah mendefinisikan profil, maven-resorces-plugin di pom.xml anak, namun ketika saya melakukan mvn -P profilename install pada proyek anak, proyek anak saya.jar META- File INF/properti tidak memiliki nilai profil yang saya hadapi, apakah saya melakukan kesalahan - person user665837; 25.03.2013