I am starting to use the java config rather than the XML. I have used the Greenhouse project as a reference. Now in my project (as well as in the Greenhouse app) all the java files are ending up in the WAR. I don't understand how they are getting there but I only want class files in the WAR.
One other issue I am seeing is just like you would sometimes have a test-context.xml I have a testConfig.java annotated with @Configuration needed for my Junit test cases. Problem this is also getting picked up byTCServer and being deployed. This caused some really difficult issues for me to debug today until I finally figured out that TCServer was creating and using beans defined in a configuration file in my /test directory.
In short I have 2 questions
1. How can I ensure that I do not package source code in my war or have STS deploy it to TC server?
2. How can I ensure that absolutely nothing from the test directory in my project ends up in the WAR or deployed? I am wondering if it has something to do with the way that the AnnotationConfigWebApplicationContext scans packages. If I have src/main/java/com/example/config/config.java and src/main/test/com/example/configTest.java I would hope that it would not pick up the one under test.
Has anyone had this issue or know of a solution?
Thanks,


Reply With Quote