Gradle 6.0不推荐使用IvyArtifactRepository.layout(String,Closure)方法

时间:2019-01-09 23:11:18

标签: java jenkins-plugins artifactory

当我在gradle版本中使用--warning-mode all时,我收到以下消息:

IvyArtifactRepository.layout(String,Closure)方法已被弃用。计划在Gradle 6.0中将其删除。请改用Ivy​​ArtifactRepository.patternLayout(Action)方法。

当我添加--stacktrace参数时,我得到了完整的上下文,但是stac跟踪中没有引用我的build /代码,因此不确定如何解决这个问题。

这是我得到的堆栈跟踪:

IvyArtifactRepository.layout(String,Closure)方法已被弃用。计划在Gradle 6.0中将其删除。请改用Ivy​​ArtifactRepository.patternLayout(Action)方法。         在org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository.layout(DefaultIvyArtifactRepository.java:299)         在java.lang.reflect.Method.invoke(Method.java:498)         在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener $ _createIvyRepo_closure3.doCall(ProjectsEvaluatedBuildListener.groovy:104)处         在java.lang.reflect.Method.invoke(Method.java:498)         在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)         在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)         在groovy.lang.Closure.call(Closure.java:411)         在groovy.lang.Closure.call(Closure.java:427)         在org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:70)         在org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)         在org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)         在org.gradle.util.ConfigureUtil $ WrappedConfigureAction.execute(ConfigureUtil.java:166)         在org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.addRepository(DefaultArtifactRepositoryContainer.java:89)         在org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.ivy(DefaultRepositoryHandler.java:110)         在org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.ivy(DefaultRepositoryHandler.java:114)         在org.gradle.api.artifacts.dsl.RepositoryHandler $ ivy $ 0.call(未知源)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.createIvyRepo(ProjectsEvaluatedBuildListener.groovy:101)         在java.lang.reflect.Method.invoke(Method.java:498)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.defineResolvers(ProjectsEvaluatedBuildListener.groovy:81)         在java.lang.reflect.Method.invoke(Method.java:498)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.evaluate(ProjectsEvaluatedBuildListener.groovy:69)         在java.lang.reflect.Method.invoke(Method.java:498)         在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener $ _projectsEvaluated_closure4.doCall(ProjectsEvaluatedBuildListener.groovy:126)         在java.lang.reflect.Method.invoke(Method.java:498)         在groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)         在groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)         在groovy.lang.Closure.call(Closure.java:411)         在groovy.lang.Closure.call(Closure.java:427)         在org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.projectsEvaluated(ProjectsEvaluatedBuildListener.groovy:124)         在java.lang.reflect.Method.invoke(Method.java:498)         在org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator $ BuildOperationEmittingInvocationHandler $ 1 $ 1.run(DefaultListenerBuildOperationDecorator.java:240)处         在org.gradle.configuration.internal.DefaultUserCodeApplicationContext.reapply(DefaultUserCodeApplicationContext.java:58)         在org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator $ BuildOperationEmittingInvocationHandler $ 1.run(DefaultListenerBuildOperationDecorator.java:236)处         在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)处         在org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)上         在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)         在org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)         在org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator $ BuildOperationEmittingInvocationHandler.invoke(DefaultListenerBuildOperationDecorator.java:233)

1 个答案:

答案 0 :(得分:1)

我们才刚刚开始测试插件对Gradle 6未来版本的准备情况。在发布时,我们将确保重构,以免使用不推荐使用的方法。