You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Leif Nelson <ln...@llnl.gov> on 2003/10/01 00:28:01 UTC
eclipse .classpath with source & javadoc attachments
Hi all-
Not sure if anyone has thought of this... But, here's what we've been
thinking lately.
Wouldn't it be nice, if the eclipse:generate-classpath could generate a
.classpath file with references to src attachments? Furthermore, wouldn't
it also be nifty, if when deploying jars, you could tell Maven to build a
src zip/jar and deploy that too (with jar:deploy or
jar:deploy-snapshot). So, if I were a developer on log4j, I could put
something in project.xml or project.properties to identify that the src
jar/zip should be produced from the sources that generated the log4j
jar. This would populate the repository with both log4j-1.2.8.jar and
log4j-1.2.8-src.jar. Then, as a user of log4j, I could then identify in my
<resources> entry that I wanted Maven to fetch both jars when fetching
dependencies. Finally, when running eclipse:generate-classpath, it would
generate entries referring to said src jars. (and possibly update the
javadoc locations.. see the last few paragraphs)
So, I can see 3 different things that would need to be implemented
1) Somehow extend the POM to identify that when a jar is built & deployed,
the src should be built & deployed too. Both in the snapshot & regular case
2) Define something (possibly a property) in the dependency tag to let the
client know it should fetch the jar & src jar.
3) Update the eclipse plugin to generate the proper classpath entry to
reference the src jar in addition to the code jar (if it notices the
property defined in #2)
Right now, the generate-classpath goal goes through the dependencies in a
project and generates lines like this:
<classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar">
</classpathentry>
But, it could just as easily generate a line like this:
<classpathentry kind="var"
path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar"
sourcepath="MAVEN_REPO/log4j/jars/log4j-1.2.8-src.jar">
</classpathentry>
In our first attempt, we put in multiple dependency entries, one for the
jar, one for the src. Then, we modified the eclipse:generate-classpath
plugin, added a property: <jar.src>true<jar.src> to the log4j
dependency. Like this
<dependency>
<id>log4j</id>
<version>1.2.8</version>
<url>http://jakarta.apache.org/log4j</url>
<properties>
<war.bundle>true</war.bundle>
<jar.src>true</jar.src>
</properties>
</dependency>
<dependency>
<id>log4j</id>
<version>1.2.8-src</version>
<url>http://jakarta.apache.org/log4j</url>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
It would be nice to make the above just a single entry, and somehow have
the guy who downloads dependencies notice that if there's a "jar.src" entry
there, it should download the src jar too. Then we could remove the 2nd
dependency completely.
As an extra, we also thought of adding a URL to the dependency entry to
point specifically at the javadoc location on the doc site. Then, we could
update the associated javadocs URL in eclipse, so when you press "shift-f2"
when your cursor is positioned on a class, it would bring up the full
javadocs for that class. But, the problem is, the javadoc locations in
eclipse are stored
here:
workspace/.metadata/.plugins/org.eclipse/jdt.ui/javadoclocations.xml. And
an entry in that file looks like this:
<location_01
path="C:/Projects/maven-repo/log4j/jars/log4j-1.2.8.jar"
url="http://jakarta.apache.org/log4j/docs/api/"/>
Eclipse has fully pathed out the "variable" reference and placed it in a
separate file outside the project!.. So, we're not sure what to do here,
even though it would be nice if the eclipse plugin could somehow update
this stuff too.
Anyways, just thought we'd post our ideas, and see if anyone has any
suggestions or better ideas to solve this set of problems.
Thanks,
Leif Nelson
Mark McBride
RE: eclipse .classpath with source & javadoc attachments
Posted by Michal Maczka <mm...@raay-cqs.com>.
> -----Original Message-----
> From: Leif Nelson [mailto:lnelson@llnl.gov]
> Sent: Wednesday, October 01, 2003 12:28 AM
> To: users@maven.apache.org
> Subject: eclipse .classpath with source & javadoc attachments
>
> Hi all-
>
> Not sure if anyone has thought of this... But, here's what we've been
> thinking lately.
>
> Wouldn't it be nice, if the eclipse:generate-classpath could generate
a
> .classpath file with references to src attachments? Furthermore,
> wouldn't
> it also be nifty, if when deploying jars, you could tell Maven to
build
> a
> src zip/jar and deploy that too (with jar:deploy or
> jar:deploy-snapshot). So, if I were a developer on log4j, I could put
> something in project.xml or project.properties to identify that the
src
> jar/zip should be produced from the sources that generated the log4j
> jar. This would populate the repository with both log4j-1.2.8.jar and
> log4j-1.2.8-src.jar. Then, as a user of log4j, I could then identify
in
> my
> <resources> entry that I wanted Maven to fetch both jars when fetching
> dependencies. Finally, when running eclipse:generate-classpath, it
> would
> generate entries referring to said src jars. (and possibly update the
> javadoc locations.. see the last few paragraphs)
>
[...]
This will come
(probably in different form then you've described).
It should be left up to plugin what kind of auxiliary artifacts plugin
needs/is able to process (e.g. src, javadoc)
The main problem with current code which is a blocker for this
functionality is that plug-ins don't have access to artifact downloading
routines which are implemented in the core.
This issue probably won't be addressed in maven 1.0 as it requires
substantial changes in the code and in not scheduled for 1.0-final.
Michal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org