[GRADLE-1963] Maven plugin should not have a hard dependency on the JavaPlugin Created: 25/Nov/11  Updated: 29/Nov/16  Resolved: 29/Nov/16

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-5
Fix Version/s: None

Type: Improvement
Reporter: Yennick Trevels Assignee: Unassigned
Resolution: Fixed Votes: 5


Currently the Maven plugin has a hard dependency on the JavaPlugin. Because of this it only adds the install task when it can find the JavaPlugin.
This is the piece of code that is causing this in the MavenPlugin.java file:

plugins.withType(JavaPlugin.class, new Action<JavaPlugin>() {
public void execute(JavaPlugin javaPlugin)

{ configureJavaScopeMappings(project.getConfigurations(), pluginConvention.getConf2ScopeMappings()); configureInstall(project); }


This is a big problem for me because I'm writing a plugin for Gradle to build Flex applications (called GradleFx), so I don't want to apply the Java plugin to my flex projects and because of that the install task isn't added when I apply the maven plugin to my Flex project.

I think the Maven plugin should work against a contract instead of against a hard dependency to the JavaPlugin. The only thing it needs is imo a task named "compile" and a configuration named "archives", so when it finds those it can add the install task.

Comment by Adam Murdoch [ 03/Sep/13 ]

This is fixed in the new `maven-publish` plugin, but not the old `maven` plugin.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Yennick Trevels [ 29/Nov/16 ]

Since this has been fixed in the new maven-publish plugin for several years now, this issue can be closed.

Comment by Benjamin Muschko [ 29/Nov/16 ]

The Maven plugin doesn't do that anymore either. It only applies the base plugin and then reacts to the JavaPlugin if it is applied.

Generated at Wed Jun 30 12:09:05 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.