Resolve poms also from /usr/share/maven-poms

This will enable us to move fragments from etc
This commit is contained in:
Stanislav Ochotnicky 2011-06-10 11:17:07 +02:00
parent bdbc16d2c1
commit a170a2aaad
2 changed files with 14 additions and 5 deletions

View File

@ -1,15 +1,14 @@
package org.apache.maven.artifact.resolver;
import org.apache.maven.artifact.repository.MavenJPackageDepmap;
import java.io.File;
import java.util.List;
import java.util.LinkedList;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import org.apache.maven.artifact.repository.MavenJPackageDepmap;
import org.sonatype.aether.artifact.Artifact;
import org.sonatype.aether.repository.WorkspaceReader;
import org.sonatype.aether.repository.WorkspaceRepository;
import org.sonatype.aether.artifact.Artifact;
public class JavadirWorkspaceReader implements WorkspaceReader {
private WorkspaceRepository workspaceRepository;
@ -101,12 +100,20 @@ public class JavadirWorkspaceReader implements WorkspaceReader {
return new StringBuffer(f.getPath());
}
// now maven 3 specific repository
f = new File(System.getProperty("maven.local.default.repo",
"/usr/share/maven/repository") + "/" + m3path);
if (f.exists()) {
return new StringBuffer(f.getPath());
}
// now try new path in /usr. This will be the only check after all
// packages are rebuilt
f = new File("/usr/share/maven-poms/" + fName);
if (f.exists()) {
return new StringBuffer(f.getPath());
}
// final fallback to m2 default poms
return new StringBuffer("/usr/share/maven2/repository/"
+ System.getProperty("maven.local.default.repo",

View File

@ -310,6 +310,8 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%changelog
* Fri Jun 10 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.3-5
- Process fragments directly instead of maven2-depmap.xml
- Expect fragments in /usr/share/maven-fragments
- Resolve poms also from /usr/share/maven-poms
* Mon Jun 6 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0.3-4
- Add help to mvn-rpmbuild and mvn-local (rhbz#710448)