[GRADLE-3021] 'latest.release' version results with improper POM for uploadArchives task Created: 12/Feb/14 Updated: 13/Jan/15 Resolved: 09/Dec/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 2.3-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | René Gröschke (Inactive) |
Resolution: | Fixed | Votes: | 0 |
Description |
Following code at build.gradle: dependencies { When publishing to maven repo will result with such dependency respectively at created POM: <dependency> That's not a valid version for Maven, is it? Maven build will fail with a dependency at pom.xml specified like this. Is there any way of replacing 'latest.version' (or any other 'text' variable version) with version of an actual resolved artifact upon archive upload? |
Comments |
Comment by Gradle Forums [ 12/Feb/14 ] |
OK, I guess it would be something like this: uploadArchives { .each { dependency -> dependency.version = id.version Probably it would be better to do it for all configurations and even without filtering by it.version == 'latest.release'. Just overwrite all. By the way, why maven plugin doesn't do it by default? Or maybe there is some simpler approach available via its API? It rather doesn't make sense, to generate POM upon deploying to maven repo and then not being able to use deployed artifact as maven dependency because any maven build will fail on unrecognised version of transitive dependencies. |