Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » How to use maven dependencies in eclipse stardust dynamic web project?(When I convert the dynamic web project to maven project, it fails to build)
How to use maven dependencies in eclipse stardust dynamic web project? [message #1486433] Tue, 25 November 2014 03:12 Go to next message
Melissa Ferenal is currently offline Melissa FerenalFriend
Messages: 18
Registered: November 2014
Junior Member
Hi,

I followed the tutorial here to create a stardust web dynamic project and it all works fine.

I converted the project to a Maven project using eclipse m2e plugin and after that the project fails to build. It turns out that stardust standard libraries are not included anymore in the project.

Could you please help and assist to convert the stardust eclipse dynamic web project to a maven project?

Thanks
Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1486897 is a reply to message #1486433] Tue, 25 November 2014 11:28 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Hi Melissa,

the easiest way to work with a Stardust maven WAR project on Eclipse WTP is to use the maven Stardust Spring WAR archetype as a basis.
1. generate the maven project using the archetype
2. run maven package to complete all downloads
3. use "import existing maven project" in Eclipse
4. make sure the correct maven profile is enabled in the resulting Eclipse maven project (if applicable)
5. add dependencies on other eclipse (maven) projects as needed to includ custom jars
6. Add maven project to regular WTP server

Does that work for you?

Best regards

Rob
Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1487835 is a reply to message #1486897] Wed, 26 November 2014 05:24 Go to previous messageGo to next message
Melissa Ferenal is currently offline Melissa FerenalFriend
Messages: 18
Registered: November 2014
Junior Member
Thanks Rob.

I have built this maven archetype before and I noticed that the Rules Management Perspective is missing. So we have to stick with the eclipse war export.

Is there a way to include Rules Management Perspective in this archetype?

[Updated on: Wed, 26 November 2014 05:25]

Report message to a moderator

Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1487848 is a reply to message #1487835] Wed, 26 November 2014 05:39 Go to previous messageGo to next message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Melissa,

please check if adding the dependency

<groupId>org.eclipse.stardust.ui.web</groupId>
<artifactId>stardust-rules-manager</artifactId>
<version>2.0.1</version>


to your archetype result does the trick.

Best regards

Rob



Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1489997 is a reply to message #1487848] Thu, 27 November 2014 21:38 Go to previous messageGo to next message
Melissa Ferenal is currently offline Melissa FerenalFriend
Messages: 18
Registered: November 2014
Junior Member
Hi Rob,

Thank you. The project now has the rules management perspective.

Regards,

Melissa
Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1490253 is a reply to message #1489997] Fri, 28 November 2014 02:48 Go to previous messageGo to next message
Melissa Ferenal is currently offline Melissa FerenalFriend
Messages: 18
Registered: November 2014
Junior Member
Hi,

I have written the steps I did to build the stardust portal using maven archetype and deploy it to a server.

Generate a new project using mvn archetype:
mvn archetype:generate -DarchetypeGroupId=org.eclipse.stardust.deploy.jee.archetypes -DarchetypeArtifactId=tc7-ipp-portal-war -DarchetypeVersion=2.0.1 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-portal-war -Dversion=1.0-SNAPSHOT -DarchetypeRepository=http://download.eclipse.org/stardust/maven/releases


Go your project directory and build your project.
mvn clean package


Import project to eclipse.

If you want to replace the location of the jackrabbit repository (default location: c:/tmp/repository) modify the jackrabbit config file (ipp-portal/src/main/webapp/WEB-INF/config/ipp/spring/jackrabbit-jcr-context.xml)

<bean id="carnotJackrabbitRepository" class="org.eclipse.stardust.vfs.jcr.spring.JackrabbitRepositoryStartupBean">
      <property name="jndiName" value="jcr/ContentRepository" />
      <property name="repositoryConfig" value="/WEB-INF/jackrabbit/repository.xml" />
	  <property name="repositoryHome" value="<new jackrabbit repository>" />
   </bean>


Deploy to server and check if the project starts successfully.

However, if you ran into this runtime error during server start up :
Caused by: java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientXADataSource
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:260)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:416)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1296)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1267)
	... 42 more


In ipp-portal/src/main/webapp/WEB-INF/config/ipp/spring/carnot-spring-ds-context.xml
Replace
<bean id="carnotXaAuditTrailDataSourceLocalURL" class="org.apache.derby.jdbc.ClientXADataSource" lazy-init="true">
      <property name="serverName" value="localhost" />
      <property name="portNumber" value="1527" />
      <property name="databaseName" value="ipp" />
      <property name="user" value="carnot" />
      <property name="password" value="ag" />
   </bean>


with
<bean id="carnotXaAuditTrailDataSourceLocalURL" class="org.apache.derby.jdbc.EmbeddedXADataSource">
   <property name="databaseName" value="carnot" />
   <property name="user" value="carnot" />
   <property name="password" value="ag" />
</bean>


If you want to include other dependecies just add it to the pom.xml of your project. Hope this helps.

[Updated on: Fri, 28 November 2014 02:49]

Report message to a moderator

Re: How to use maven dependencies in eclipse stardust dynamic web project? [message #1490296 is a reply to message #1490253] Fri, 28 November 2014 03:36 Go to previous message
Robert Emsbach is currently offline Robert EmsbachFriend
Messages: 186
Registered: October 2011
Location: Singapore
Senior Member

Thank you for the clear configuration summary, Melissa. We will see how that can be consolidated with the documentation and wiki.

Best regards

Rob
Previous Topic:How to control a manual activity, rendering and input-validation
Next Topic:Data mapping could not be resolved during model deployment
Goto Forum:
  


Current Time: Thu Sep 20 15:35:53 GMT 2018

Powered by FUDForum. Page generated in 0.02155 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top