我正在使用maven-dependency-plugin maven进行独立应用程序构建,并将依赖项添加到lib文件夹中的目标jar中,使用maven-assembly-plugin使用eclipse运行良好,没有任何问题,但是当尝试从命令行运行生成的jar文件时,我得到以下异常:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
at com.spring.sa
我们有一个像这样的maven项目结构:
Parent
L A
L B
A依赖于B
两者对其他库都有不同的依赖关系
使用mvn clean install构建它可以很好地工作,但是当我们尝试按照描述的方式修剪所有依赖项时
mvn dependency:purge-local-repository
我们得到一个错误,说它不能解析对B:jar:snapshot-version的依赖
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:purge-local-repository
正在编译我的pom.xml文件,并得到以下编译错误
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.5.1:copy-dependencies (copy-dependencies) on project ElasticSearchUtility: Error copying artifact from C:\Users\10641516\.m2\repository\org\apache\lucene\lucene-sandbox\7.1.0\lucene-sandbox-7.1.0.jar
在jar中的maven上构建项目后,我遇到了问题。
我打包并创建了.jar文件:
mvn package
在我运行jar文件之后
java -jar artifactId.jar
和get错误:
Error: Could not find or load main class com.emercit.app.App
如果我在目标目录中运行class,我得到类似错误:
cd target/classes/com/emercit/app
java App
Error: Could not find or load main class App
我在App类中的代码:
package com.eme
我正在从junit 4转移到junit 5。我在分析依赖关系时遇到了一个问题。当我运行mvn dependency:analyze时,出现错误: [WARNING] Used undeclared dependencies found:
[WARNING] junit:junit:jar:4.13:test
[INFO] Add the following to your pom to correct the missing dependencies:
[INFO]
<dependency>
<groupId>junit</groupId>