[英]native-maven-plugin fails on “a” packaging type
我無法完成使用Maven的native-maven-plugin的第一步。 我已經看到了一些有關其復雜性的帖子,但是我的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”; 簡而言之,它不喜歡“ <packaging> a </ packaging>”,但是我在其他示例和Maven網站上看到了這一點。 我嘗試用“ so”代替“ a”,但沒有區別,它仍然會因“ Unknown packaging”而失敗。
這是我的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>
好吧,我知道了。 該插件需要將'extensions'標記設置為true,因此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本機Maven插件使用情況頁面中提到了這一點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.