how to make multi module Ear project in eclipse and maven - java

i am new to Ear kind project i can make a war project now i want to add my all war project in a Ear project by using maven but not able to get success my pom.xml file of Ear project gives me the error
and i am not able to get that, if any one has the solution please help.
thanks in adv.

Related

How to take a reference from maven project to spring project?

I have a 2 project. One of them is maven, other one is spring project. I obtain jar file from maven project and give reference to spring project. When I call some classes and methods in compile time, it's ok. But when I started tomcat server I got a error that is "java.lang.NoClassDefFoundError" and "NoClassDefFoundError". Application does not see classes on run time.
I supposed that this error is occured cause of tomcats run time classpaths. I must add missing classes to classpaths. But how to do that ? How to handle this problem ?
IDE: Eclipse
Tomcat version: 9
Thanks for your answers. Sorry for my bad english.
you need to create jar file of your maven project and put into WEB-INF > lib of Spring project and and jar file into built path and rebuild the Spring project and run it from tomcat 9.
Try adding the jar file to Deployment Assembly. Right click on your project, click Properties, Deployment Assembly, Add your jar file and run the project on tomcat.

How to deploy Maven project as jar file to Tomcat?

I am using eclipse IDE mars version.In that I have a maven project.I need to deploy the maven project as jar file in my tomcat's deploy path when I publish the tomcat. But when I publish the tomcat the maven project is deployed as folder where it contains class files,META_INF and WEB_INF folders.
How to pack the maven project as jar when I publish the tomcat?
I need to move the deployed jars from deploy path to lib folder of tomcat.
Please anyone suggest me how to get it done.
Thanks.
Make sure that the packaging tag in you pom.xml is set to war
<packaging>war</packaging>

How to build correct WAR file from switchyard project with Maven

The problems I face:
I need to build *.war with Maven from Switchyard project to deploy war, not jar as usual. And as I understand, *.war is also acceptable to make Switchyard work. But when I build war, no Switchyard services available though everything is deployed successfully on JBoss.
How to do that? Is there any hints how to correctly assemble war for Switchyard?
So, I found the answer.
Unfortunately there is no instruction how to build correct WAR for Switchyard project, so I hope my experience will help some day to some people.
All that you need is to move both switchyard.xml and beans.xml from src/main/META-INF to src/main/webapp/WEB-INF and build WAR after that ( don't forget to add war to the pom.xml ).
That solved the problem, now Switchyard services are available (but not work).

Creating EAR file using Maven

I am facing an issue while creating EAR file using Maven of a Dynamic Web Project.
I have successfully created WAR file using POM.xml , but can anybody tell me how to write EAR script in POM.xml ?
Thanks in advance
It easy.
You need:
Root project, parent pom that have 2 modules - war and ear.
Move your war to war module
create ear module (add war as dependency)
You can use archetype:generate to create example of ear. For example archetype with id: 612.
612: remote -> org.jboss.spec.archetypes:jboss-javaee6-ear-webapp (An
archetype that generates a starter Java EE 6 webapp project for JBoss
AS 7. The project is an EAR, with an EJB-JAR and WAR)
If you don't need ejb - just delete it. In generated example ejb is optional.
Check my archetype for maven, this is for Java EE 6
https://github.com/sjpuas/jee6-archetype

Eclipse, Maven and Spring

I wanted to learn something about Spring and Maven, so I created sample Maven project in Eclipse and I chosen webapp archetype, but it created only src/main/resources and src/main/webapp folders, I am wondering why it didn't create src/main/java, also how can I add folder so the Maven will recognize it? Because when I manually create src/main/java folder, it isn't recognized.
You just need to create src/main/java folder and maven will automatically recognize it.
To make your project is recognize by eclipse, you can run mvn eclipse:eclipse at the root of the project.
Here is the sample webapp based on maven, spring and JPA2(hibernate)

Categories

Resources