You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Barrie Treloar <ba...@gmail.com> on 2006/09/08 03:07:21 UTC

Re: [m2] How to get source JARs when sharing eclipse config -- best p ractices?

> we are using the eclipse plugin to create the Eclipse configuration, and
> specify the -DdownloadSources=true switch to download the source JARs and
> include them into the .classpath file. This is pretty cool, but....
>
> As usual, the .project and .classpath files are checked into CVS to share
> them with the team. Now what about the source JARs, how do the rest of the
> team get them from our internal maven-repo into their private one? The
> classes JARs are downloaded when calling mvn compile, for example, as they
> are defined in the POM's dependency section. But the source JARs aren't (and
> shouldn't), so how to download them? Does everybody have to call mvn
> eclipse:eclipse -DdownloadSources=true for that? Is there a better / simpler
> way?

Firstly, delete the .project and .classpath from your CVS.
These are created just fine by mvn eclipse:eclipse.

Secondly add to your pom's the source plugin to generate your sources.
When you run mvn install these will get installed into your local repo.
Someone will need to run mvn deploy to get them instaled into your
corporate repo.

    <plugins>
...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

Now when people run
mvn eclipse:eclipse -DdownloadSources=true it will also download the
source jars and attach them so you can browse around correctly.

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