How do I satisfy new milestone 6 warnings elicited by the maven plugin?


(Blaine Simpson) #1

I understand from the migration guide that getPomDirName(), setPomDirName(), getPomDir() are all deprecated, but I am not calling those methods. I am just using the Gradle-bundled maven plugin in the documented way and I get the following warnings:

The MavenPluginConvention.getPomDirName() method is deprecated and will be removed in the next version of Gradle. You should use the getMavenPomDir() method instead.
The MavenPluginConvention.getPomDir() method is deprecated and will be removed in the next version of Gradle. You should use the getMavenPomDir() method instead.

How do I satisfy?


(Peter Niederwieser) #2

Which other plugins do you use? Maybe one of them calls a deprecated method.


(Blaine Simpson) #3

Looks to me like a problem with Gradle core or with the Gradle-supplied maven plugin.

Problem occurs if you simply reference ‘project.properties’ after applying the maven plugin. Here is a test case build file:

defaultTasks 'noop'
task noop << { }
  apply plugin: 'maven'
  println 'Properties count = ' + project.properties.size()

You can eliminate the warnings by just commenting out the maven plugin.


(Peter Niederwieser) #4

By accessing all properties, you also access the deprecated ones. Try to access only the properties you need, with Project.property().


(Blaine Simpson) #5

Based on that, I guess that the Maven plugin is adding deprecated properties then.

I already apply criteria to the properties that I work with, but I need to iterate to test the criteria. The effected item is a general plugin and I don’t require my users to use specific property names.

Project.getProperties is a public method: http://www.gradle.org/current/docs/javadoc/org/gradle/api/Project.html#getProperties() I should not be spanked for invoking a method in Gradle’s public API. It is Gradle system bug if simply invoking a public method generates warning messages about items in the Gradle distribution itself. I didn’t add any deprecated properties, so the problem is with Gradle.


(Peter Niederwieser) #6

Based on that, I guess that the Maven plugin is adding deprecated properties then.

Not sure what you mean by that.

I didn’t add any deprecated properties, so the problem is with Gradle.

Feel free to create an issue, or, even better, a pull request.


(Blaine Simpson) #7

Re: Not sure what you meant by that.

You explained to me that by accessing .properties, one accesses deprecated properties too. Since no warning is produced unless the maven plugin is applied, I think it’s safe to deduce: Based on that, I guess that the Maven plugin is adding deprecated properties then. No?


(Peter Niederwieser) #8

Yes, MavenPluginConvention is added by the Maven plugin.


(Matias Bjarland) #9

FYI: It seems that one somewhat unintuitive way of getting this warning is by using the gradle-artifactory plugin. With M6 and by using both the ‘maven’ plugin and the ‘artifactory’ plugin (version 2.0.7) and running a “gradle build” we get:

The MavenPluginConvention.getPomDirName() method is deprecated and will be removed in the next version of Gradle. You should use the getMavenPomDir() method instead.
The MavenPluginConvention.getPomDir() method is deprecated and will be removed in the next version of Gradle. You should use the getMavenPomDir() method instead.

I will ping the jfrog guys on this and see if the above is correct or if I missed something here.