Buildr
  1. Buildr
  2. BUILDR-169

Wrong classpath is set when running buildr eclipse

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.3
    • Fix Version/s: 1.3.3
    • Component/s: IDE
    • Labels:
      None
    • Environment:
      All OS
      Ruby, JRuby
      Eclipse Ganymede(3.4)
    1. After buildr eclipse.png
      73 kB
      Anders Asplund
    2. Before buildr eclipes.png
      71 kB
      Anders Asplund
    3. buildr-bug.tar.gz
      1 kB
      Alex Boisvert
    4. buildr-bug2.tar.gz
      2 kB
      Anders Asplund
    5. eclipse.rb
      8 kB
      Alex Boisvert

      Activity

      Hide
      lacton added a comment -

      When I run "buildr eclipse", I do not get the same result as you.

      Your foo-impl/.classpath in buildr-bug.tar.gz contains

      <?xml version="1.0" encoding="UTF-8"?>
      <classpath>
      <classpathentry excluding="*/.svn/|*/CVS/" kind="src" path="src/main/java"/>
      <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
      <classpathentry combineaccessrules="false" kind="src" path="/foo-api"/>
      <classpathentry kind="output" path="target/classes"/>
      </classpath>

      whereas the foo-impl/.classpath I get when I run "touch buildfile ; buildr eclipse" contains

      <classpath>
      <classpathentry path="src/main/java" kind="src" excluding="*/.svn/|*/CVS/"/>
      <classpathentry path="/buildr-bug-foo-api" kind="src" combineaccessrules="false"/>
      <classpathentry path="target/classes" kind="output"/>
      <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/>
      </classpath>

      How did you generate your .classpath files?

      Show
      lacton added a comment - When I run "buildr eclipse", I do not get the same result as you. Your foo-impl/.classpath in buildr-bug.tar.gz contains <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry excluding="* /.svn/| */CVS/" kind="src" path="src/main/java"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/foo-api"/> <classpathentry kind="output" path="target/classes"/> </classpath> whereas the foo-impl/.classpath I get when I run "touch buildfile ; buildr eclipse" contains <classpath> <classpathentry path="src/main/java" kind="src" excluding="* /.svn/| */CVS/"/> <classpathentry path="/buildr-bug-foo-api" kind="src" combineaccessrules="false"/> <classpathentry path="target/classes" kind="output"/> <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> </classpath> How did you generate your .classpath files?
      Hide
      lacton added a comment -

      When I try to import the 'buildr-bug' project in Eclipse 3.3.2, I get a build error.

      After running "touch buildfile ; buildr eclipse", it imports fine.

      Show
      lacton added a comment - When I try to import the 'buildr-bug' project in Eclipse 3.3.2, I get a build error. After running "touch buildfile ; buildr eclipse", it imports fine.
      Hide
      Alex Boisvert added a comment -

      I can't reproduce either so I have to assume this is fixed in 1.3.3.

      I've verified we have a test that covers this and added an extra one to make sure the project reference matches the name in the .project file.

      Show
      Alex Boisvert added a comment - I can't reproduce either so I have to assume this is fixed in 1.3.3. I've verified we have a test that covers this and added an extra one to make sure the project reference matches the name in the .project file.
      Hide
      Anders Asplund added a comment -

      Hi,

      Sorry if I wasn't clear enough in my comments, but the problem is excatly what you describe. If you take a look att the classpath for the related project <classpathentry path="/buildr-bug-foo-api"... it points at the buildr-bug-foo-api project. The problem is that there is no such project. The name of the project is only foo-api and it resides in a folder with the same name. If you open the classpath dialog in eclipse it points to a project with the name /buildr-bug-foo-api but no such folder exists and it will generate an error.

      If you need more info about this I'll send you some screendumps over tomorrow.

      The project I sent you contained that classpath because I changed it in eclipse. I do get the same result as you - and thats my issue!

      //Anders

      Show
      Anders Asplund added a comment - Hi, Sorry if I wasn't clear enough in my comments, but the problem is excatly what you describe. If you take a look att the classpath for the related project <classpathentry path="/buildr-bug-foo-api"... it points at the buildr-bug-foo-api project. The problem is that there is no such project. The name of the project is only foo-api and it resides in a folder with the same name. If you open the classpath dialog in eclipse it points to a project with the name /buildr-bug-foo-api but no such folder exists and it will generate an error. If you need more info about this I'll send you some screendumps over tomorrow. The project I sent you contained that classpath because I changed it in eclipse. I do get the same result as you - and thats my issue! //Anders
      Hide
      lacton added a comment -

      Anders,

      > it points at the buildr-bug-foo-api project. The problem is that there is no such project. The name of the project is only foo-api and it resides in a folder with the same name.

      I think you are mixing up the project name and the project directory.

      If you look at 'foo-api/.project', you will see that the project name is indeed "<name>buildr-bug-foo-api</name>".

      The <classpathentry path="/buildr-bug-foo-api"> item looks like a real file system path, but it is just a symbolic project name.

      See for instance http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg06668.html

      > I do get the same result as you - and thats my issue!

      Here is what I do with Eclipse 3.3.2.
      #1. File / Import
      #2. General / Existing Projects into Workspace
      #3. Next
      #4. Select root directory:
      #5. Browse to buildr-bug folder and click OK.
      #6. In the "Projects" panel, I see buildr-bug-foo-api and buildr-bug-foo-impl. Both are ticked.
      #7. Finish
      #8. Now, both projects are open and I have no build problems.

      Show
      lacton added a comment - Anders, > it points at the buildr-bug-foo-api project. The problem is that there is no such project. The name of the project is only foo-api and it resides in a folder with the same name. I think you are mixing up the project name and the project directory. If you look at 'foo-api/.project', you will see that the project name is indeed "<name>buildr-bug-foo-api</name>". The <classpathentry path="/buildr-bug-foo-api"> item looks like a real file system path, but it is just a symbolic project name. See for instance http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg06668.html > I do get the same result as you - and thats my issue! Here is what I do with Eclipse 3.3.2. #1. File / Import #2. General / Existing Projects into Workspace #3. Next #4. Select root directory: #5. Browse to buildr-bug folder and click OK. #6. In the "Projects" panel, I see buildr-bug-foo-api and buildr-bug-foo-impl. Both are ticked. #7. Finish #8. Now, both projects are open and I have no build problems.
      Hide
      Anders Asplund added a comment -

      Hi,

      Ok, no I see... that makes it a bit clearer. But still there is a small problem with this. Maybe no a bug but more of a feature character. If I, as in my case, wants to apply buildr on an already existing project this will cause a failure initially. I will try to explain:

      If you have an already existing project including two separate projects where foo-impl depends on foo-api. The name of the projects are by default in eclipse the same as the folder name in the file system path. When you later try to apply buildr on this project you want add these two project in to a parent (called buildr-bug) so that they can reference each other. After running buildr eclipse the symbolic project name will change to <parent project name>-<child project name>, in my example buildr-bug-foo-api and buildr-bug-foo-impl. The foo-impl project will therefore reference the foo-api project with the symbolic name, buildr-bug-foo-api. This is where it goes wrong. The project name in eclipse wont update to the new symbolic name and the project references will fail since eclipse will not find any buildr-bug-foo-api project.

      To work arond this I had to remove the projects from eclispse and import them again. This will forece eclipse to reload the project with their new names.

      I'll upload a new example project for you to try out including a buildfile. The project is setup as a non-buildr project and the buildfile should be run to on this non-buildr project to "convert" it to a buildr-project.

      I will also attach two screendumps showing the Java Build Path before and after running buildr eclipse.

      //Anders

      Show
      Anders Asplund added a comment - Hi, Ok, no I see... that makes it a bit clearer. But still there is a small problem with this. Maybe no a bug but more of a feature character. If I, as in my case, wants to apply buildr on an already existing project this will cause a failure initially. I will try to explain: If you have an already existing project including two separate projects where foo-impl depends on foo-api. The name of the projects are by default in eclipse the same as the folder name in the file system path. When you later try to apply buildr on this project you want add these two project in to a parent (called buildr-bug) so that they can reference each other. After running buildr eclipse the symbolic project name will change to <parent project name>-<child project name>, in my example buildr-bug-foo-api and buildr-bug-foo-impl. The foo-impl project will therefore reference the foo-api project with the symbolic name, buildr-bug-foo-api. This is where it goes wrong. The project name in eclipse wont update to the new symbolic name and the project references will fail since eclipse will not find any buildr-bug-foo-api project. To work arond this I had to remove the projects from eclispse and import them again. This will forece eclipse to reload the project with their new names. I'll upload a new example project for you to try out including a buildfile. The project is setup as a non-buildr project and the buildfile should be run to on this non-buildr project to "convert" it to a buildr-project. I will also attach two screendumps showing the Java Build Path before and after running buildr eclipse. //Anders
      Hide
      lacton added a comment -

      Anders,

      Thank you for your explanations. I had not thought about this kind of setting.

      It is true that if you already have some of the projects in your Eclipse workspace with the Eclipse default names, the Eclipse build will fail because of the name mismatch. Deleting them from the Eclipse workspace and importing them again would be the way to go.

      Show
      lacton added a comment - Anders, Thank you for your explanations. I had not thought about this kind of setting. It is true that if you already have some of the projects in your Eclipse workspace with the Eclipse default names, the Eclipse build will fail because of the name mismatch. Deleting them from the Eclipse workspace and importing them again would be the way to go.

        People

        • Assignee:
          Unassigned
          Reporter:
          Anders Asplund
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development