简体   繁体   中英

Fine-tuning source exports from a utility module to a web project

I'm using IBM Integration Designer 7.5, which is a version of Eclipse 3.6 with some added features. I'm building a dynamic web project targeting Tomcat. The web project has a dependency on another project, a utility module.

I've configured the web project to include code from the utility module per this question and it works well. A WAR built from the web project includes a jar containing the class files from the utility module.

The problem is that the utility module includes some junit testcase classes, and they're being included in the jar that goes into the WAR. I'm looking for a way to leave out the junit classes.

In the utility module, the "real" code is in a folder called "src" and the test cases are in a second source folder called "test". I've gone to the Build path->Order and Export tab of the utility project, and it lists both "src" and "test" as exports. It's not possible to uncheck the box for the "test" entry. The eclipse documentation says that source folder are always exported from a project.

Is there a realistic way to fine-tune this setup so that the test cases aren't packaged into the web project?

Do you have the source for the utility modue? What are you using as a build tool? If the answer to the first question is yes and the answer to the second question is not Maven, then use Maven. By default it excludes anything in the src/test directory from the build artifact. You will need to either rearrange your project directories to be the Maven default, or do some configuration of your POM file so that Maven knows which is the test directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM