views:

31

answers:

1

I have a large base of maven 1 artifacts with their source jars named as app-0.0.1-src.jar. This repository is converted with nexus to a maven 2 view. Unfortunately the m2 convention on source jars is "...-sources.jar", so none of our m1 artifacts has sources.

Is there any way in nexus or otherwise to make maven 2 (esp. m2eclipse) download the sources with the old classifier ? I did try something like this without success:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <groupId>org.apache.maven.plugins</groupId>
            <configuration>
                <includeClassifiers>src,sources</includeClassifiers>
            </configuration>
        </plugin>
    </plugins>
</build>
+1  A: 

I guess if you are dealing with legacy apps and there won't be any new jars, a sufficient solution would be to write a shell script that loops over the repository and for every xyz-0.0.1-src.jar create a symbolic link at xyz-0.0.1-sources.jar.

Another solution would be to create a rewrite rule in your app server that redirects all requests from *-sources.* to *-src.* within your mvn 1 repository directory.

seanizer
Unfortuately the artifacts are still moving targets, we are in the process in migrating 50+ projects from maven 1 to 2/3, but the rewrite idea might work. Unfortunately for this i might need an apache frontend for nexus or put some servlet filter into the nexus war, which looks like an ugly hack ..
mglauche