TestNg安装报错:No repository found containing: osgi.bundle,com.beust.jcommander,1.72.0

通过eclipse安装TestNg,过程如下:

1.点击help-->Install New Software

2.打开如下窗口,点击add,name自定义输入,Location中输入http://beust.com/eclipse,点击add

3.下面的窗口中等待加载后,会出现TestNG,全部勾选,点击下一步,后面一路点击下一步,最后一步选择我同意,点击finish,等待安装即可。

遇到的问题

在安装的过程中报错,报错内容如下:

An error occurred while collecting items to be installed
session context was:(profile=_Users_macbook_Applications_eclipse_Eclipse.app_Contents_Eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,com.beust.jcommander,1.72.0
No repository found containing: osgi.bundle,com.beust.jcommander.source,1.72.0
No repository found containing: osgi.bundle,org.apache-extras.beanshell.bsh,2.0.0.b6
No repository found containing: osgi.bundle,org.apache-extras.beanshell.bsh.source,2.0.0.b6
No repository found containing: osgi.bundle,org.testng,6.14.3.r201802240500
No repository found containing: osgi.bundle,org.testng.eclipse,6.14.3.201902250526
No repository found containing: org.eclipse.update.feature,org.testng.eclipse,6.14.3.201902250526
No repository found containing: osgi.bundle,org.testng.eclipse.maven,6.14.3.201902250526
No repository found containing: org.eclipse.update.feature,org.testng.eclipse.maven.feature,6.14.3.201902250526
No repository found containing: org.eclipse.update.feature,org.testng.p2.feature,6.14.3.r201802240500
No repository found containing: osgi.bundle,org.testng.source,6.14.3.r201802240500
No repository found containing: osgi.bundle,org.yaml.snakeyaml,1.17.0
No repository found containing: osgi.bundle,org.yaml.snakeyaml.source,1.17.0

上网搜了一圈,原因是因为缺少依赖的jar包引起的。

解决方法:

上网搜索jcommander的1.72版本jar包,下载完成后,在eclipse中导入外部依赖jar包

1.选择一个工程,点击右键,选择BuildPath-->Configure Build Path

2.点击Add External JARs...,选择下载的jar,添加完成后,点击右下角的Apply即可。

 3.添加完依赖jar包后,重新按照上面的步骤安装一遍即可。

4.安装完成后,重启eclipse,安装成功验证:点击Window-->Show View-->Other;java中出现TestNG,即安装成功。

猜你喜欢

转载自www.cnblogs.com/Tracy-test/p/11349257.html