{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/2593","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/2593/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/2593/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/2593/events","html_url":"https://github.com/gradle/gradle/issues/2593","id":245726439,"number":2593,"title":"MavenPublication: properties of AbstractArchiveTask not considered","user":{"login":"kuzuk","id":4450328,"avatar_url":"https://avatars3.githubusercontent.com/u/4450328?v=4","gravatar_id":"","url":"https://api.github.com/users/kuzuk","html_url":"https://github.com/kuzuk","followers_url":"https://api.github.com/users/kuzuk/followers","following_url":"https://api.github.com/users/kuzuk/following{/other_user}","gists_url":"https://api.github.com/users/kuzuk/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzuk/subscriptions","organizations_url":"https://api.github.com/users/kuzuk/orgs","repos_url":"https://api.github.com/users/kuzuk/repos","events_url":"https://api.github.com/users/kuzuk/events{/privacy}","received_events_url":"https://api.github.com/users/kuzuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-26T13:42:50Z","updated_at":"2017-07-26T16:12:51Z","closed_at":null,"body":"<!--- Provide a brief summary of the issue in the title above -->\r\n<!--- We kindly ask you to open any issues related to the Gradle Android plugin or Android Studio on the Android Issue Tracker at `https://source.android.com/source/report-bugs` -->\r\nMavenPublication can reference Jar and Zip tasks but does not consider the attributes (baseName, appendix, version, classifier and extension) of AbstractArchiveTask\r\n\r\n\r\n```\r\ntask customJar(type: Jar, dependsOn: jar) {\r\n    baseName 'my-custom-artifact'\r\n    ....\r\n}\r\nassemble.dependsOn customJar\r\n```\r\n\r\n```\r\npublishing {\r\n\tpublications {\r\n        \tpublishJars(MavenPublication) {\r\n\t            \tfrom components.java\r\n \t\t\tartifact customJar\r\n\t    \t}\r\n\t}\r\n}\r\n```\r\n### Expected Behavior\r\nAn artifact with artifactId 'my-custom-artifact' is published\r\n\r\n\r\n### Current Behavior\r\nAn artifact with artifactId=project-name is published \r\n...or...\r\n> Failed to publish publication 'publishJars' to repository 'maven'\r\n> Invalid publication 'publishJars': multiple artifacts with the identical extension and classifier ('jar', 'null').\r\n\r\n### Context\r\nJar tasks allow for defining custom jars in a nice way. MavenPublication should support publishing those jars naturally. However, it will not consider the baseName and AFAIU does not consider any of the other properties. Instead it uses the project name as artifactId. An artifactId can be defined in MavenPublication, but it then applies for the whole project. So again publishing different artifactIds is not possible.\r\n\r\n\r\n### Steps to Reproduce (for bugs)\r\nsee snippets above\r\n\r\n### Your Environment\r\n\r\n> ------------------------------------------------------------\r\n> Gradle 4.0\r\n> ------------------------------------------------------------\r\n> \r\n> Build time:   2017-06-14 15:11:08 UTC\r\n> Revision:     316546a5fcb4e2dfe1d6aa0b73a4e09e8cecb5a5\r\n> \r\n> Groovy:       2.4.11\r\n> Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015\r\n> JVM:          1.8.0_131 (Oracle Corporation 25.131-b31)\r\n> OS:           Linux 2.6.32-696.3.2.el6.x86_64 amd64\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/318103496","html_url":"https://github.com/gradle/gradle/issues/2593#issuecomment-318103496","issue_url":"https://api.github.com/repos/gradle/gradle/issues/2593","id":318103496,"user":{"login":"bmuschko","id":440872,"avatar_url":"https://avatars2.githubusercontent.com/u/440872?v=4","gravatar_id":"","url":"https://api.github.com/users/bmuschko","html_url":"https://github.com/bmuschko","followers_url":"https://api.github.com/users/bmuschko/followers","following_url":"https://api.github.com/users/bmuschko/following{/other_user}","gists_url":"https://api.github.com/users/bmuschko/gists{/gist_id}","starred_url":"https://api.github.com/users/bmuschko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmuschko/subscriptions","organizations_url":"https://api.github.com/users/bmuschko/orgs","repos_url":"https://api.github.com/users/bmuschko/repos","events_url":"https://api.github.com/users/bmuschko/events{/privacy}","received_events_url":"https://api.github.com/users/bmuschko/received_events","type":"User","site_admin":false},"created_at":"2017-07-26T16:12:51Z","updated_at":"2017-07-26T16:12:51Z","body":"As far as I know Maven does not support changing the base name, appendix or the version for artifacts that are published together. Makes sense to me as they will end up in the same place on the Maven repo. Please be aware that this is different from Ivy if that's what you are used to. \r\n\r\nHowever, changing the `classifier` and `extension` works fine and also [lines up with their documentation](https://maven.apache.org/pom.html#Maven_Coordinates). See the following example demonstrates the use case:\r\n\r\n```\r\napply plugin: 'java'\r\napply plugin: 'maven-publish'\r\n\r\nversion = '1.0'\r\ngroup = 'com.company'\r\n\r\ntask sourcesJar(type: Jar) {\r\n    classifier 'sources'\r\n    extension 'aar'\r\n    from sourceSets.main.allSource\r\n}\r\n\r\nartifacts {\r\n    archives sourcesJar\r\n}\r\n\r\npublishing {\r\n    publications {\r\n        mavenPub(MavenPublication) {\r\n            from components.java\r\n            artifact sourcesJar\r\n        }\r\n    }\r\n\r\n    repositories {\r\n        maven {\r\n            url \"$buildDir/repo\"\r\n        }\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"bmuschko"}}