RE: Applying Maven plugin to gradle project

thumbnail
Eric COQUELIN, modified 6 Years ago. Expert Posts: 254 Join Date: 11/3/13 Recent Posts

Dear community,

 

I have one up & running project under Eclipse using Gradle. However, I have noticed that compiled jars do not end up into my maven repository. So I have been looking for one solution and found that page https://dev.liferay.com/develop/reference/-/knowledge_base/7-1/maven-plugin-builder-gradle-plugin

 

It says that I should refer to another plugin which I did

<cite>buildscript {<br> &nbsp;&nbsp; &nbsp;dependencies {<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.10.9"<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;classpath group: "com.liferay", name: "com.liferay.gradle.plugins.maven.plugin.builder", version: "1.2.0"<br> &nbsp;&nbsp; &nbsp;}</cite>

<cite>&nbsp;&nbsp; &nbsp;repositories {<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;maven {<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;url "https://repository-cdn.liferay.com/nexus/content/groups/public"<br> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br> &nbsp;&nbsp; &nbsp;}<br> }</cite>

<cite>apply plugin: "com.liferay.maven.plugin.builder"<br> apply plugin: "net.saliman.properties"<br> apply plugin: "com.liferay.workspace"</cite>

 

Then, I refreshed my Liferay workspace but it doesn't compile anymore.

FAILURE: Build failed with an exception.

* Where:<br> Settings file '/home/ecoquelin/workspaces/demolr71/plugins/settings.gradle' line: 18

* What went wrong:<br> A problem occurred evaluating settings 'plugins'.<br> &gt; Failed to apply plugin [id 'com.liferay.maven.plugin.builder']<br> &nbsp;&nbsp; &gt; org.gradle.initialization.DefaultSettings_Decorated cannot be cast to org.gradle.api.Project

* Try:<br> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

Is the documentation up to date ? Do I miss something (very probably) ?

 

Thank you in advance for your feedbacks

 

thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Very often this is a gradle version issue, you're using a version which is newer than what the plugin supports.