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 Build 时,右键单击项目时会出现,我将 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 文件夹。
我错过了什么?