facebook

Maven, web apps, test code, and dependent projects

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

    robsaxsms
    Participant

    I am using MyEclipse 7.1.1 and have run into a problem with test code. I have two projects, MYJAR and MYWAR (not really what they are named, but you get the point). MYWAR utilizes MYJAR through a maven dependency. When I deploy MYWAR to jboss, I see that it contains all of the test code defined in MYJAR/src/test/java and resources from MYJAR/src/test/resources. Why are these being included? MYWAR requires several configuration files, some of which have test versions in MYJAR/src/test/resources. The MYWAR version of these configuration files are being overwritten by the ones from MYJAR. This is not a problem with maven, as it creates a proper war without the test code.

    Is there something I am doing wrong? Have others seen this problem?

    Thanks,
    Rob

    #298863 Reply

    Loyal Water
    Member

    Rob,
    I believe you are looking for a way to deploy your web project without the dependent jar? You can make this change under preferences. Please refer to section 10 of this document for more help on dependent project deployment policies:-
    http://www.myeclipseide.com/documentation/quickstarts/webprojects/#dependent_projects

    #298870 Reply

    robsaxsms
    Participant

    No, that is not what I am looking for. I need the source code (JARed or not) from MYJAR in MYWAR. However if the test files for MYJAR are included in MYWAR (in any form JAR or not), they will render MYWAR unusable. i.e. I want MYJAR/src/main/java, MYJAR/src/main/resources, but I do not want MYJAR/src/test/java and MYJAR/src/test/resources.

    Thanks,
    Rob

    #298904 Reply

    Unfortunately, MyEclipse does not differentiate between test and src. And it needs to use custom builds (i.e. not the Maven ones) to support hot deployment and server debugging. This is a known issue.
    If you need to do strict Maven build you should run Maven but you will not get any advanced MyEclipse support.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Maven, web apps, test code, and dependent projects

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