问题java gradle“找不到org.jnetpcap:jnetpcap:1.4.1。”

问题描述 投票:1回答:1

对于个人项目,我想使用此git项目:https://github.com/ahlashkari/CICFlowMeter,或者我有一个问题,是:

type Jar
type JavaExec
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.jnetpcap:jnetpcap:1.4.1.
  Searched in the following locations:
      file:/root/.m2/repository/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      file:/root/.m2/repository/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
      https://repo.maven.apache.org/maven2/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      https://repo.maven.apache.org/maven2/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
      https://clojars.org/repo/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.pom
      https://clojars.org/repo/org/jnetpcap/jnetpcap/1.4.1/jnetpcap-1.4.1.jar
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
1 actionable task: 1 executed

我做了git的要求:

//linux :at the pathtoproject/jnetpcap/linux/jnetpcap-1.4.r1425
//windows: at the pathtoproject/jnetpcap/win/jnetpcap-1.4.r1425
mvn install:install-file -Dfile=jnetpcap.jar -DgroupId=org.jnetpcap -DartifactId=jnetpcap -Dversion=1.4.1 -Dpackaging=jar

然后

//linux:
$ sudo bash
$ gradle execute

//windows:
$ gradlew execute

(我在Fedora上)

您有什么想法吗?谢谢您的时间。

java gradle
1个回答
0
投票

经过几次搜索,这是我解决此问题的方法:

我打开了build.gradle,在第20行我替换了:

compile group: 'org.jnetpcap', name: 'jnetpcap', version:'1.4.1'

作者

compile group: 'jnetpcap', name: 'jnetpcap', version:'1.4.r1425-1g'

就是这样!

© www.soinside.com 2019 - 2024. All rights reserved.