Issue with Adding Dependency in Gradle in PrimeFaces gradle 11.0.0

Olaf Kock, modified 1 Year ago. New Member Posts: 6 Join Date: 1/2/24 Recent Posts

I am currently working on a project using PrimeFaces, and I am encountering a problem when trying to add another project as a dependency in Gradle. Here are the details:

  • Project Structure:

    • I have a multi-module project.
    • The target project I want to include is located at :modules:x-portlet:x-portlet-api.
    • I have created module project using MVC template and then add PrimeFaces plugins and change the folder structure according to primefaces.
  • Dependency Statement:

    • I am using the following statement in my build.gradle file to add the dependency:

      compileOnly project(":modules:x-portlet:x-portlet-api")

  • Issue:

    • After running compileOnly project(), the project is not added to the dependencies, and no error is displayed.
  • Troubleshooting Steps Taken:

    • I have confirmed that the path is correct.
    • The target project is a valid Gradle project with a build.gradle file.
    • Checked for typos and syntax errors in my build.gradle file.
    • Tried by using API instead of CompileOnly.
  • Request for Assistance:

    • Can you please guide me on how to correctly add the x-portlet-api project as a dependency in my Gradle project?
  • Additional Information:

    • I am using PrimeFaces version 11.0.0.
    • I am using Liferay version portal 7.4 GA 105.
    • com.liferay.gradle.plugins.workspace = 9.0.12
  • PrimeFaces build.gradle:

repositories {
     mavenCentral()
     
}

dependencies {
    compileOnly group: "com.liferay.portal", name: "release.portal.api"
    
    compileOnly project(":modules:x-portlet:x-portlet-api")
  
    implementation group: 'org.primefaces', name: 'primefaces', version: '11.0.0'
    implementation group: 'com.liferay.faces', name: 'com.liferay.faces.bridge.ext', version: '8.0.1'
    implementation group: 'com.liferay.faces', name: 'com.liferay.faces.bridge.impl', version: '6.0.0'
    implementation group: 'com.liferay.faces', name: 'com.liferay.faces.portal', version: '6.0.0'
    implementation group: 'com.liferay.faces', name: 'com.liferay.faces.util', version: '4.0.0'
    implementation group: 'org.glassfish', name: 'javax.faces', version: '2.4.0'    
            
}

Thank you for your assistance!