facebook

Java Project to EAR

  1. MyEclipse IDE
  2.  > 
  3. WebSphere Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #295004 Reply

    mustangLover
    Member

    I have a Java Project (grails web application) that I would like to export as an EAR file. Can’t I simply create a new java enterprise project within my current workspace(create new web/ejb modules) then just create the dependency to previous java project so it would basically import the original java project as a jar?

    thank you

    #295071 Reply

    Riyad Kalla
    Member

    Mustang, if you do create the EAR, then mark a project reference from the EAR to the JAR, and then setup the EAR’s deployment policy for dependent library projects — yes, that will archive it and put it as a JAR into the resulting EAR… that won’t be a deployable WAR application though so it won’t explode correctly inside an app server.

    You need a WAR, not an EAR. You probably need to migrate your Java Project to a Web Project — you can do that in myeclipse by right-clicking and doing MyEclipse > Add Web Project Capabilities — just make sure you have the Source and Webroot directories setup correctly.

    #295076 Reply

    mustangLover
    Member

    Thank you very much for your reply. I definitely would rather just make a WAR. This will be deployed to WAS 6.1 so I can just deploy it as a WAR and let Websphere put it in the EAR it needs.

    Last question, when you say to make sure I have the source/webroot directories setup correctly to deploy this Grails/Groovy Web App as a WAR to Websphere, what specifically should I verify so I do not make any mistakes.

    Thanks again.

    #295274 Reply

    Riyad Kalla
    Member

    Last question, when you say to make sure I have the source/webroot directories setup correctly to deploy this Grails/Groovy Web App as a WAR to Websphere, what specifically should I verify so I do not make any mistakes.

    Just meant that in MyEclipse we follow the “Exploded WAR” project format. So your WebRoot should really represent the root of your deployed web app, where index.jsp would live (or whatever it is in Groovy) and contains your WEB-INF folder with a web.xml file under it.

    Also your output dir will need to be set to /WebRoot/WEB-INF/classes directory so when MyEclipse deploys this project all your build classes get carried out with the WAR as well.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Java Project to EAR

You must be logged in to post in the forum log in