本文介绍了更新Gradle引用以包括maven本地jar(libGDX& Tween Engine)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照以下步骤设置外部依赖关系:





(部分:外部依赖关系示例>>使用maven的universal-tween-engine)



之后,我检查maven repo目录,文件在那里:



C:\Users\Admin.m2\repository\aurelienribon\tweenengine\6.3.3





执行gradlew bat重建项目不会返回错误:





我缺少一些东西,因为在Eclipse中没有看到引用Tween引擎:





显然,如果我尝试在我的代码上添加对Tween引擎的引用,我会得到一个错误: / p>



如何在现有的gradle项目中设置一个新的引用,在这种情况下,使用libGDX使用Tween Engine?

解决方案

你做的一切都正确,只是添加依赖关系不会刷新eclipse中的依赖项。



你必须在eclipse中标记所有相关的项目,右键单击它们并执行 Gradle - >刷新依赖关系。根据您的改变,您甚至可能需要执行 Gradle - >刷新全部



这将更新eclipse中的依赖项,您将找到所需的类。


I follow this steps for setting External dependencies:

https://github.com/libgdx/libgdx/wiki/Dependency-management-with-Gradle

(section: External Dependencies Examples >> universal-tween-engine using maven)

After do that, i check maven repo direcory and the files are there:

C:\Users\Admin.m2\repository\aurelienribon\tweenengine\6.3.3

Executing gradlew bat for rebuilding the project returns no errors:

I'm missing something because in Eclipse didn't see the references to Tween engine:

And obviously, if i try to add a reference to Tween Engine on my code i get an error:

How can i set up a new reference on existing gradle project, using libGDX for using Tween Engine in this case?

解决方案

You did everything correct, but just adding the dependencies will not refresh the dependencies in eclipse.

You have to mark all related projects in eclipse, right click them and perform a Gradle -> Refresh Dependencies. Depending on what exactly you have changed, you might even need to do a Gradle -> Refresh All.

This will update the dependencies in eclipse and you will find the needed classes.

这篇关于更新Gradle引用以包括maven本地jar(libGDX& Tween Engine)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 08:11