无法访问Java库
注意:我之所以问/回答这个问题,是因为我在其他地方没有找到解决方案 尝试运行maven项目时,我在ServerMain.java文件中收到以下错误消息: 无法访问org.eclipse.jetty.util.thread.ThreadPool 我有jar文件,我在pom.xml文件中添加了无法访问Java库,java,maven,jetty,pom.xml,Java,Maven,Jetty,Pom.xml,注意:我之所以问/回答这个问题,是因为我在其他地方没有找到解决方案 尝试运行maven项目时,我在ServerMain.java文件中收到以下错误消息: 无法访问org.eclipse.jetty.util.thread.ThreadPool 我有jar文件,我在pom.xml文件中添加了org.eclipse.jett:jetty util,但无论我如何添加库,我仍然无法访问它。下面是如何将其包含在我的pom.xml中的 <!-- https://mvnrepository.com/ar
org.eclipse.jett:jetty util
,但无论我如何添加库,我仍然无法访问它。下面是如何将其包含在我的pom.xml中的
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.1.5.v20140505</version>
<scope>test</scope>
</dependency>
org.eclipse.jetty
码头
9.1.5.v20140505
测试
我知道发生了什么。我需要从xml中删除
标记。我不确定它一开始是如何出现的,因为maven站点并没有限制它的应用范围。需要像这样包含依赖项
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>9.1.5.v20140505</version>
</dependency>
org.eclipse.jetty
码头
9.1.5.v20140505
。