You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by AndreasWuest <An...@gmx.de> on 2006/11/22 14:53:52 UTC

eclipse .classpath generation in a multiproject with eclipse:eclipse

hello,

i have a question concerning the usage of eclipse in a multiproject 
build. i have
a project that has the following structure :

+ project
     + ear
     + ejb
     + web

The project contains a pom.xml with the defined modules:

  <modules>
    <module>ear</module>
    <module>ejb</module>
    <module>web</module>
  </modules>

each of the modules contains a pom.xml of its own, well the usual stuff.
in the standalone version (without eclipse) everything works fine.
the problem occurs when i import that project into eclipse and try to 
compile
the project. after creating the
.classpath and .project files with mvn eclipse:eclipse from the project 
directory
i have a .classpath and a .project file in each of my module 
directories, not
in my project directory !

however eclipse ignores the created files in the modules directories, it 
expects
one file to be created in the project directory (root of the project). 
so is there
a way to tell the plugin to create a proper classpath and project file 
for the root
directory (the parent).

the file .classpath content is supposed to look something like :

<classpath>
    <classpathentry output="ear/target/classes" kind="src" 
path="ear/src/main/java"/>
    <classpathentry output="ejb/target/classes" kind="src" 
path="ejb/src/main/java"/>
    <classpathentry output="ejb/target/classes" kind="src" 
path="ejb/target/generated-sources/xdoclet"/>
    <classpathentry output="web/target/classes" kind="src" 
path="web/src/main/java"/>
         .....
    <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

basically i need for the source files of each module a specific output 
directory (usually
the classes in the target directory).

so what is needed is a kind of merged .classpath file in my project 
directory that
contains the individual .classpath file information from the mdules, so 
the eclipse ide can
compile the java classes and put them into the correct (module) output 
folders.

i can provide a testcase on request.

thanks in advance,
andy



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: eclipse .classpath generation in a multiproject with eclipse:eclipse

Posted by Barrie Treloar <ba...@gmail.com>.
On 11/23/06, AndreasWuest <An...@gmx.de> wrote:
> i have seen the guide, but it did not really convice me. so this guide
> tells me that i need at least two eclipse instances.
> one that only servers as a cvs client, and one which is used as java ide.
>
> i can't see the disadvantage of having a .project and a .classpath
> created in the parent, with properly set src and output folders.
> correct me if i am wrong, but the only disadvantage would be the fact,
> that it might be complicated to collect all the
> data and create the correct paths, or do i miss something ? once the src
> and output folders are set correctly everything
> is supposed to work fine, no need for two eclipse instances and
> inconvenient importing actions.

You don't need two eclipse instances.

The problem as Thomas Recloux points out is that each module has a
different classpath.
The parent "project" in eclipse should not be an aggregation of all
module classpaths.  It should just be a simple project with no
java/classpath details in it at all.

The problem is that eclipse does not support projects whose folder
structure lives within an already mounted project.  In Eclipse 3.2
this restriction has been lifted slightly.

With the snapshot build of the eclipse:eclipse plugin you can get
correct .project and .classpath created for your entire maven project
tree.  You then need to open the navigator view and delete the parent
project's ".project" file, File -> Import -> General -> Existing
projects into Workspace -> Select root directory = your project root,
and then select all the project you want to import.  If you forget to
delete the parent project's ".project" file then the list of projects
will be empty.

The above setup means you can use one CVS checkout of your parent
root, load the parent and all modules in eclipse and use CVS correctly
at any of the mounted projects.
If you are using subversion I believe there is an outstanding bug with
subclipse that causes projects within projects to consume 100% CPU.

The Nabble archives have plenty of discussions on this.
See http://www.nabble.com/forum/ViewPost.jtp?post=5862059&framed=y&skin=177

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: eclipse .classpath generation in a multiproject with eclipse:eclipse

Posted by Thomas Recloux <th...@gmail.com>.
> i have seen the guide, but it did not really convice me. so this guide
> tells me that i need at least two eclipse instances.
> one that only servers as a cvs client, and one which is used as java ide.

You can't use an other cvs client for the root pom ?

> i can't see the disadvantage of having a .project and a .classpath
> created in the parent, with properly set src and output folders.
> correct me if i am wrong, but the only disadvantage would be the fact,
> that it might be complicated to collect all the
> data and create the correct paths, or do i miss something ? once the src
> and output folders are set correctly everything
> is supposed to work fine, no need for two eclipse instances and
> inconvenient importing actions.

The first response I can give is that the classpath is not the same
for your three modules.

-- 
Thomas Recloux a.k.a Karmelitre
http://karmelitre.tartachuc.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: eclipse .classpath generation in a multiproject with eclipse:eclipse

Posted by AndreasWuest <An...@gmx.de>.
i have seen the guide, but it did not really convice me. so this guide 
tells me that i need at least two eclipse instances.
one that only servers as a cvs client, and one which is used as java ide.

