3 Replies Latest reply on Oct 9, 2009 2:10 AM by Gavin King

    Controlling the installation of components at deploy time

    Chris Bredesen Newbie

      I'm up against something of a conundrum with a project that uses Seam, Maven and Eclipse (with JBoss Tools).  I'll explain what I'm after and then explain why I'm after it so that I don't bore the folks who are just scanning this thread.

      I need the ability to control what components are installed without relying on the automatic scanning of a classpath element.  IOW I need to be able to execute a Seam-enabled application with some runtime configuration that says install these components or don't install these components.

      You are an ass, why do you want this?

      I'm trying to make Seam, Maven, Eclipse and Mock components work together.  Eclipse lacks the ability to filter which build output folders go into a published WAR file so my mock instances, being part of the main project, are always there.  Since they are installed as MOCK, they cause my actual application components to not be installed.

      I tried splitting the unit tests out into a separate project like seam-gen does.  This works fine with Eclipse but doesn't seem to work with Maven because I can't depend on a WAR project.  The WEB-INF/classes code never gets put on the classpath.

      So then I considered splitting out the Java code from the web app but this won't work with Seam's hot deploy functionality.

      So I'm in a recursive nightmare situation and I'm looking for a way out.  The ability to specify a components.xml file would do the trick because I could tell Seam at runtime to install certain components that are already on the classpath during my tests, while the published WAR can be deployed and those mock components won't install (even though they're there).  The release verion of my WAR is clean because the test classes are never included in the WAR file (which I wish Eclipse would let me do).

      Any ideas are welcome here.  I think it may be possible to tinker with the filtering of components.xml so that it gets copied only in the test phase but I haven't proven that.  I'd love to avoid having to do this.