facebook

Continuous Build with Maven

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #672563 Reply

    CS Tan
    Participant

    We currently have a project to use Maven to perform a continuous build of our codes maintained on Myeclipse/bitbucket.

    The idea is to automatically create a EAR file on a MAVEN. Since Myeclipse IDE is able to generate this EAR file (but manually by our developer), is there a way that we can export the artefacts from Myeclipse to a standalone Maven (e.g. POI)?

    In fact any guidance to help us set up the standalone Maven server from what we have in Myeclipse will be much appreciated.

    CS

    #672594 Reply

    Brian Fernandes
    Moderator

    CS,

    Do you already have the maven-ear-plugin in your pom.xml file (assuming your project is already a Maven project)? If that plugin is correctly configured, and your project is structured using Maven standards/best practices, executing the ear:ear goal for that plugin should generate the EAR for you.

    MyEclipse creates the EAR using the Deployment Assembly you will find in the project properties, which can be quite different from what will happen with Maven, but that depends on both your project and deployment assembly changes you have made. We do not have a way to convert the deployment assembly settings into equivalent Maven configurations. We do have the reverse, where some parts of the deployment assembly will be updated based on your project’s pom.xml file – this is used when importing Maven projects into MyEclipse.

    I would add the plugin to the project’s pom.xml, run the goal to generate the EAR, and gradually make changes to the plugin configuration and project structure until the EAR generated matches what MyEclipse generates / deploys.

    I hope this helps, please let us know if we can provide further assistance.

    #672618 Reply

    CS Tan
    Participant

    Thanks Brian.

    We are totally new to this. Our project is not a Maven project. We like to take the creation of the EAR to a separate standalone server for CI purposes.

    How complicated is it to move to a Maven project. We have a WEB and EJB module.

    CS

    #672632 Reply

    Brian Fernandes
    Moderator

    CS,

    It would depend on the complexity of your project; while it wouldn’t normally be difficult to move to a Maven based project, some Maven knowledge and fundamentals will be required. I would recommend that you start learning Maven basics if you do not already have experience with it. You can learn more advanced topics as you progress with the migration.

    1) Moving all your projects (EAR, EJB, Web) to Maven would be the right way to achieve what you desire.
    2) The best way to do this would be to create new projects using Maven (our Wizards will allow you to choose Maven when creating new project). Make sure you choose the correct version of Java EE and the Standard Maven JEE project structure (not the MyEclipse structure).
    3) I would then copy your classes and resources into these projects, make sure they compile, and then run Maven goals that would create the EAR (or the WAR / JAR for the Web and EJB projects respectively). Move to the actual deployment stage after you find that the EAR being created matches the EAR that is currently being generated by MyEclipse.

    Hope this helps.

    #673252 Reply

    CS Tan
    Participant

    Hi Brian
    From Myeclipse, we can easily and quickly export an EAR file.
    Can this be done via command line without starting Myeclipse.

    #673254 Reply

    Brian Fernandes
    Moderator

    CS,

    Unfortunately not, the MyEclipse export operations will not run in headless mode. The only way to do this would be to use Maven as discussed above.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Continuous Build with Maven

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