jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Integration for Eclipse
  • MNGECLIPSE-378

Update Source Folders adds resources folders as source folders, not as class folders

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 0.0.10
  • Fix Version/s: None
  • Component/s: Project Configuration
  • Labels:
    None

Description

When you perform an "update source folders", the plugin adds all your resource folders as source folders. It then does a wierd thing: adding exclusions to the folders so that nothing is copied (this is really bad, because it gets in the way of runtime resource resolution).

What it should do is what I do manually, add resource folders as Eclipse Class Folders, which are added to the runtime class path (but do no have resources copied to the output folder). This is also very close to what Maven does with resource folders at runtime.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    mngeclipse378-sample.diff
    16/Apr/08 6:54 PM
    0.8 kB
    Christian Gruber
  2. Hide
    Zip Archive
    mngeclipse378-sample.zip
    16/Apr/08 6:39 PM
    7 kB
    Christian Gruber
    1. XML File
      mngeclipse378-sample/pom.xml 0.7 kB
    2. XML File
      __MACOSX/mngeclipse378-sample/._pom.xml 0.2 kB
    3. Java Source File
      mngeclipse378-sample/src/main/.../bug/A.java 0.3 kB
    4. File
      mngeclipse378-sample/.../config.properties 0.0 kB
    5. File
      mngeclipse378-sample/src/.../apt/index.apt 0.6 kB
    6. XML File
      mngeclipse378-sample/src/site/site.xml 0.5 kB
    7. Java Source File
      mngeclipse378-sample/src/.../bugs/ATest.java 0.3 kB
    8. File
      mngeclipse378-sample/.../logging.properties 0.0 kB
    Download Zip
    Show
    Zip Archive
    mngeclipse378-sample.zip
    16/Apr/08 6:39 PM
    7 kB
    Christian Gruber
  3. Hide
    Zip Archive
    mngeclipse378-samples-and-diff.zip
    16/Apr/08 6:53 PM
    28 kB
    Christian Gruber
    1. File
      mngeclipse378-sample-2/.classpath 0.7 kB
    2. File
      mngeclipse378-sample-2/.project 0.5 kB
    3. File
      mngeclipse378-sample-2/.../org.maven.ide.eclipse.prefs 0.2 kB
    4. XML File
      mngeclipse378-sample-2/pom.xml 0.7 kB
    5. XML File
      __MACOSX/.../._pom.xml 0.2 kB
    6. Java Source File
      mngeclipse378-sample-2/src/.../bug/A.java 0.3 kB
    7. File
      mngeclipse378-sample-2/.../config.properties 0.0 kB
    8. File
      mngeclipse378-sample-2/src/.../apt/index.apt 0.6 kB
    9. XML File
      mngeclipse378-sample-2/src/site/site.xml 0.5 kB
    10. Java Source File
      mngeclipse378-sample-2/src/.../ATest.java 0.3 kB
    11. File
      mngeclipse378-sample-2/.../logging.properties 0.0 kB
    12. File
      mngeclipse378-sample-2/.../config.properties 0.0 kB
    13. File
      mngeclipse378-sample-2/.../A.class 0.9 kB
    14. File
      mngeclipse378-sample-2/.../ATest.class 0.6 kB
    15. File
      mngeclipse378-sample-3/.classpath 0.7 kB
    16. File
      mngeclipse378-sample-3/.DS_Store 6 kB
    17. File
      __MACOSX/.../._.DS_Store 0.1 kB
    18. File
      mngeclipse378-sample-3/.project 0.5 kB
    19. File
      mngeclipse378-sample-3/.../org.maven.ide.eclipse.prefs 0.2 kB
    20. XML File
      mngeclipse378-sample-3/pom.xml 0.7 kB
    21. XML File
      __MACOSX/.../._pom.xml 0.2 kB
    22. Java Source File
      mngeclipse378-sample-3/src/.../bug/A.java 0.3 kB
    23. File
      mngeclipse378-sample-3/.../config.properties 0.0 kB
    24. File
      mngeclipse378-sample-3/src/.../apt/index.apt 0.6 kB
    25. XML File
      mngeclipse378-sample-3/src/site/site.xml 0.5 kB
    26. Java Source File
      mngeclipse378-sample-3/src/.../ATest.java 0.3 kB
    27. File
      mngeclipse378-sample-3/.../logging.properties 0.0 kB
    28. File
      mngeclipse378-sample-3/.../config.properties 0.0 kB
    29. File
      mngeclipse378-sample-3/.../A.class 0.9 kB
    30. File
      mngeclipse378-sample-3/.../ATest.class 0.6 kB
    Showing 30 of 31 items Download Zip
    Show
    Zip Archive
    mngeclipse378-samples-and-diff.zip
    16/Apr/08 6:53 PM
    28 kB
    Christian Gruber

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-616 better out of the box experience

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Eugene Kuleshov added a comment - 30/Jul/07 12:52 PM

