質問

私は、Mavenのは、WAR内の便利な場所にBIRTランタイムとWARを組み立てるために取得しようとしている。

BIRTランタイムは、

としてのpom.xmlであります
<dependency>
  <groupId>org.eclipse.birt</groupId>
  <artifactId>report-engine</artifactId>
  <version>2.3.2</version>
  <type>zip</type>
  <scope>runtime</scope>
</dependency>

これを重ねるの望ましい結果は、

のようなものです
ReportEngine/lib/*           -> WEB-INF/lib 
ReportEngine/configuration/* -> WEB-INF/platform/configuration 
ReportEngine/plugins/*       -> WEB-INF/platform/plugins 

私のオーバーレイ設定が

のようになります。
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <overlays>
      <overlay>
        <groupId>org.eclipse.birt</groupId>
        <artifactId>report-engine</artifactId>
        <type>zip</type>
        <includes>
          <include>ReportEngine/lib/*</include>
        </includes>
        <targetPath>WEB-INF/lib</targetPath>
      </overlay>
      <overlay>
        <groupId>org.eclipse.birt</groupId>
        <artifactId>report-engine</artifactId>
        <type>zip</type>
        <includes>
          <include>ReportEngine/configuration/*</include>
          <include>ReportEngine/plugins/*</include>
        </includes>
        <targetPath>WEB-INF/platform</targetPath>
      </overlay>
    </overlays>
  </configuration>
</plugin>

もちろん、私は見ているmvn war:explodedを実行するとき、

ReportEngine/lib/*           -> WEB-INF/lib/ReportEngine/lib/ 
ReportEngine/configuration/* -> WEB-INF/platform/configuration/ReportEngine/lib/ 
ReportEngine/plugins/*       -> WEB-INF/platform/plugins/ReportEngine/lib/

このは無回答、問題の同じ種類に関係ありません ます。http:// www.coderanch.com/t/447258/Ant-Maven-Other-Build-Tools/Maven-war-dependencies-moving-filesする

私はすべての作業WEB-INF/birt-runtimeの中からそれを持っていることによってビットを、これを整理することができますどのように指摘して

ボーナスポイント

編集ます:

/

上記の指定された場所のための理由は、 HTTPに示されたものと一致していることです私はこれを模倣するためにTomcatのインストールとフリッツとき/wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1 と、すべてでは動作しているようです。私は単にWEB-INF / BIRTランタイムにジップをオーバーレイして、適切にエンジンの設定を設定することができれば、それは理想的であるが、私はまだ仕事にことがわかっていませんでした。

例:

engineConfig = new EngineConfig();
engineConfig.setEngineHome("WEB-INF/birt-runtime");
engineConfig.setPlatformContext(new PlatformServletContext(servletContext));
役に立ちましたか?

解決

更新:質問を再読に私はそれがために申し訳ありませんが、私のために働い当然のように、私は、私のテストプロジェクトからサブディレクトリを逃し実現

私の知る限り、戦争のオーバーレイまたはディレクトリへのアーティファクトのサブフォルダを解凍し、パスの親要素を除外するための依存関係のプラグインのいずれかにはメカニズムが存在しない知っているように、両方のはあなたに完全な相対を提供するつもりされていますパスます。

ただし、<のhref =「http://maven.apache.org/plugins/maven-antrun-plugin/」のrel = "nofollowをを使用し、その後、一時フォルダにアーカイブを解凍するためにアンパック目標を使用することができます「noreferrer> antrun-プラグインには、その最終的な休憩場所に必要なサブフォルダをコピーします。

次の設定は、(私がまだ抜けがある場合は、正確な詳細については、マニュアルを参照して謝罪ので、これをテストしていませんでした)ちょうどそれを行うだろう。実行は同位相であるが、限り従属プラグインがantrun・プラグインの前に設定されているように、それが最初に実行されるであろう注意。準備パッケージは古いバージョンにしている場合は、別のフェーズを使用する必要があるだろう、Mavenの2.1の新機能です、注意します。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>unpack-lib</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>unpack</goal>
      </goals>
      <configuration>
        <artifactItems>
          <artifactItem>
            <groupId>org.eclipse.birt</groupId>
            <artifactId>report-engine</artifactId>
            <version>2.3.2</version>
            <type>jar</type>
            <overWrite>false</overWrite>
          </artifactItem>
        </artifactItems>
        <!--unpack all three folders to the temporary location-->
        <includes>ReportEngine/lib/*,ReportEngine/configuration/*,ReportEngine/plugins/*</includes>
        <outputDirectory>${project.build.directory}/temp-unpack</outputDirectory>
        <overWriteReleases>false</overWriteReleases>
      </configuration>
    </execution>
  </executions>
</plugin>
  <plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
      <execution>
        <phase>prepare-package</phase>
        <configuration>
          <tasks>
            <!--now copy the configuration and plugin sub-folders to WEB-INf/platform-->
            <copy todir="${project.build.directory}/WEB-INF/platform">
              <fileset dir="${project.build.directory}/temp-unpack/ReportEngine/configuration"/>
              <fileset dir="${project.build.directory}/temp-unpack/ReportEngine/plugins"/>
            </copy>
            <!--copy the lib sub-folder to WEB-INf/lib-->
            <copy todir="${project.build.directory}/WEB-INF/lib">
              <fileset dir="${project.build.directory}/temp-unpack/ReportEngine/lib"/>
            </copy>
          </tasks>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

他のヒント

本当に、自分の質問に答える上でリッチ売主に応答していない:)

これはmvn dependency:unpackで動作するように取得しようとすると、ドキュメントは、実行ノードの外にそれを取ると言います。それは結果の原因であるが、これは

で終わるかどうかわかりません
WEB-INF/lib/ReportEngine/lib
WEB-INF/platform/ReportEngine/configuration
WEB-INF/platform/ReportEngine/plugins

私の最初の戦争 - プラグインの試みとして、基本的に同じ。 私はdepedency-アンパック支援するためのドキュメントには何も表示されません。私はTMRWもう一度試してみます。

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>

      <configuration>
        <artifactItems>
          <artifactItem>
            <groupId>org.eclipse.birt</groupId>
            <artifactId>report-engine</artifactId>
            <version>2.3.2</version>
            <type>zip</type>
            <overWrite>false</overWrite>
            <!--may not be needed, need to check-->
            <outputDirectory>${project.build.directory}/WEB-INF/lib</outputDirectory>
            <includes>ReportEngine/lib/*</includes>
          </artifactItem>

          <artifactItem>
            <groupId>org.eclipse.birt</groupId>
            <artifactId>report-engine</artifactId>
            <version>2.3.2</version>
            <type>zip</type>
            <overWrite>false</overWrite>
            <!--may not be needed, need to check-->
            <outputDirectory>${project.build.directory}/WEB-INF/platform</outputDirectory>
            <includes>ReportEngine/configuration/*,ReportEngine/plugins/*</includes>
          </artifactItem>
        </artifactItems>
      </configuration>
</plugin>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top