1

Mavenの達人、ここで初心者を助けてください:

私のPOMは次のようになります。

<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>
  <groupId>org.pidac.webservices</groupId>
  <artifactId>axis2test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <name>Axis2-test</name>

   <build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-aar-maven-plugin</artifactId>
                <version>1.6.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>axis2-aar:aar</goal>
                        </goals>
                        <configuration>                             
                            <fileSets>
                                <fileSet>
                                     <directory>${project.build.directory}/aar</directory>
                                     <outputDirectory>/</outputDirectory>
                                </fileSet>
                                <fileSet>
                                    <directory>$(basedir)/src/main/webapp/META-INF</directory>
                                    <outputDirectory>META-INF</outputDirectory>
                                </fileSet>                                  
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </pluginManagement>
   </build>   
</project>

私のフォルダ構造は次のようになります。

ここに画像の説明を入力

私のデバッグ構成には、次の目標のリストがあります。

クリーン インストール axis2-aar:aar

Eclipse で、[Debug As] コンテキスト メニューから Maven ビルドを実行すると、プロジェクトを右クリックすると、次の出力に示すように、ターゲット フォルダーに aar が表示されます。

DEBUG] Exploding aar...
[DEBUG] Assembling aar axis2test in C:\Users\nji\workspace\axis2test\target\aar
[INFO] Generating aar C:\Users\nji\workspace\axis2test\target\axis2test-0.0.1-SNAPSHOT.aar
[INFO] Building jar: C:\Users\nji\workspace\axis2test\target\axis2test-0.0.1-SNAPSHOT.aar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory com/
[DEBUG] adding directory com/pidac/
[DEBUG] adding directory com/pidac/axis2test/
[DEBUG] adding directory com/pidac/axis2test/api/
[DEBUG] adding directory com/pidac/axis2test/lib/
[DEBUG] adding entry com/pidac/axis2test/api/Hello.class
[DEBUG] adding entry com/pidac/axis2test/api/Weather.class
[DEBUG] adding entry com/pidac/axis2test/lib/HelloImpl.class
[DEBUG] adding entry com/pidac/axis2test/lib/WeatherService.class
[DEBUG] adding directory META-INF/maven/
[DEBUG] adding directory META-INF/maven/org.pidac.webservices/
[DEBUG] adding directory META-INF/maven/org.pidac.webservices/axis2test/
[DEBUG] adding entry META-INF/maven/org.pidac.webservices/axis2test/pom.xml
[DEBUG] adding entry META-INF/maven/org.pidac.webservices/axis2test/pom.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

しかし、7-Zip を使用してこの AAR を手動で展開すると、services.xml がどこにも見つかりません。
ここのドキュメントMaven2 AAR Plug-in Guideは言う

services.xml ファイルの場所。デフォルトでは、ファイルはすでに classesDirectory/META-INF に存在すると想定されており、特別な処理は必要ありません。

しかし、ビルドが完了した後に classesDirectory を見ると、META-INF フォルダーはありません。

私は何が欠けていますか?

4

1 に答える 1

0

より多くのことを試して、行間を読む必要がありました:

ドキュメンテーションはこちらMaven2 AAR プラグイン ガイドは、このプラグインの servicesXmlFile 構成パラメーターを明確にする必要があり、役に立ちませんでした。Eclipse 内で POM.xml を編集するときに Intellisense を取得できた場合は、この構成パラメーターのより適切な説明を取得できます。

これを修正するには、次の 3 つの方法があります。

  1. src/main/resources の下に META-INF フォルダーを作成し、services.xml を追加します。

  2. POM のプロジェクトの設定で、次の構成を入力します。

    META-INF false ${basedir}/src/main/webapp/META-INF services.xml

  3. 次のように、プラグインの構成設定で services.xml へのパスを入力します。

    org.apache.axis2 axis2-aar-maven-plugin 1.6.2 axis2-aar:aar
    ${baseDir}/src/main/webapp/META-INF
    ${project.build.directory}/aar /

おそらく間違ったパスが原因で、この代替手段を機能させることができませんでした。たぶん誰かがコメントすることができます。

于 2012-07-03T15:57:30.217 に答える