Community
Participate
Working Groups
Build Identifier: 20110615-0604 Here is a problem I have found with the JET Editor plug-in in Eclipse: I have 2 source folders in my project: * src/main/java (contains all project classes etc.) * src/test/java (contains all JUnit tests) In my .jetproperties file I have set src/main/java as a source container: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <jet-settings> <template-container>templates</template-container> <source-container>src/main/java</source-container> </jet-settings> Now if I have src/test/java before src/main/java in my classpath file, like this: ... <classpathentry kind="src" path="src/test/java"/> <classpathentry kind="src" path="src/main/java"/> ... When I create a new JET template using the JET Editor (the bug does not occur if I use the text editor), JET wrongly generates duplicate Java classes to both src/test/java and src/main/java, even though src/main/java is only specified as a source container in its settings. Reproducible: Always Steps to Reproduce: 1. Create a new Java project in Eclipse with the following source folders: src/main/java src/test/java 2. Make sure that src/test/java appears before src/main/java in the classpath file (either from the project properties -> Java Build Path -> Order and Export or the .classpath file itself). 3. Convert the newly created project to a JET project 4. In the JET settings, set src/main/java as a source container. 5. Create a new JET template using the JET Editor (if using the text editor, the bug is not reproducible) like this one here: <%@ jet package="org.eclipse.bug.reproduce" class="Test" %> JET Editor bug reproducing! After you save the template, 2 template generators are wrongly generated: both in src/main/java and src/test/java.
WORKAROUND: In the .classpath file, set the folder specified as a source container in JET as a first classpath entry.