Howard, do you mind to create sample project that would allow to reproduce issue you are troubled with. Thanks.

I've been thinking to add resources ass class folders, but then there is a concern that they won't be visible trough "Open Resource" dialog.

Show
Eugene Kuleshov added a comment - 30/Jul/07 12:52 PM Howard, do you mind to create sample project that would allow to reproduce issue you are troubled with. Thanks. I've been thinking to add resources ass class folders, but then there is a concern that they won't be visible trough "Open Resource" dialog.
Hide
Permalink
Howard M. Lewis Ship added a comment - 30/Jul/07 1:20 PM

For a large example, the Tapestry 5 source (available via SVN) demonstrates what I'd like, and uses class folders, not source folders, for resources. Of course, I have to manually maintain it.

I'll try and find time to do a smaller example.

Open Resources works fine with resources in class folders; I do this all the time.

Show
Howard M. Lewis Ship added a comment - 30/Jul/07 1:20 PM For a large example, the Tapestry 5 source (available via SVN) demonstrates what I'd like, and uses class folders, not source folders, for resources. Of course, I have to manually maintain it. I'll try and find time to do a smaller example. Open Resources works fine with resources in class folders; I do this all the time.
Hide
Permalink
Eugene Kuleshov added a comment - 30/Jul/07 1:28 PM

Thanks Howard. A small example would be very useful. It would be also great if you'd add some code that access these resources (i.e. unit test that we could run from eclipse and with maven cli).

Show
Eugene Kuleshov added a comment - 30/Jul/07 1:28 PM Thanks Howard. A small example would be very useful. It would be also great if you'd add some code that access these resources (i.e. unit test that we could run from eclipse and with maven cli).
Hide
Permalink
Eugene Kuleshov added a comment - 17/Sep/07 2:26 AM

Howard, any change you could make a smaller example for this? Or maybe you can at least point me at the exact location of your projects.

Show
Eugene Kuleshov added a comment - 17/Sep/07 2:26 AM Howard, any change you could make a smaller example for this? Or maybe you can at least point me at the exact location of your projects.
Hide
Permalink
Eugene Kuleshov added a comment - 26/Sep/07 7:58 PM

Please reopen if you can provide requested info. Thanks.

Show
Eugene Kuleshov added a comment - 26/Sep/07 7:58 PM Please reopen if you can provide requested info. Thanks.
Hide
Permalink
Christian Gruber added a comment - 16/Apr/08 6:39 PM

Here's a simple project that illustrates the issue. Just try to import it into eclipse, and /src/test/resources and /src/main/resources are entered into the classpath as source folders, when they aren't (in the sense that eclipse means it). They're resource folders, which eclipse should process as "class folders" since they need to be on the classpath, but not part of the sources.

I'll post a two more files - one that's the project as the eclipse plugin currently generates, and the same project as I want to see it (and I suspect howard does too.)

Show
Christian Gruber added a comment - 16/Apr/08 6:39 PM Here's a simple project that illustrates the issue. Just try to import it into eclipse, and /src/test/resources and /src/main/resources are entered into the classpath as source folders, when they aren't (in the sense that eclipse means it). They're resource folders, which eclipse should process as "class folders" since they need to be on the classpath, but not part of the sources. I'll post a two more files - one that's the project as the eclipse plugin currently generates, and the same project as I want to see it (and I suspect howard does too.)
Hide
Permalink
Christian Gruber added a comment - 16/Apr/08 6:53 PM

And here's a zip with 2 projects, one imported with the current plugin, and one altered to the state it should be. Finally, there's a diff on the .classpath files. It's very simple, ultimately, the desired change. I'm also pasting the diff here:

------------------
— mngeclipse378-sample-2/.classpath 2008-04-16 19:43:49.000000000 -0400
+++ mngeclipse378-sample-3/.classpath 2008-04-16 19:48:28.000000000 -0400
@@ -6,9 +6,9 @@
<attribute name="maven.type" value="test"/>
</attributes>
</classpathentry>

  • <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
  • <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
    + <classpathentry kind="lib" path="src/main/resources"/>
    + <classpathentry kind="lib" path="src/test/resources"/>
    <classpathentry kind="output" path="target-eclipse/classes"/>
    </classpath>
    ------------------------
Show
Christian Gruber added a comment - 16/Apr/08 6:53 PM And here's a zip with 2 projects, one imported with the current plugin, and one altered to the state it should be. Finally, there's a diff on the .classpath files. It's very simple, ultimately, the desired change. I'm also pasting the diff here: ------------------ — mngeclipse378-sample-2/.classpath 2008-04-16 19:43:49.000000000 -0400 +++ mngeclipse378-sample-3/.classpath 2008-04-16 19:48:28.000000000 -0400 @@ -6,9 +6,9 @@ <attribute name="maven.type" value="test"/> </attributes> </classpathentry>
  • <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
  • <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="lib" path="src/main/resources"/> + <classpathentry kind="lib" path="src/test/resources"/> <classpathentry kind="output" path="target-eclipse/classes"/> </classpath> ------------------------
