| maven-eclipse generated .projects not showing JUnit4 run configuration [message #895450] |
Thu, 12 July 2012 23:09  |
Eclipse User |
|
|
|
We've been using 3.6 for a while and need to upgrade to 4.2.
We currently generate our .project files (and then import as an existing proj into Eclipse) using maven-eclipse, i.e. mvn eclipse:clean eclipse:eclipse. We do most of our build kickoffs via the command line, but we like to use the Run As type menu configs for debugging, running unit tests, etc.
I tried importing an existing project into Juno today and it acted like a Maven project. OK, that's kind of handy, being able to right click and do Maven -> install, test, etc.
But, I can't get the JUnit run configuration working to save my life. Any tips?
If I manually create a new unit test using the Eclipe menu, then that one test will work...but it's like it doesn't know it's a Java project or that it is using Junit.
This still works fine in 3.6
Here's a sample .project:
<projectDescription>
<name>simplegis-core</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
</natures>
</projectDescription>
(we do use groovy in some places for unit tests, but not on this project.
[Updated on: Thu, 12 July 2012 23:09] by Moderator
|
|
|
|
| Re: maven-eclipse generated .projects not showing JUnit4 run configuration [message #895674 is a reply to message #895624] |
Sat, 14 July 2012 12:17  |
Eclipse User |
|
|
|
Thanks - yeah, I didn't see too much difference between my .project and one that gets generated w/ a new project.
Well, that's sorta it - I can't seem to run the test via the Run configs.
Here is my .classpath:
<classpath>
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>
...and, well, this is embarrassing. I deleted my code, re-pulled from the repo, ran eclipse:clean and eclipse:eclipse...and it just works now.
When I originally did this, I started with the SpringSource Tool Suite and tried to "Import as a Maven Project" (just to kind of see what would happen). And I'm not sure I started w/ a clean workspace (eclipse:clean should have deleted my .project and .classpath files, though?).
Weird. Well, I'll take it. Thanks for the help - good reminder about checking .classpath.
|
|
|
Powered by
FUDForum. Page generated in 0.06745 seconds