2017-02-20 13 views
0

私のビルドの出力としてmyEar.earファイルが必要です。mavenビルド耳 - 私はちょうど.earファイルをビルドすることができ、爆発した耳のビルドをビルドすることはできませんか?

私はdir myEar(爆発した耳のバージョン)は望んでいません。

明確にするために、これは私のビルド出力である:

20/02/2017 11:37 <DIR>   myEar 
20/02/2017 11:37   7.985.535 myEar.ear 

私はちょうどmyEar.earをしたいです。

ありがとうございました。

ここで耳の私のpom.xml:

<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <name>myEar</name> 
    <description>myEar</description> 

    <groupId>com.foo</groupId> 
    <artifactId>myEar</artifactId> 
    <version>1.0</version> 
    <packaging>ear</packaging> 

    <parent> 
    </parent> 

    <properties> 
    </properties> 

    <dependencies> 

(...)

</dependencies> 

    <build> 
    <plugins> 


     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-ear-plugin</artifactId> 
     <version>2.8</version> 
     <configuration> 
      <defaultLibBundleDir>lib</defaultLibBundleDir> 
      <generatedDescriptorLocation>${basedir}/src/main/application/META-INF</generatedDescriptorLocation> 
      <modules> 
       <webModule> 
        <groupId>com.foo</groupId> 
        <artifactId>myWeb</artifactId>      
        <contextRoot>/myWeb</contextRoot> 
       </webModule> 
       <webModule> 
        <groupId>com.foo</groupId> 
        <artifactId>myWS</artifactId>      
        <contextRoot>/</contextRoot> 
       </webModule> 
      </modules> 
       <archive> 
        <addMavenDescriptor>false</addMavenDescriptor> 
       </archive> 
     </configuration> 
     </plugin> 
    </plugins> 

     <directory>${basedir}/../target/diraliases/EARHOMEDIR1036</directory> 
     <finalName>myEar</finalName> 

    </build> 

</project> 
+0

なぜ「 $ {basedir}/..」を設定しましたか?現在のモジュールの外にありますか? 'myEAR'フォルダの内容を確認しましたか? – khmarbaise

+0

それは長い話です...私の会社の変更管理に苦情を言わせるには、そのディレクトリに耳が必要です。とにかく.earとfolderは同じ内容です。 – tortugone

答えて

0

私は番目のmaven-antrun-プラグインで固定... Mavenの内部アリコール。 ..非常に汚い...誰かがより良いアイデアを持っていますか?

<plugin> 
    <artifactId>maven-antrun-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>deleteDir</id> 
      <phase>package</phase> 
      <configuration> 
       <tasks> 
        <delete dir="${basedir}/../target/diraliases/EARHOMEDIR1036/myEar"/> 
       </tasks> 
      </configuration> 
      <goals> 
       <goal>run</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 
関連する問題