Hide
Permalink
Christian Gruber added a comment - 16/Apr/08 6:54 PM

ok that paste didn't work, as jira formatted the stuff. I'm attaching the raw diff file for easy linking.

Show
Christian Gruber added a comment - 16/Apr/08 6:54 PM ok that paste didn't work, as jira formatted the stuff. I'm attaching the raw diff file for easy linking.
Hide
Permalink
Howard M. Lewis Ship added a comment - 16/Apr/08 7:14 PM

Christian has add some examples and a diff between the .classpath files from the current source folder approach vs. the resources-as-lib approach – thanks for picking up my slack, Christian!

Show
Howard M. Lewis Ship added a comment - 16/Apr/08 7:14 PM Christian has add some examples and a diff between the .classpath files from the current source folder approach vs. the resources-as-lib approach – thanks for picking up my slack, Christian!
Hide
Permalink
Eugene Kuleshov added a comment - 16/Apr/08 7:41 PM

Christian, thanks for the projects, but what is the actual problem you have with current configuration? What is exactly that does not work for you? Please also indicate if you are using latest 0.9.x m2eclipse build.

Show
Eugene Kuleshov added a comment - 16/Apr/08 7:41 PM Christian, thanks for the projects, but what is the actual problem you have with current configuration? What is exactly that does not work for you? Please also indicate if you are using latest 0.9.x m2eclipse build.
Hide
Permalink
Christian Gruber added a comment - 16/Apr/08 8:10 PM

I am, and the problem is that you can put .java files in to /src/*/resource folders and maven will not compile them (expected behaviour) but eclipse will (unexpected behaviour) . So it basically means that the meaning of these folders is subtly different, which can cause error. One of the goals should be to make preventable errors prevented categorically.

For me, however, it amounts to an annoying thing I need to do each time I import a project. I now use maven for all my projects I no longer version eclipse configuration files (except in very very odd cases like FlexBuilder projects). Because of this, all the metadata is in pom.xml files, and so "opening" a project is actually an import with m2eclipse. So basically I end up with a 3 step import. 1. Import the maven project. 2. remove the /src//resource folders from the build path. 3. add src//resource folders as class folder libraries. Not gonna kill me, but annoying. And since I contend that the semantic of the current configuration is incorrect, I can't see a good reason not to do this.

Show
Christian Gruber added a comment - 16/Apr/08 8:10 PM I am, and the problem is that you can put .java files in to /src/*/resource folders and maven will not compile them (expected behaviour) but eclipse will (unexpected behaviour) . So it basically means that the meaning of these folders is subtly different, which can cause error. One of the goals should be to make preventable errors prevented categorically. For me, however, it amounts to an annoying thing I need to do each time I import a project. I now use maven for all my projects I no longer version eclipse configuration files (except in very very odd cases like FlexBuilder projects). Because of this, all the metadata is in pom.xml files, and so "opening" a project is actually an import with m2eclipse. So basically I end up with a 3 step import. 1. Import the maven project. 2. remove the /src//resource folders from the build path. 3. add src//resource folders as class folder libraries. Not gonna kill me, but annoying. And since I contend that the semantic of the current configuration is incorrect, I can't see a good reason not to do this.
Hide
Permalink
Christian Gruber added a comment - 16/Apr/08 8:11 PM

Oh yeah, and I'm using 0.9.1.200803311600.

Show
Christian Gruber added a comment - 16/Apr/08 8:11 PM Oh yeah, and I'm using 0.9.1.200803311600.
Hide
Permalink
Eugene Kuleshov added a comment - 25/May/08 11:47 AM

We still haven't seen any specifics on why you need X in .classpath and not Y. It seems like you don't like Y, but I really would like to know why.

Anyways, we are improving project configuration as per MNGECLIPSE-616. So, if you have additional comments, please comment there. Thanks.

Show
Eugene Kuleshov added a comment - 25/May/08 11:47 AM We still haven't seen any specifics on why you need X in .classpath and not Y. It seems like you don't like Y, but I really would like to know why. Anyways, we are improving project configuration as per MNGECLIPSE-616. So, if you have additional comments, please comment there. Thanks.

People

  • Assignee:
    Unassigned
    Reporter:
    Howard M. Lewis Ship
Vote (0)
Watch (3)

Dates

  • Created:
    30/Jul/07 12:27 PM
    Updated:
    25/May/08 11:48 AM
    Resolved:
    25/May/08 11:47 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.