You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Diego Fernandez <df...@datatransfer.com.ar> on 2003/04/02 17:21:32 UTC

Some hacks to the eclipse plugin

Hi, I want to submit a small hack to the eclipse plug-in to allow
project references in the generation of the classpath.
It works like this:
- In the project dependencies add a property "eclipse.project" to the
dependency and it will be treated as an eclipse project, for example:
    <dependencies>
        <dependency>
            <groupId>delfos</groupId>
            <artifactId>delfos-ejb</artifactId>
            <version>SNAPSHOT</version>
            <properties>
            	<eclipse.project>true</eclipse.project>
            </properties>
        </dependency>
    </dependencies>

Then the plug-in generates the .classpath like this:
<classpathentry kind="src" path="/delfos-ejb" />

This is very useful when you have sub-projects.


Re: Some hacks to the eclipse plugin

Posted by di...@multitask.com.au.
Submit away on Jira...
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


"Diego Fernandez" <df...@datatransfer.com.ar> wrote on 02/04/2003 
12:21:32 PM:

> Hi, I want to submit a small hack to the eclipse plug-in to allow
> project references in the generation of the classpath.
> It works like this:
> - In the project dependencies add a property "eclipse.project" to the
> dependency and it will be treated as an eclipse project, for example:
>     <dependencies>
>         <dependency>
>             <groupId>delfos</groupId>
>             <artifactId>delfos-ejb</artifactId>
>             <version>SNAPSHOT</version>
>             <properties>
>                <eclipse.project>true</eclipse.project>
>             </properties>
>         </dependency>
>     </dependencies>
> 
> Then the plug-in generates the .classpath like this:
> <classpathentry kind="src" path="/delfos-ejb" />
> 
> This is very useful when you have sub-projects.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: Some hacks to the eclipse plugin

Posted by Matt Johnson <jo...@whitesmiths.com.au>.
I'm not 100% on this, but I think the properties in 
dependency/properties are dynamic, which means that the only plugins 
which use "ear.bundle.war" as a dependency property are the ear and 
jdeveloper plugins, the only plugin which uses "war.bundle.jar" is the 
war plugin, the only plugin which uses "jnlp.jar" is the jnlp plugin, etc.

The properties applied to a dependency are therefore ignored if you 
don't use that plugin - just as any properties in the project.properties 
file are ignored if they're not used anywhere.

In other words, any plugin can say "if you want to use this feature, 
just add a <properties> to your <dependency> called <x.y.z>".  Multiple 
subprojects don't work very well with eclipse because eclipse has an 
"exclusive" project path, in that no project can nest within another 
one, so attaching some metainfo to the dependencies is an excellent way 
of saying "refer to the workspace project xyz, rather than the jar".

I hope I haven't muddied the waters, but I think this is the way it works.


Matt

Moritz Petersen wrote:

> Although I work with Eclipse from time to time, I don't get it. Does 
> the <classpathentry> tag mean, that /delfos-ejb is interpreted as a 
> source path? I usually don't put my sources directly into the project 
> root. Further I don't have ever used project dependencies or 
> inheritance to build a project with multiple subprojects. But to my 
> mind, it should be used to create the "src" entry in the .classpath 
> file instead a IDE specific property.
> I mean that the use of IDE specific properties might be dangerous -- 
> although it appears to be quite useful in this case --, in the long 
> run we will end up in project descriptors, that depend on one specific 
> IDE. I don't think that this would be the idea of Maven.
> So, is it possible to modify this hack to use already build in 
> features of Maven, to gain the same effect? And: Is there a policy 
> about how IDE specific the project descriptor is allowed to be?
>
>
> -Mo.
>
>
> Am Mittwoch, 02.04.03 um 17:21 Uhr schrieb Diego Fernandez:
>
>> Hi, I want to submit a small hack to the eclipse plug-in to allow
>> project references in the generation of the classpath.
>> It works like this:
>> - In the project dependencies add a property "eclipse.project" to the
>> dependency and it will be treated as an eclipse project, for example:
>>     <dependencies>
>>         <dependency>
>>             <groupId>delfos</groupId>
>>             <artifactId>delfos-ejb</artifactId>
>>             <version>SNAPSHOT</version>
>>             <properties>
>>                 <eclipse.project>true</eclipse.project>
>>             </properties>
>>         </dependency>
>>     </dependencies>
>>
>> Then the plug-in generates the .classpath like this:
>> <classpathentry kind="src" path="/delfos-ejb" />
>>
>> This is very useful when you have sub-projects.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Re: Some hacks to the eclipse plugin

Posted by Moritz Petersen <mo...@mac.com>.
Although I work with Eclipse from time to time, I don't get it. Does 
the <classpathentry> tag mean, that /delfos-ejb is interpreted as a 
source path? I usually don't put my sources directly into the project 
root. Further I don't have ever used project dependencies or 
inheritance to build a project with multiple subprojects. But to my 
mind, it should be used to create the "src" entry in the .classpath 
file instead a IDE specific property.
I mean that the use of IDE specific properties might be dangerous -- 
although it appears to be quite useful in this case --, in the long run 
we will end up in project descriptors, that depend on one specific IDE. 
I don't think that this would be the idea of Maven.
So, is it possible to modify this hack to use already build in features 
of Maven, to gain the same effect? And: Is there a policy about how IDE 
specific the project descriptor is allowed to be?


-Mo.


Am Mittwoch, 02.04.03 um 17:21 Uhr schrieb Diego Fernandez:

> Hi, I want to submit a small hack to the eclipse plug-in to allow
> project references in the generation of the classpath.
> It works like this:
> - In the project dependencies add a property "eclipse.project" to the
> dependency and it will be treated as an eclipse project, for example:
>     <dependencies>
>         <dependency>
>             <groupId>delfos</groupId>
>             <artifactId>delfos-ejb</artifactId>
>             <version>SNAPSHOT</version>
>             <properties>
>             	<eclipse.project>true</eclipse.project>
>             </properties>
>         </dependency>
>     </dependencies>
>
> Then the plug-in generates the .classpath like this:
> <classpathentry kind="src" path="/delfos-ejb" />
>
> This is very useful when you have sub-projects.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


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