我使用eclipse编译/运行我的项目。我试图在带有nar-maven-plugin的c ++项目上使用maven来构建它们。当我在命令行中启动maven目标时,它运行良好。
但是当我在eclipse中导入我的maven项目时,我有以下错误:
执行default-nar-compile of goal com.github.maven-nar:nar-maven-plugin:3.2.3:nar-compile failed:API 执行时遇到不兼容问题 com.github.maven-NAR:NAR-Maven的插件:3.2.3:NAR编译: java.lang.NoSuchMethodError: org.codehaus.plexus.util.DirectoryScanner.setupMatchPatterns()V -------------------------------------------------- --- realm = plugin> com.github.maven-nar:nar-maven-plugin:3.2.3 strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy ...
此外,eclipse似乎将我的项目作为Java项目而不是C项目来管理。
注意:我正在使用
Eclipse 4.3.1
M2E 1.4.0
CDT 8.3.0
我的pom.xml
<project
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>com.sample</groupId>
<artifactId>helloworld-cplusplus-sample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>nar</packaging>
<name>Helloworld</name>
<properties>
<rootdir>${project.basedir}</rootdir>
<nar.linker>gpp</nar.linker>
<nar.arch>x86</nar.arch>
<nar.os>Windows</nar.os>
</properties>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<versionRange>[3.2.3,)</versionRange>
<goals>
<goal>nar-test-unpack</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<fork>true</fork>
<compilerVersion>1.8</compilerVersion>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<linker>
<name>g++</name>
</linker>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sample</groupId>
<artifactId>helloworld-shared-library-sample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>nar</type>
</dependency>
</dependencies>
</project>
如果有人使用带有eclipse的nar-maven-plugin可以帮助我:)。我真的很想在日食上使用它。
谢谢!