2 Replies Latest reply on Dec 6, 2010 8:47 AM by arjan tijms

    Exclude source dir from deployment in EJB module?

    arjan tijms Novice

      I'm using Eclipse 3.6.1 with JBoss tools 3.2 beta 1. In my EAR project I have an EJB and a web module. My EJB module has multiple java source directories. I'm trying to prevent one of those from ending up in the deployment.

       

      To do this, I went to [EJB module] -> project -> properties -> Deployment Assembly.

       

      I removed the source directory in question here and cleaned, rebuild, redeployed etc everything. However, the content of this particular source directory keeps ending up in the deployment.

       

      I checked the .settings/org.eclipse.wst.common.component file in the EJB module, and the source folder I don't want to deploy is really gone:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project-modules id="moduleCoreId" project-version="1.5.0">
          <wb-module deploy-name="foo_main_ejb">
              <wb-resource deploy-path="/" source-path="/src"/>
              <wb-resource deploy-path="/" source-path="/resources"/>
              <property name="java-output-path"/>
          </wb-module>
      </project-modules>
      

       

      Is this file simply ignored or do I need to do something else?

       

      Thanks in advance!

        • 1. Re: Exclude source dir from deployment in EJB module?
          arjan tijms Novice

          I seems to be a kind of a bug. After some more testing, I discovered that if I remove all wb-resources from the above file, nothing gets deployed. E.g.:

           

           

          <?xml version="1.0" encoding="UTF-8"?>
          <project-modules id="moduleCoreId" project-version="1.5.0">
              <wb-module deploy-name="foo_main_ejb">             
              </wb-module>
          </project-modules>
          

           

          This will cause an empty deployment for the EJB module. However, if I put only one random (but existing) entry here, all source directories will be deployed. E.g.:

           

           

          <?xml version="1.0" encoding="UTF-8"?>
          <project-modules id="moduleCoreId" project-version="1.5.0">
              <wb-module deploy-name="foo_main_ejb">        
                  <wb-resource deploy-path="/" source-path="/resources"/>        
              </wb-module>
          </project-modules>
          

           

          This will also cause the previous shown /src to be deployed as well as any /test /resources /foo /bar /whatever source dirs I have in the EJB module. If I put a reference to a non existing directory in the source-path (e.g. /does_not_exist) then nothing will be deployed, so there seems to be some level of validation being done before it decides to deploy everything there is to deploy.

          • 2. Re: Exclude source dir from deployment in EJB module?
            arjan tijms Novice

            I think I already found the way to make it work.

             

            If I select "Allow output folders for source folders" in project properties -> Java Build Path -> Source, then the source folders as defined in "Deployment Assembly" seem to work.

             

            If there thus is a bug, then it's that if source directories share an output folder (in many cases this will be the default output folder), it makes no sense to list them individually in the Deployment Assembly page. There could also be some explanation somewhere that mentions the functionality is working on the output folders perhaps.