ปัญหาโปรไฟล์ผู้ปกครอง Maven Pom

ฉันมีโปรไฟล์ที่กำหนดไว้ใน 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>

person user665837    schedule 25.03.2013    source แหล่งที่มา


คำตอบ (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>
person Wim Deblauwe    schedule 25.03.2013
comment
จาก child pom.xml ฉันกำลังพยายามสร้างไฟล์ jar ฉันได้กำหนดโปรไฟล์แล้ว maven-resorces-plugin ใน child pom.xml แต่เมื่อฉันทำ mvn -P profilename ติดตั้งบนโปรเจ็กต์ย่อย childproject.jar ของฉัน META- ไฟล์ INF/คุณสมบัติไม่มีค่าโปรไฟล์ที่ฉันใช้งานอยู่ ฉันกำลังทำอะไรผิดหรือเปล่า - person user665837; 25.03.2013