i can't see the disadvantage of having a .project and a .classpath 
created in the parent, with properly set src and output folders.
correct me if i am wrong, but the only disadvantage would be the fact, 
that it might be complicated to collect all the
data and create the correct paths, or do i miss something ? once the src 
and output folders are set correctly everything
is supposed to work fine, no need for two eclipse instances and 
inconvenient importing actions.



> The maven eclipse plugin creates eclipse .project and .classpath files
> for each maven project ( : pom.xml file).
>
> You should read this guide :
> http://maven.apache.org/guides/mini/guide-ide-eclipse.html
>
> 2006/11/22, AndreasWuest <An...@gmx.de>:
>
>> hello,
>>
>> i have a question concerning the usage of eclipse in a multiproject
>> build. i have
>> a project that has the following structure :
>>
>> + project
>>     + ear
>>     + ejb
>>     + web
>>
>> The project contains a pom.xml with the defined modules:
>>
>>  <modules>
>>    <module>ear</module>
>>    <module>ejb</module>
>>    <module>web</module>
>>  </modules>
>>
>> each of the modules contains a pom.xml of its own, well the usual stuff.
>> in the standalone version (without eclipse) everything works fine.
>> the problem occurs when i import that project into eclipse and try to
>> compile
>> the project. after creating the
>> .classpath and .project files with mvn eclipse:eclipse from the project
>> directory
>> i have a .classpath and a .project file in each of my module
>> directories, not
>> in my project directory !
>>
>> however eclipse ignores the created files in the modules directories, it
>> expects
>> one file to be created in the project directory (root of the project).
>> so is there
>> a way to tell the plugin to create a proper classpath and project file
>> for the root
>> directory (the parent).
>>
>> the file .classpath content is supposed to look something like :
>>
>> <classpath>
>>    <classpathentry output="ear/target/classes" kind="src"
>> path="ear/src/main/java"/>
>>    <classpathentry output="ejb/target/classes" kind="src"
>> path="ejb/src/main/java"/>
>>    <classpathentry output="ejb/target/classes" kind="src"
>> path="ejb/target/generated-sources/xdoclet"/>
>>    <classpathentry output="web/target/classes" kind="src"
>> path="web/src/main/java"/>
>>         .....
>>    <classpathentry kind="con"
>> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>>    <classpathentry kind="output" path="bin"/>
>> </classpath>
>>
>> basically i need for the source files of each module a specific output
>> directory (usually
>> the classes in the target directory).
>>
>> so what is needed is a kind of merged .classpath file in my project
>> directory that
>> contains the individual .classpath file information from the mdules, so
>> the eclipse ide can
>> compile the java classes and put them into the correct (module) output
>> folders.
>>
>> i can provide a testcase on request.
>>
>> thanks in advance,
>> andy
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: eclipse .classpath generation in a multiproject with eclipse:eclipse

Posted by Thomas Recloux <th...@gmail.com>.
The maven eclipse plugin creates eclipse .project and .classpath files
for each maven project ( : pom.xml file).

You should read this guide :
http://maven.apache.org/guides/mini/guide-ide-eclipse.html

2006/11/22, AndreasWuest <An...@gmx.de>:
> hello,
>
> i have a question concerning the usage of eclipse in a multiproject
> build. i have
> a project that has the following structure :
>
> + project
>     + ear
>     + ejb
>     + web
>
> The project contains a pom.xml with the defined modules:
>
>  <modules>
>    <module>ear</module>
>    <module>ejb</module>
>    <module>web</module>
>  </modules>
>
> each of the modules contains a pom.xml of its own, well the usual stuff.
> in the standalone version (without eclipse) everything works fine.
> the problem occurs when i import that project into eclipse and try to
> compile
> the project. after creating the
> .classpath and .project files with mvn eclipse:eclipse from the project
> directory
> i have a .classpath and a .project file in each of my module
> directories, not
> in my project directory !
>
> however eclipse ignores the created files in the modules directories, it
> expects
> one file to be created in the project directory (root of the project).
> so is there
> a way to tell the plugin to create a proper classpath and project file
> for the root
> directory (the parent).
>
> the file .classpath content is supposed to look something like :
>
> <classpath>
>    <classpathentry output="ear/target/classes" kind="src"
> path="ear/src/main/java"/>
>    <classpathentry output="ejb/target/classes" kind="src"
> path="ejb/src/main/java"/>
>    <classpathentry output="ejb/target/classes" kind="src"
> path="ejb/target/generated-sources/xdoclet"/>
>    <classpathentry output="web/target/classes" kind="src"
> path="web/src/main/java"/>
>         .....
>    <classpathentry kind="con"
> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>    <classpathentry kind="output" path="bin"/>
> </classpath>
>
> basically i need for the source files of each module a specific output
> directory (usually
> the classes in the target directory).
>
> so what is needed is a kind of merged .classpath file in my project
> directory that
> contains the individual .classpath file information from the mdules, so
> the eclipse ide can
> compile the java classes and put them into the correct (module) output
> folders.
>
> i can provide a testcase on request.
>
> thanks in advance,
> andy
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Thomas Recloux a.k.a Karmelitre
http://karmelitre.tartachuc.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org