我无法完成使用maven的原生maven插件的第一步。我看过一些关于它的复杂性的帖子,但在此之前,我的pom.xml失败了,原因是:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project mytest:hello:1.0-SNAPSHOT (/home/vagrant/hello-native/pom.xml) has 1 error
[ERROR] Unknown packaging: a @ line 8, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException注意“未知打包: a";简而言之,它不像"a",但我在其他人的示例和Maven网站上看到了这一点。我尝试了"so“而不是"a",但没有区别,它仍然无法使用”未知的封装“。
这是我的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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mytest</groupId>
<artifactId>hello</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>a</packaging>
<name>libHello.a</name>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-8</version>
<configuration>
<compilerStartOptions>
<compilerStartOption>${commonCompilerOptions}</compilerStartOption>
</compilerStartOptions>
<sources>
<source>
<directory>src</directory>
<fileNames>
<fileName>HelloWorld.c</fileName>
</fileNames>
</source>
</sources>
<linkerProvider>ar</linkerProvider>
<linkerStartOptions>
<linkerStartOption>-r</linkerStartOption>
</linkerStartOptions>
</configuration>
</plugin>
</plugins>
</build>
</project>发布于 2014-12-02 02:50:35
好吧,我想通了。该插件需要将'extensions‘标记设置为真,因此pom.xml现在包含"<extensions>true</extensions>",如下所示:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<extentions>true</extensions>
<version>1.0-alpha-8</version>
...
</plugin>在Mojo Native Maven Plugin Usage页面中提到了这一点。
https://stackoverflow.com/questions/27161572
复制相似问题