2016-08-09 4 views
1

を使用してMavenのためのオペレーティング・システムに基づいて異なる成果物を生成しますが、私はを実行するとMVNを検証し、それは私に次のエラー私はプロファイルを使用して使用OSに基づいて異なる成果物を生成しようとしているプロファイル

を与える
  1. 認識できないタグ: 'profiles'(位置:START_TAG見て... \ r \ n ... C:\ test-app \ pom.xml、33行目、列19
  2. 不明なパッケージ:nar @ 15行16列

私のPOM.xmlを以下に示します。nar-maven-pluginは2つのOSで共通です。

私はここで何が問題であるか把握できませんでした。どんな助けも高く評価されます。

<project 
xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd"> 

<modelVersion>4.0.0</modelVersion> 
<parent> 
    <groupId>com.company</groupId> 
    <artifactId>mvn-test</artifactId> 
    <version>1.0</version> 
</parent> 

<groupId>com.company.mvn-test</groupId> 
<artifactId>test-app</artifactId> 
<packaging>nar</packaging> 
<version>1.0-SNAPSHOT</version> 

<properties> 
    <skipTests>true</skipTests> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>com.company.mvn-test</groupId> 
     <artifactId>test-library</artifactId> 
     <type>nar</type> 
     <version>1.0-SNAPSHOT</version> 
    </dependency> 
</dependencies> 

<build> 
    <defaultGoal>integration-test</defaultGoal> 
    <profiles> 

     <plugins> 
      <plugin> 
       <groupId>com.github.maven-nar</groupId> 
       <artifactId>nar-maven-plugin</artifactId> 
       <version>3.2.3</version> 
       <extensions>true</extensions> 
       <configuration> 
        <libraries> 
         <library> 
          <type>executable</type> 
          <run>true</run> 
         </library> 
        </libraries> 
        <linker> 
         <name>g++</name> 
        </linker> 
       </configuration> 
      </plugin> 
     </plugins> 

     <profile> 
      <id>OS1</id> 
      <activation> 
       <os> 
        <family>Windows</family> 
       </os> 
      </activation> 
      <plugins> 
       <plugin> 
        <artifactId>maven-antrun-plugin</artifactId> 
        <executions> 
         <execution> 
          <phase>package</phase> 
          <configuration> 
           <tasks> 
            <copy todir="bin" flatten="true"> 
             <fileset dir="target"> 
              <include name="**/*dll"/> 
             </fileset> 
            </copy> 
           </tasks> 
          </configuration> 
          <goals> 
           <goal>run</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </profile> 

     <profile> 
      <id>OS2</id> 
      <activation> 
       <os> 
        <family>unix</family> 
       </os> 
      </activation> 
      <plugins> 
       <plugin> 
        <artifactId>maven-antrun-plugin</artifactId> 
        <executions> 
         <execution> 
          <phase>package</phase> 
          <configuration> 
           <tasks> 
            <copy todir="bin" flatten="true"> 
             <fileset dir="target"> 
              <include name="**/*so"/> 
              <include name="**/*test-app"/> 
             </fileset> 
            </copy> 
           </tasks> 
          </configuration> 
          <goals> 
           <goal>run</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </profile> 

    </profiles> 
</build> 

+0

移動プロファイル... – khmarbaise

答えて

1

これを試してみてください - `` タグのうち

<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/maven-v4_0_0.xsd"> 

<modelVersion>4.0.0</modelVersion> 

<parent> 
    <groupId>com.company</groupId> 
    <artifactId>mvn-test</artifactId> 
    <version>1.0</version> 
</parent> 

<groupId>com.company.mvn-test</groupId> 
<artifactId>test-app</artifactId> 
<packaging>nar</packaging> 
<version>1.0-SNAPSHOT</version> 

<properties> 
    <skipTests>true</skipTests> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>com.company.mvn-test</groupId> 
     <artifactId>test-library</artifactId> 
     <type>nar</type> 
     <version>1.0-SNAPSHOT</version> 
    </dependency> 
</dependencies> 

<build> 
    <defaultGoal>integration-test</defaultGoal> 
    <plugins> 
     <plugin> 
      <groupId>com.github.maven-nar</groupId> 
      <artifactId>nar-maven-plugin</artifactId> 
      <version>3.2.3</version> 
      <extensions>true</extensions> 
      <configuration> 
       <libraries> 
        <library> 
         <type>executable</type> 
         <run>true</run> 
        </library> 
       </libraries> 
       <linker> 
        <name>g++</name> 
       </linker> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

<profiles> 
    <profile> 
     <id>OS1</id> 
     <activation> 
      <os> 
       <family>Windows</family> 
      </os> 
     </activation> 
     <build> 
      <plugins> 
       <plugin> 
        <artifactId>maven-antrun-plugin</artifactId> 
        <executions> 
         <execution> 
          <phase>package</phase> 
          <configuration> 
           <tasks> 
            <copy todir="bin" flatten="true"> 
             <fileset dir="target"> 
              <include name="**/*dll"/> 
             </fileset> 
            </copy> 
           </tasks> 
          </configuration> 
          <goals> 
           <goal>run</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 

    <profile> 
     <id>OS2</id> 
     <activation> 
      <os> 
       <family>unix</family> 
      </os> 
     </activation> 
     <build> 
      <plugins> 
       <plugin> 
        <artifactId>maven-antrun-plugin</artifactId> 
        <executions> 
         <execution> 
          <phase>package</phase> 
          <configuration> 
           <tasks> 
            <copy todir="bin" flatten="true"> 
             <fileset dir="target"> 
              <include name="**/*so"/> 
              <include name="**/*test-app"/> 
             </fileset> 
            </copy> 
           </tasks> 
          </configuration> 
          <goals> 
           <goal>run</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 
</profiles> 
</project> 
関連する問題