You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Davis Ford <da...@gmail.com> on 2007/04/17 03:29:52 UTC

maven-eclipse-plugin has problem with muli-project resources

Hi, I posted on this earlier, but it fell on deaf ears, I guess.
Here's a concrete example of the problem I'm experiencing.  I followed
the directions for the maven-eclipse-plugin on generating a multiple
module project, as described here ->
http://maven.apache.org/plugins/maven-eclipse-plugin/reactor.html

[I tried attaching a .zip of this simple example, but it bounced]

This problem is easily reproduced.  I really welcome any clue on how
to workaround it.  How to reproduce:

1. D:\temp>mvn archetype:create -DgroupId=guide.ide.eclipse
-DartifactId=guide-ide-eclipse
2. D:\temp>cd guide-ide-eclipse
3. edit pom.xml, change <packaging>jar</packaging> to <packaging>pom</packaging>
3. D:\temp\guide-ide-eclipse>mvn archetype:create
-DgroupId=guide.ide.eclipse -DartifactId=guide-ide-eclipse-site
4. If you have the latest maven-eclipse-plugin, this should
auto-magically add the <parent> <-> <module> reference between parent
child projects in each respective pom.xml
5. D:\temp\guide-ide-eclipse>mkdir conf
6. D:\temp\guide-ide-eclipse>cd guide-ide-eclipse-site
7. edit the pom.xml of guide-ide-eclipse-site and add the following
between <project></project>:
  <build>
     <resources>
        <resource>
           <directory>../conf</directory>
        </resource>
     </resources>
  </build>
8. D:\temp\guide-ide-eclipse>cd guide-ide-eclipse-site
9. D:\temp\guide-ide-eclipse>mvn eclipse:eclipse
10. Try to import either the guide-ide-eclipse or the
guide-ide-eclipse-site project into eclipse.  You will get a build
path error regarding the conf directory.

The .classpath file for the guide-ide-eclipse-site project contains this:

<classpathentry kind="src" path="D:/temp/guide-ide-eclipse/conf"
excluding="**/*.java"/>

This seems completely reasonable, and the directory does exist, but
eclipse cannot build the project....why?

Thanks in advance,

Davis

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Barrie Treloar <ba...@gmail.com>.
On 4/17/07, Davis Ford <da...@gmail.com> wrote:
> Hi Barrie, I understand about create a separate resource module that
> can be shared.
>
> Let me ask a quick question though.  You mention you don't use a flat
> structure.  This isn't a flat structure as far as i can tell...it is
> hierarchical.

Fair enough, my misunderstanding.


> It's my understanding that a flat structure puts both parent and child
> at the same directory level, but this is not the case.

Yes, that's a flat structure.

Your problem is probably being caused because you are attempting to
reference something outside the scope of the eclipse project as a
directory.

If you can describe what types of things are in the "../conf"
directory, move advice might be forth coming.

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Davis Ford <da...@gmail.com>.
Hi Barrie, I understand about create a separate resource module that
can be shared.

Let me ask a quick question though.  You mention you don't use a flat
structure.  This isn't a flat structure as far as i can tell...it is
hierarchical.

It's my understanding that a flat structure puts both parent and child
at the same directory level, but this is not the case.

I wish there were some way around this.

Thanks for looking.

Davis

On 4/17/07, Barrie Treloar <ba...@gmail.com> wrote:
> On 4/17/07, Davis Ford <da...@zenoconsulting.biz> wrote:
> > Hi, it appears that in order for eclipse to see relative path links
> > like this, an entry needs to be made to the .project file with the
> > linkeResources tag.  If you manually add a src folder in eclipse, this
> > is the change it makes in .project.
> >
> > Is there some way to cause the maven-eclipse-plugin to do this via the pom.xml?
> >
> >         <linkedResources>
> >                 <link>
> >                         <name>conf</name>
> >                         <type>2</type>
> >                         <location>D:/temp/parent/conf</location>
> >                 </link>
> >         </linkedResources>
>
> Looking at http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
> I can't see how to do this.
>
> However I do know that eclipse:pde does write linkedResources.
>
> I personally do not use a flat structure, I use the hierarchical one.
>
> You might need to describe in more detail what ../conf contains.
> If this is a shared configuration, then the usual way to do this is to
> create another module project for "conf" and have your projects depend
> on "conf" in the pom.xml file.
>
> Then there is no need for eclipse linked resource trickery, everything
> is on the classpath.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Zeno Consulting, Inc.
http://www.zenoconsulting.biz
248.894.4922 phone
313.884.2977 fax

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Barrie Treloar <ba...@gmail.com>.
On 4/17/07, Davis Ford <da...@zenoconsulting.biz> wrote:
> Hi, it appears that in order for eclipse to see relative path links
> like this, an entry needs to be made to the .project file with the
> linkeResources tag.  If you manually add a src folder in eclipse, this
> is the change it makes in .project.
>
> Is there some way to cause the maven-eclipse-plugin to do this via the pom.xml?
>
>         <linkedResources>
>                 <link>
>                         <name>conf</name>
>                         <type>2</type>
>                         <location>D:/temp/parent/conf</location>
>                 </link>
>         </linkedResources>

