运行maven项目时一直报错org.codehaus.mojo:exec-maven-plugin:1.2.1的问题

九爸爸 2018-12-08 03:36:20
其实还没怎么使用过maven,今天下载了个项目之后一直在学习怎么去运行maven的项目,这个问题已经出现很久了都解决不了,希望有人能帮帮我。
报错如下:

Scanning for projects...

------------------------------------------------------------------------
Building arp 1.0-SNAPSHOT
------------------------------------------------------------------------

--- exec-maven-plugin:1.2.1:exec (default-cli) @ arp ---
java.lang.NoClassDefFoundError: jpcap/packet/DatalinkPacket
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: jpcap.packet.DatalinkPacket
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.252s
Finished at: Sat Dec 08 15:31:24 CST 2018
Final Memory: 5M/123M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project arp: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

然后我的POM.xml是这样的
<?xml version="1.0" encoding="UTF-8"?>

<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>me.codz</groupId>
<artifactId>arp</artifactId>
<version>1.0-SNAPSHOT</version>


<dependencies>
<dependency>
<groupId>jpcap</groupId>
<artifactId>jpcap</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${pom.basedir}/jar/jpcap.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</dependency>


</dependencies>



<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>

<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>

</configuration>

</plugin>
</plugins>
</build>
</project>


有一个问题就是我这里也没有加org.codehaus.mojo的那个plugin啊为什么一直提示它的错误呢?
...全文
3685 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
妖x月 2020-10-22
  • 打赏
  • 举报
回复
因为你加的这些依赖里,有依赖又依赖于这个没加的依赖

50,527

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