Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] m2e: Download Sources & JavaDocs ignores {maven.home}/conf/settings.xml

Hi All,
I'm running on eclipse Indigo (3.7) with the 1.1 release of m2eclipse,
and I'm noticing that when I right-click on a project to Download Sources (or JavaDocs) for an artifact which has been deployed to a remote repository other than maven central (our local Artifactory instance), I notice 2 things:
1. No source or javadoc found
2. the file m2e-lastUpdated.properties for the particular artifact looks like this:
#Fri May 25 10:20:35 PDT 2012
central|http\://repo1.maven.org/maven2|javadoc=1337966435016
central|http\://repo1.maven.org/maven2|sources=1337966433552

Additionally, my maven settings file has "central" configured to resolve to our local Artifactory instance, and my Maven Installations is not configured to use the embedded, but instead a local installation of the 3.0.3 release.
Also, I can see both the "-javadoc" and the "-sources" jars for the particular artifact in question within my local Artifactory.
The maven build for that artifact contains the following plugin definitions, which appear to be working correctly given the artifacts being uploaded to Artifactory.
    <build>
        <plugins>
            <!-- Generate a source jar for the project -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                    </execution>
                </executions>
                <configuration>
                    <attach>true</attach>
                </configuration>
            </plugin>
            <!-- Generate a JavaDoc jar for the project -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

The download sources feature does work correctly, but only for dependencies which are resolvable from maven central (it seems like m2e is ignoring my maven settings for this..)

I do not have a settings.xml file in my user folder, but instead, I have overridden the default settings.xml in the /conf directory of the maven installation.
(we generally do this as a way to distribute maven bundle for use within the org)

I also noticed that if I copy this settings.xml to my user directory, and delete the m2e-lastUpdated.properties file for the artifact, the download is successful.

So my conclusion is that m2eclipse is not following the normal maven settings resolution order (at least for this feature); as I believe it should first check {user.home}/.m2/settings.xml,
then, {maven.home}/conf/settings.xml, and then, whatever defaults it may have of it's own.
Is this assumption incorrect? Is this the expected behavior?

Any help is appreciated; thanks.
Matt


Back to the top