RE: Refer service builder jar in many portlet in Liferay 6.2 using maven

Anji E, modified 6 Years ago. Junior Member Posts: 49 Join Date: 11/18/14 Recent Posts
Hello All,

Am trying to refer the service builder jar in other portlet module.

project-a
  project-a-portlet
  project-a-portlet-service.


in project project-b pom.xml i have provided below dependency.
  
  <dependency>
            <groupId>some group id</groupId>
            <artifactId>project-a-portlet-service</artifactId>
            <version>1.0.0</version>
   </dependency>
  
I observed a strage behaviour.  project-a-portlet-service.jar is including at runtime but not at compile time. 
When I extract the project-b.war could see the project-a-portlet-service.jar in web-inf/lib folder. But it is not there at compile time.

Please let me know If am missing anything in project-b pom.xml
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
It should not be there either at compile time nor runtime, there is nothing magical about service builder with respect to maven.

Maven looks up and includes artifacts from a repository.

To share your service jar, you need to publish it to a local repository. If you are a sole developer, you can just use the mvn install command to push the artifacts to the .m2 local cache. If you are a team, then you need a nexus or artifactory to be your local repository.

​​​​​​​
Amos Fong, modified 6 Years ago. Junior Member Posts: 49 Join Date: 11/18/14 Recent Posts
Hello David,

Thanks a lot for your quick reply .... 

Its was a basic mistake from my end. I did not do the maven update for my project.
I did , now I could see the jar in maven dependency. 

​​​​​​​