| Summary: | create <sourceDirectory> during "convert to maven project" | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Andre Dietisheim <adietish> |
| Component: | m2e | Assignee: | Project Inbox <m2e.core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | igor, mkleint, paul.mealor, scott_sosna, sebtardif, snjezana.peco |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Andre Dietisheim
<sourceDirectory>src</sourceDirectory> is not a workaround but a solution to a misconfiguration problem of yours. if you don't specify the <sourceDirectory> element, then it's value comes from the default root pom (as shipping with every maven binary). The default value is src/main/java, if you want something else, you need to configure it. You can verify the content of your effective pom by running the mvn help:effective-pom command on your project to see what sourceDirectory you have specified. as far as I can tell, your project should not even compile correctly when run with maven. resolving as invalid, thought to be a user configuration problem, please reopen if you disagree. If you convert a non-maven Eclipse Java project, m2e would need to configure source folders correctly. m2e doesn't handle that correctly even in the case pom.xml doesn't exist (when skipping step #2 in comment #0). Try the following: - create the default Eclipse Java project (src is the source folder) - do not create pom.xml - call Configure>Convert to Maven Project m2e will remove the source folder. This is a bug in m2e. thanks for the details. the problem is therefore in Convert to Maven Project which shall set the source directory. However please note that if you had any jar libraries defined or any other configuration around that is not backed by a pom element in the new pom, you will loose those as well, or at least get a non-buildable maven buid. ability to preserve custom .classpath entries is tracked separately as bug 353266 I have legacy projects that I converted to use Maven, but cannot use within Eclipse for the reasons discussed. From command line or within IntelliJ, the projects build just fine, but because of m2e's handling of the source directory, it doesn't work correctly within Eclipse. Please move this enhancement soon as its make it difficult for developers who want to use Maven (and yes, you could change the directory structure, but unfortunately that's not an option for all the wrong reasons). m2e 1.1 creates <sourceDirectory> pom.xml element as part of "convert to maven" action. If this does not work for you, please open a new bugreport and provide small standalone example project and exact steps to reproduce the problem. *** This bug has been marked as a duplicate of bug 359340 *** |