Looking at http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
I can't see how to do this.

However I do know that eclipse:pde does write linkedResources.

I personally do not use a flat structure, I use the hierarchical one.

You might need to describe in more detail what ../conf contains.
If this is a shared configuration, then the usual way to do this is to
create another module project for "conf" and have your projects depend
on "conf" in the pom.xml file.

Then there is no need for eclipse linked resource trickery, everything
is on the classpath.

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Davis Ford <da...@zenoconsulting.biz>.
Hi, it appears that in order for eclipse to see relative path links
like this, an entry needs to be made to the .project file with the
linkeResources tag.  If you manually add a src folder in eclipse, this
is the change it makes in .project.

Is there some way to cause the maven-eclipse-plugin to do this via the pom.xml?

	<linkedResources>
		<link>
			<name>conf</name>
			<type>2</type>
			<location>D:/temp/parent/conf</location>
		</link>
	</linkedResources>

On 4/17/07, Davis Ford <da...@gmail.com> wrote:
> It says: Project child is missing required source folder: 'D:/temp/parent/conf'
>
> Try the steps to reproduce it..easy to reproduce.
>
> I think perhaps it has more to do with the eclipse jdt core.  Can it
> handle absolute paths?  I've tried editing the .classpath file
> manually to make it a relative path -- I really can't seem to make it
> work.  BTW: using eclipse 3.2.2.
>
> Any ideas?
>
> Regards,
> davis
>
> On 4/16/07, Haim Ashkenazi <ha...@babysnakes.org> wrote:
> > Davis Ford wrote:
> > [ .. ]
> > > The .classpath file for the guide-ide-eclipse-site project contains this:
> > >
> > > <classpathentry kind="src" path="D:/temp/guide-ide-eclipse/conf"
> > > excluding="**/*.java"/>
> > >
> > > This seems completely reasonable, and the directory does exist, but
> > > eclipse cannot build the project....why?
> > Hi
> >
> > I don't work on eclipse usually but when you open a project in eclipse and
> > it can't build it it usually show you what's the problem in the "Problems"
> > view (I'm not sure it's called like that). when I imported maven project
> > into eclipse for the first time it showed an error that the project could
> > not be built because I don't have an environment variables
> > called "M2_REPOS". what is the error when you open your project?
> >
> > Bye
> > --
> > Haim
> >
>


-- 
Zeno Consulting, Inc.
http://www.zenoconsulting.biz
248.894.4922 phone
313.884.2977 fax

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Davis Ford <da...@gmail.com>.
It says: Project child is missing required source folder: 'D:/temp/parent/conf'

Try the steps to reproduce it..easy to reproduce.

I think perhaps it has more to do with the eclipse jdt core.  Can it
handle absolute paths?  I've tried editing the .classpath file
manually to make it a relative path -- I really can't seem to make it
work.  BTW: using eclipse 3.2.2.

Any ideas?

Regards,
davis

On 4/16/07, Haim Ashkenazi <ha...@babysnakes.org> wrote:
> Davis Ford wrote:
> [ .. ]
> > The .classpath file for the guide-ide-eclipse-site project contains this:
> >
> > <classpathentry kind="src" path="D:/temp/guide-ide-eclipse/conf"
> > excluding="**/*.java"/>
> >
> > This seems completely reasonable, and the directory does exist, but
> > eclipse cannot build the project....why?
> Hi
>
> I don't work on eclipse usually but when you open a project in eclipse and
> it can't build it it usually show you what's the problem in the "Problems"
> view (I'm not sure it's called like that). when I imported maven project
> into eclipse for the first time it showed an error that the project could
> not be built because I don't have an environment variables
> called "M2_REPOS". what is the error when you open your project?
>
> Bye
> --
> Haim
>

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


Re: maven-eclipse-plugin has problem with muli-project resources

Posted by Haim Ashkenazi <ha...@babysnakes.org>.
Davis Ford wrote:
[ .. ]
> The .classpath file for the guide-ide-eclipse-site project contains this:
> 
> <classpathentry kind="src" path="D:/temp/guide-ide-eclipse/conf"
> excluding="**/*.java"/>
> 
> This seems completely reasonable, and the directory does exist, but
> eclipse cannot build the project....why?
Hi

I don't work on eclipse usually but when you open a project in eclipse and
it can't build it it usually show you what's the problem in the "Problems"
view (I'm not sure it's called like that). when I imported maven project
into eclipse for the first time it showed an error that the project could
not be built because I don't have an environment variables
called "M2_REPOS". what is the error when you open your project?

Bye
-- 
Haim


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