rpms/maven2/devel maven2-JPackageRepositoryLayout.java, NONE, 1.1 maven2-MavenJPackageDepmap.java, NONE, 1.1 maven2-addjdom-depmap.xml, NONE, 1.1 maven2-addjdomtobootstrappath.patch, NONE, 1.1 maven2-buildallplugins.patch, NONE, 1.1 maven2-disable-itests.patch, NONE, 1.1 maven2-empty-dep.pom, NONE, 1.1 maven2-enable-unbuilt-modules.patch, NONE, 1.1 maven2-jpp-readme.html, NONE, 1.1 maven2-jpp-script, NONE, 1.1 maven2-jpprepolayout.patch, NONE, 1.1 maven2-noexternaljavadoclinks.patch, NONE, 1.1 maven2-plugins-disablecglib.patch, NONE, 1.1 maven2-plugins-plexus151.patch, NONE, 1.1 maven2-run-it-tests.sh, NONE, 1.1 maven2-script, NONE, 1.1 maven2-settings.xml, NONE, 1.1 maven2.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Deepak Bhole (dbhole)
fedora-extras-commits at redhat.com
Tue Mar 20 00:53:13 UTC 2007
Author: dbhole
Update of /cvs/extras/rpms/maven2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4178/devel
Modified Files:
.cvsignore sources
Added Files:
maven2-JPackageRepositoryLayout.java
maven2-MavenJPackageDepmap.java maven2-addjdom-depmap.xml
maven2-addjdomtobootstrappath.patch
maven2-buildallplugins.patch maven2-disable-itests.patch
maven2-empty-dep.pom maven2-enable-unbuilt-modules.patch
maven2-jpp-readme.html maven2-jpp-script
maven2-jpprepolayout.patch maven2-noexternaljavadoclinks.patch
maven2-plugins-disablecglib.patch
maven2-plugins-plexus151.patch maven2-run-it-tests.sh
maven2-script maven2-settings.xml maven2.spec
Log Message:
auto-import maven2-2.0.4-10jpp.3 on branch devel from maven2-2.0.4-10jpp.3.src.rpm
--- NEW FILE maven2-JPackageRepositoryLayout.java ---
package org.apache.maven.artifact.repository.layout;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.xml.sax.InputSource;
/**
* Repository layout for jpackage based repositories.
* This class resolves items for jpp style repos (i.e things located in
* /usr/share/java).
*/
public class JPackageRepositoryLayout
implements ArtifactRepositoryLayout
{
private static Hashtable jppArtifactMap;
private static final char GROUP_SEPARATOR = '.';
private static final char PATH_SEPARATOR = '/';
public String pathOf( Artifact artifact )
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuffer path = new StringBuffer();
String artifactId = artifact.getArtifactId();
String groupId = artifact.getGroupId();
String version = artifact.getVersion();
if (!groupId.startsWith("JPP")) {
MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
Hashtable newInfo = map.getMappedInfo(groupId, artifactId, version);
groupId = (String) newInfo.get("group");
artifactId = (String) newInfo.get("artifact");
}
if (artifactHandler.getPackaging().equals("pom")) {
path = getPOMPath(groupId, artifactId);
} else {
path.append( groupId ).append( '/' );
path.append( artifactId ).append( ".jar" );
}
return path.toString();
}
private StringBuffer getPOMPath(String groupId, String artifactId) {
StringBuffer path = new StringBuffer();
String fName = groupId.replace(PATH_SEPARATOR, GROUP_SEPARATOR) + "-" + artifactId + ".pom";
path.append(System.getProperty("maven2.jpp.pom.path", "JPP/maven2/poms")).append("/").append(fName);
java.io.File f;
// NOTE: We are returning default_poms/ as the path for this pom
// even though it may not exist there. This may cause an error,
// but that is fine because if the pom is not there, there is
// a serious problem anyways..
f = new java.io.File(System.getProperty("maven2.jpp.default.repo", "/usr/share/maven2/repository") + "/" + path.toString());
//System.err.println("Checking path " + f.getAbsolutePath() + " for the pom");
if (!f.exists()) {
path = new StringBuffer();
path.append(System.getProperty("maven2.jpp.default.pom.path", "JPP/maven2/default_poms")).append("/").append(fName);
}
return path;
}
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
{
return pathOfRepositoryMetadata( metadata, metadata.getLocalFilename( repository ) );
}
private String pathOfRepositoryMetadata( ArtifactMetadata metadata, String filename )
{
StringBuffer path = new StringBuffer();
if (filename.substring(filename.length()-4).equals(".pom")) {
path = getPOMPath(metadata.getGroupId(), metadata.getArtifactId());
} else {
// FIXME: If it gets here, something other than a pom was requested.. where are those things located?
path.append(System.getProperty("maven2.jpp.pom.path", "maven2/poms")).append("/").append(filename);
}
return path.toString();
}
public String pathOfRemoteRepositoryMetadata( ArtifactMetadata metadata )
{
return pathOfRepositoryMetadata( metadata, metadata.getRemoteFilename() );
}
}
--- NEW FILE maven2-MavenJPackageDepmap.java ---
package org.apache.maven.artifact.repository.layout;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.xml.sax.InputSource;
public class MavenJPackageDepmap {
private static MavenJPackageDepmap instance;
private static Hashtable jppArtifactMap;
private MavenJPackageDepmap() {
jppArtifactMap = new Hashtable();
buildJppArtifactMap();
}
public static MavenJPackageDepmap getInstance() {
if (instance == null) {
instance = new MavenJPackageDepmap();
}
return instance;
}
public Hashtable getMappedInfo(Hashtable mavenDep) {
return getMappedInfo((String) mavenDep.get("group"),
(String) mavenDep.get("artifact"),
(String) mavenDep.get("version"));
}
public Hashtable getMappedInfo(String groupId, String artifactId, String version) {
Hashtable jppDep;
String idToCheck, jppCombination;
if (System.getProperty("maven2.ignore.versions") == null && System.getProperty("maven2.jpp.mode") == null) {
idToCheck = groupId+","+artifactId+","+version;
} else {
idToCheck = groupId+","+artifactId;
}
jppCombination = (String) jppArtifactMap.get(idToCheck);
//System.err.println("*** " + groupId+","+artifactId+","+version + " => " + jppCombination);
jppDep = new Hashtable();
if (jppCombination != null && jppCombination != "") {
StringTokenizer st = new StringTokenizer(jppCombination, ",");
jppDep.put("group", st.nextToken());
jppDep.put("artifact",st.nextToken());
jppDep.put("version",st.nextToken());
} else {
jppDep.put("group", groupId);
jppDep.put("artifact", artifactId);
jppDep.put("version", version);
}
return jppDep;
}
/**
* Returns whether or not the given dependency should be dropped.
*/
public boolean shouldEliminate(String groupId, String artifactId, String version) {
String idToCheck;
if (System.getProperty("maven2.ignore.versions") == null && System.getProperty("maven2.jpp.mode") == null) {
idToCheck = groupId+","+artifactId+","+version;
} else {
idToCheck = groupId+","+artifactId;
}
return jppArtifactMap.get(idToCheck) != null && jppArtifactMap.get(idToCheck).equals("");
}
private static void buildJppArtifactMap() {
if (System.getProperty("maven2.ignore.versions") != null || System.getProperty("maven2.jpp.mode") != null) {
//System.err.println("Processing file: /usr/share/java-utils/xml/maven2-versionless-depmap.xml");
processDepmapFile("/etc/maven/maven2-versionless-depmap.xml");
}
//System.err.println("Processing file: /usr/share/java-utils/xml/maven2-depmap.xml");
processDepmapFile("/etc/maven/maven2-depmap.xml");
String customFileName = System.getProperty("maven2.jpp.depmap.file", null);
if (customFileName != null) {
//System.err.println("Processing file: " + customFileName);
processDepmapFile(customFileName);
}
}
private static void processDepmapFile(String fileName) {
Document mapDocument;
try {
mapDocument = (new SAXBuilder()).build(new InputSource(new FileInputStream(fileName)));
} catch (FileNotFoundException fnfe) {
System.err.println("ERROR: Unable to find map file: " + fileName);
fnfe.printStackTrace();
return;
} catch (IOException ioe) {
System.err.println("ERROR: I/O exception occured when opening map file");
ioe.printStackTrace();
return;
} catch (JDOMException jde) {
System.err.println("ERROR: Unable to instantiate parser");
jde.printStackTrace();
return;
}
List l = mapDocument.getRootElement().getChildren("dependency");
Iterator i = l.iterator();
while (i.hasNext()) {
Element depElement = (Element) i.next();
Element mElem = depElement.getChild("maven");
Element jppElem = depElement.getChild("jpp");
String mG = mElem.getChildText("groupId");
String mA = mElem.getChildText("artifactId");
String mV = mElem.getChildText("version");
// jppElem == null => drop this dependency
if (jppElem != null) {
String jppG = jppElem.getChildText("groupId");
String jppA = jppElem.getChildText("artifactId");
String jppV = jppElem.getChildText("version");
if (System.getProperty("maven2.ignore.versions") == null && System.getProperty("maven2.jpp.mode") == null) {
//System.err.println("*** Adding: " + mG+","+mA+","+mV + " => " + jppG+","+jppA+","+jppV + " to map...");
jppArtifactMap.put(mG+","+mA+","+mV, jppG+","+jppA+","+jppV);
} else {
//System.err.println("*** Adding: " + mG+","+mA + " => " + jppG+","+jppA+","+jppV + " to map...");
jppArtifactMap.put(mG+","+mA, jppG+","+jppA+","+jppV);
}
} else {
//System.err.println("*** Adding: " + mG+","+mA+"," + " => " + "JPP/maven2,empty-dep,"+mV + " to map...");
jppArtifactMap.put(mG+","+mA, "JPP/maven2,empty-dep,"+mV);
}
}
}
}
--- NEW FILE maven2-addjdom-depmap.xml ---
<dependencies>
<add>
<dependency>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.0</version>
</dependency>
</add>
</dependencies>
maven2-addjdomtobootstrappath.patch:
--- NEW FILE maven2-addjdomtobootstrappath.patch ---
--- ./maven2/bootstrap/bootstrap-installer/src/main/resources/META-INF/MANIFEST.MF.sav 2006-06-01 19:22:07.000000000 -0400
+++ ./maven2/bootstrap/bootstrap-installer/src/main/resources/META-INF/MANIFEST.MF 2006-06-01 19:22:16.000000000 -0400
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Main-Class: org.apache.maven.bootstrap.installer.BootstrapInstaller
-Class-Path: bootstrap-mini-2.0.4-SNAPSHOT.jar plexus-utils-1.0.4.jar
+Class-Path: bootstrap-mini-2.0.4-SNAPSHOT.jar jdom-1.0.jar plexus-utils-1.0.4.jar
maven2-buildallplugins.patch:
--- NEW FILE maven2-buildallplugins.patch ---
--- ./maven2-plugins/pom.xml.sav 2006-07-10 18:22:18.000000000 -0400
+++ ./maven2-plugins/pom.xml 2006-07-10 18:23:08.000000000 -0400
@@ -32,12 +32,14 @@
</repositories>
<modules>
<module>maven-ant-plugin</module>
+ <module>maven-antlr-plugin</module>
<module>maven-antrun-plugin</module>
<module>maven-assembly-plugin</module>
<module>maven-checkstyle-plugin</module>
<module>maven-clean-plugin</module>
<module>maven-clover-plugin</module>
<module>maven-compiler-plugin</module>
+ <module>maven-dependency-plugin</module>
<module>maven-deploy-plugin</module>
<module>maven-eclipse-plugin</module>
<module>maven-ear-plugin</module>
@@ -48,6 +50,7 @@
<module>maven-jar-plugin</module>
<module>maven-javadoc-plugin</module>
<module>maven-jxr-plugin</module>
+ <module>maven-one-plugin</module>
<module>maven-plugin-plugin</module>
<module>maven-pmd-plugin</module>
<module>maven-project-info-reports-plugin</module>
maven2-disable-itests.patch:
--- NEW FILE maven2-disable-itests.patch ---
--- ./maven2/bootstrap.sh.sav 2006-06-01 19:31:18.000000000 -0400
+++ ./maven2/bootstrap.sh 2006-06-01 19:31:28.000000000 -0400
@@ -46,26 +46,3 @@
unset M2_HOME
$JAVACMD $MAVEN_OPTS -jar bootstrap/bootstrap-installer/target/bootstrap-installer.jar --prefix=$PREFIX $ARGS
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
-M2_HOME=$OLD_M2_HOME
-export M2_HOME
-
-ARGS=$ORIG_ARGS
-
-(
- # TODO: should we be going back to the mini now that we have the real thing?
- cd maven-core-it-verifier
- $JAVACMD $MAVEN_OPTS -jar ../bootstrap/$BOOTSTRAP_JAR package $ARGS
- ret=$?; if [ $ret != 0 ]; then exit $ret; fi
-)
-ret=$?; if [ $ret != 0 ]; then exit $ret; fi
-
-(
- cd ./maven-core-it
- echo
- echo "Running maven-core integration tests ..."
- echo
- ./maven-core-it.sh $ARGS
- ret=$?; if [ $ret != 0 ]; then exit $ret; fi
-)
-ret=$?; if [ $ret != 0 ]; then exit $ret; fi
-
--- NEW FILE maven2-empty-dep.pom ---
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>JPP/maven2</groupId>
<artifactId>empty-dep</artifactId>
<version>2.0.4</version>
<name>Empty dependency</name>
<description>This is an empty dependency. For use in jpp mode when one or more dependencies need elimination.</description>
</project>
maven2-enable-unbuilt-modules.patch:
--- NEW FILE maven2-enable-unbuilt-modules.patch ---
--- ./maven2/pom.xml.sav 2006-09-21 18:10:21.000000000 -0400
+++ ./maven2/pom.xml 2006-09-21 18:10:25.000000000 -0400
@@ -196,10 +196,13 @@
<modules>
<module>maven-archiver</module>
<module>maven-artifact</module>
+ <module>maven-artifact-ant</module>
<module>maven-artifact-manager</module>
<module>maven-artifact-test</module>
<module>maven-core</module>
+ <module>maven-embedder</module>
<module>maven-error-diagnostics</module>
+ <module>maven-meeper</module>
<module>maven-model</module>
<module>maven-model-converter</module>
<module>maven-monitor</module>
--- NEW FILE maven2-jpp-readme.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>JPackage Maven2</title>
</head>
<body>
<h1>Notes on the JPackage version of Maven2 (2.0.4)</h1>
<p>
The maven2 version released with JPackage has extensive modifications to ensure that it works smoothly in off-line mode. In order to facilitate easier maintainability, minimal changes have been made, and most have been kept in separate source files rather than patching into maven code.
<p>
<p>
<u><b>How to use it:</b></u><br/>
Previously, when one needed to create a new rpm, for the build part they needed to set up a depmap, run all poms in a project via an xsl transformation that used the depmap to rewrite groupid's/artifactid's/etc., supply repository locations, and then call maven. Most of that has now been done away with.
</p>
<p>
Starting with the 9jpp release, to invoke maven in jpp mode, simply type 'mvn-jpp' with the -Dmaven2.jpp.depmap.file="..." argument if a separate depmap is needed. The command action is almost the same as "mvn" -- only that it supplies '-Dmaven2.offline.mode -Dmaven2.ignore.versions -Dmaven2.usejppjars' prior to invoking maven.
</p>
<p>
<b><u>Dependency maps/'depmaps':</b></u><br/>
To build a new project for a new JPackage rpm, a depmap still needs to be created so as to allow finding of the new jars. But this is not too different from the old way of using build-jar-repository with ant. The idea is the same -- tell the build tool where to find the required libraries.<br/><br/>
The depmap has entries in the format:<br/>
<pre>
<dependencies>
..
<dependency>
<maven>
<groupId>OGROUPID</groupId>
<artifactId>OARTIFACTID</artifactId>
<version>OVERSION</version>
</maven>
<jpp>
<groupId>NGROUPID</groupId>
<artifactId>NARTIFACTID</artifactId>
<version>NVERSION</version>
</jpp>
</dependency>
..
<dependencies>
</pre>
<br/><br/>
Where OGROUPID, OARTIFACTID and OVERSION are old group/artifact/versions (as they exist in your project) and NGROUPID, NARTIFACTID, NVERSION are the new ones. For example:<br/>
<pre>
<dependency>
<maven>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</maven>
<jpp>
<groupId>JPP</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</jpp>
</dependency>
</pre>
The above mapping indicates that if any of the poms need an artifact with groupid=junit, artifactid=junit and version=3.8.1, it can be found at $REPOSITORY/JPP/junit.jar
</p>
Where $REPOSITORY is one of the active repositories with layout="jpp" ("jpp" is a new layout that has been added to our maven2 rpm).<br/><br/>
If maven2.ignore.versions is specified, any requirement of groupid=junit, artifactid=junit will be satisfied with $REPOSITORY/JPP/junit.jar (i.e. version will be ignored even if mentioned in the depmap).<br/><br/>
If only a <maven> element is supplied and no <jpp>, it is assumed that the dependency is to be discarded. For example, some projects depend on the 'velocity-dep' which has no equivalent jar in JPackage packages as velocity-dep is just a monolithic jar containing velocity dependencies. To remove velocity-dep then, you would add:<br/>
<pre>
<dependency>
<maven>
<groupId>velocity</groupId>
<artifactId>velocity-dep</artifactId>
<version>1.4</version>
</maven>
</dependency>
</pre>
to the depmap.<br/><br/>
There are two system depmaps. An unversioned one is located at: <tt>/etc/maven/maven2-versionless-depmap.xml</tt>. This is used when -Dmaven2-ignore-versions is specified. A versioned one is located at <tt>/etc/maven/maven2-depmap.xml</tt>. This is an autogenerated map which is rebuilt each time the <tt>update_maven_depmap</tt> macro is called by an rpm.
Finally, a custom one can be specified via -Dmaven2.jpp.depmap.file="..."<br/><br/>
The versionless one contains depmap entries for items whose poms are installed by maven2-common-poms (for now). As time passes, more and more packages will start using the <tt>add_to_maven_depmap</tt> and <tt>update_maven_depmap</tt> macros and hopefully, the versionless can be phased out completely. If your project needs a mapping that is not already in there, you will have to create a separate file and use it via the above mentioned property.<br/><br/>
<i>The custom depmap has highest preference, followed by the versioned depmap, followed by the versionless one </i><br/><br/>
<u><b>Packages adding their own depmaps:</b></u><br/>
Packages from now on should add their own depmap fragments when they get installed. This is achieved by calling the <tt>add_to_maven_depmap</tt> macro for each jar/artifact being installed, followed by calling <tt>update_maven_depmap</tt> in the post and postun sections (note: this means that there will have to be a jpackage-utils >= 0:1.7.2 post and postun requirement for all packages that do this, since jpackage-utils 1.7.2 provides the macros). Finally, <tt>%{_mavendepmapfragdir}</tt> (=/etc/maven/fragments) should be added in the %files section of the main package. The idea is as follows:<br/><br/>
The %install section of each package uses the <tt>add_to_maven_depmap</tt> macro for each jar/pom that the main package and it's subpackages install. The macro puts the resulting data in <tt>$RPM_BUILD_ROOT%{_mavendepmapfragdir}/%{name}</tt>. <tt>update_maven_depmap</tt> in the post and postun then cat's /etc/maven/fragments/* into /etc/maven/maven2-depmap.xml which is read whenever mvn is run. See the plexus-cdc spec for a simple example, and maven-doxia for a more complex one.<br/><br/>
<p>
<b><u>New properties:</b></u><br/>
<ul>
<li><i>maven2.offline.mode</i> - Combined with maven2.ignore.versions, this switch is analogous to maven2.jpp.mode in 8jpp and lower. It tells maven to use the pre-configured jpackage repositories.</li>
<li><i>maven2.ignore.versions</i> - Combined with maven2.offline.mode, this switch is analogous to maven2.jpp.mode in 8jpp and lower. It tells maven to ignore versions when looking at the dependency map.</li>
<li><i>maven2.usejppjars</i> - This is a new option. When supplied, maven will try to use jpackage jars whenever possible. It's main intention is to allow users to use /usr/share/java files when available, and fetch jars from the net if not. It may be combined with the above two.</li>
<li><i>maven2.jpp.depmap.file</i> - This option tells maven where to find the dependency mappings.</li>
</ul>
</p>
</body>
</html>
--- NEW FILE maven2-jpp-script ---
#!/bin/sh
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
set_jvm
set_javacmd
fi
export M2_HOME=/usr/share/maven2
echo $JAVA_HOME
export JAVA_HOME; $M2_HOME/bin/mvn -Dmaven2.offline.mode -Dmaven2.ignore.versions -Dmaven2.usejppjars $@
maven2-jpprepolayout.patch:
--- NEW FILE maven2-jpprepolayout.patch ---
--- ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java.sav 2005-11-16 22:39:28.000000000 -0500
+++ ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java 2006-10-11 18:16:56.000000000 -0400
@@ -18,6 +18,8 @@
import java.io.File;
import java.util.Collections;
+import java.util.Hashtable;
+import org.apache.maven.artifact.repository.layout.MavenJPackageDepmap;
/**
* Repository path management.
@@ -31,6 +33,12 @@
public static final String LAYOUT_DEFAULT = "default";
+ public static final String LAYOUT_JPP = "jpp";
+
+ private static final char GROUP_SEPARATOR = '.';
+
+ private static final char PATH_SEPARATOR = '/';
+
private String basedir;
private String layout;
@@ -64,7 +72,26 @@
public String getArtifactPath( Dependency dependency )
{
String repositoryPath;
- if ( LAYOUT_LEGACY.equals( layout ) )
+
+ if ( LAYOUT_JPP.equals( layout ) )
+ {
+
+ String groupId, artifactId;
+
+ MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
+ Hashtable newInfo = map.getMappedInfo(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion());
+
+ groupId = (String) newInfo.get("group");
+ artifactId = (String) newInfo.get("artifact");
+
+ if (dependency.getType().equals("pom")) {
+ return getMetadataPath(groupId, artifactId, dependency.getVersion(), dependency.getType(), dependency.getArtifact());
+ }
+
+ // Same as legacy layout
+ repositoryPath = groupId + "/" + artifactId + ".jar";
+ }
+ else if ( LAYOUT_LEGACY.equals( layout ) )
{
repositoryPath = dependency.getArtifactDirectory() + "/" + dependency.getType() + "s/" +
dependency.getArtifact();
@@ -94,7 +121,30 @@
Dependency dependency = new Dependency( groupId, artifactId, version, type, Collections.EMPTY_LIST );
String repositoryPath;
- if ( LAYOUT_LEGACY.equals( layout ) )
+ if ( LAYOUT_JPP.equals( layout ) )
+ {
+ if (filename.substring(filename.length()-4).equals(".pom") || type.equals("pom")) {
+
+ MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
+ Hashtable newInfo = map.getMappedInfo(groupId, artifactId, version);
+
+ groupId = (String) newInfo.get("group");
+ artifactId = (String) newInfo.get("artifact");
+
+ String fName = groupId.replace(PATH_SEPARATOR, GROUP_SEPARATOR) + "-" + artifactId + ".pom";
+ repositoryPath = System.getProperty("maven2.jpp.pom.path", "JPP/maven2/poms") + "/" + fName;
+ java.io.File f;
+
+ // .substring(6) removes preceeding file://
+ f = new File(basedir.substring(6) + "/" + repositoryPath);
+ if (!f.exists()) {
+ repositoryPath = System.getProperty("maven2.jpp.default.pom.path", "JPP/maven2/default_poms") + "/" + fName;
+ }
+ } else {
+ repositoryPath = System.getProperty("maven2.jpp.pom.path", "JPP/maven2/poms") + "/" + filename;
+ }
+ }
+ else if ( LAYOUT_LEGACY.equals( layout ) )
{
repositoryPath = dependency.getArtifactDirectory() + "/poms/" + filename;
}
@@ -102,16 +152,37 @@
{
repositoryPath = dependency.getGroupId().replace( '.', '/' );
repositoryPath = repositoryPath + "/" + dependency.getArtifactId();
- if ( version != null )
+
+ String newVersion = version;
+ String newFilename = filename;
+
+ if ( (
+ ( System.getProperty("maven2.offline.mode") != null &&
+ System.getProperty("maven2.ignore.versions") != null ) ||
+ (System.getProperty("maven2.jpp.mode") != null)
+ ) &&
+ version != null) {
+ MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
+ Hashtable newInfo = map.getMappedInfo(groupId, artifactId, version);
+
+ newVersion = (String) newInfo.get("version");
+
+ //System.err.println("Replacing " + dependency.getVersion() + " with " + newVersion + " in offline+ignore versions mode");
+
+ newFilename = filename.replaceFirst(dependency.getVersion(), newVersion);
+ }
+
+ if ( newVersion != null )
{
- repositoryPath = repositoryPath + "/" + dependency.getVersion();
+ repositoryPath = repositoryPath + "/" + newVersion;
}
- repositoryPath = repositoryPath + "/" + filename;
+ repositoryPath = repositoryPath + "/" + newFilename;
}
else
{
throw new IllegalStateException( "Unknown layout: " + layout );
}
+
return repositoryPath;
}
--- ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java.sav 2005-11-11 10:05:53.000000000 -0500
+++ ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java 2006-10-11 17:42:21.000000000 -0400
@@ -48,7 +48,8 @@
private String proxyPassword;
- private static final String REPO_URL = "http://repo1.maven.org/maven2";
+ private static final String INTERNAL_REPO_URL = "__INTERNAL_REPO_PLACEHOLDER__";
+ private static final String EXTERNAL_REPO_URL = "__EXTERNAL_REPO_PLACEHOLDER__";
private Map downloadedArtifacts = new HashMap();
@@ -145,7 +146,9 @@
try
{
String version = dep.getVersion();
- if ( snapshot )
+ if ( snapshot &&
+ ((System.getProperty("maven2.offline.mode") == null) &&
+ (System.getProperty("maven2.jpp.mode") == null)) )
{
String filename = "maven-metadata-" + remoteRepo.getId() + ".xml";
File localFile = getLocalRepository().getMetadataFile( dep.getGroupId(), dep.getArtifactId(),
@@ -227,7 +230,9 @@
file.getParentFile().mkdirs();
- if ( !file.exists() || version.indexOf( "SNAPSHOT" ) >= 0 )
+ if ( (!file.exists() || version.indexOf( "SNAPSHOT" ) >= 0) &&
+ ((System.getProperty("maven2.offline.mode") == null) &&
+ (System.getProperty("maven2.jpp.mode") == null)) )
{
String filename = dep.getArtifactId() + "-" + version + ".pom";
String metadataPath = remoteRepo.getMetadataPath( dep.getGroupId(), dep.getArtifactId(),
@@ -266,6 +271,7 @@
}
catch ( FileNotFoundException e )
{
+ e.printStackTrace();
log( "Artifact not found at [" + url + "]" );
// Ignore
}
@@ -316,10 +322,8 @@
if ( remoteRepositories.isEmpty() )
{
// TODO: use super POM?
- remoteRepositories.add( new Repository( "central", REPO_URL, Repository.LAYOUT_DEFAULT, false, true ) );
- // TODO: use maven root POM?
- remoteRepositories.add( new Repository( "snapshots", "http://snapshots.maven.codehaus.org/maven2/",
- Repository.LAYOUT_DEFAULT, true, false ) );
+ remoteRepositories.add( new Repository( "internal", INTERNAL_REPO_URL, Repository.LAYOUT_JPP, true, true ) );
+ remoteRepositories.add( new Repository( "external", EXTERNAL_REPO_URL, Repository.LAYOUT_JPP, true, true ) );
}
return remoteRepositories;
--- ./maven2/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java.sav 2005-11-16 22:39:28.000000000 -0500
+++ ./maven2/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java 2006-10-04 13:52:03.000000000 -0400
@@ -59,6 +59,8 @@
private boolean offline;
+ private String settingsFile;
+
public BootstrapInstaller( SimpleArgumentParser parser )
throws Exception
{
@@ -74,6 +76,8 @@
this.updateSnapshots = parser.isArgumentSet( "--update-snapshots" );
this.offline = parser.isArgumentSet( "--offline" );
+
+ this.settingsFile = parser.getArgumentValue( "--settings" );
}
public static void main( String[] args )
@@ -206,6 +210,10 @@
{
cli.createArgument().setValue( "--update-snapshots" );
}
+ if (this.settingsFile != null) {
+ cli.createArgument().setValue( "-s" );
+ cli.createArgument().setValue( this.settingsFile );
+ }
for ( int i = 0; i < args.length; i++ )
{
--- ./maven2/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav 2005-10-13 22:57:13.000000000 -0400
+++ ./maven2/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java 2006-10-16 17:56:34.000000000 -0400
@@ -177,7 +177,7 @@
// third pass...we're always checking for latest install/deploy, so retrieve the version for LATEST metadata and
// also set that resolved version as the <useVersion/> in settings.xml.
- if ( StringUtils.isEmpty( version ) )
+ if ( StringUtils.isEmpty( version ) )
{
// 1. resolve the version to be used
version = resolveMetaVersion( groupId, artifactId, project, localRepository, Artifact.LATEST_VERSION );
@@ -220,10 +220,16 @@
}
// if we still haven't found a version, then fail early before we get into the update goop.
- if ( StringUtils.isEmpty( version ) )
+ if ( StringUtils.isEmpty( version ) && ((System.getProperty("maven2.offline.mode") == null) &&
+ (System.getProperty("maven2.jpp.mode") == null)))
{
throw new PluginVersionNotFoundException( groupId, artifactId );
- }
+ } else if (((System.getProperty("maven2.offline.mode") != null) ||
+ (System.getProperty("maven2.jpp.mode") != null))) {
+ // Doesn't matter what we have here. We need *something* because metadata
+ // is not retrieved in offline mode, so there needs to be some kind of version
+ version = "2.0.4";
+ }
// if the plugin registry is inactive, then the rest of this goop is useless...
if ( settings.isUsePluginRegistry() )
--- ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav 2006-10-06 13:19:49.000000000 -0400
+++ ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java 2006-10-11 18:21:02.000000000 -0400
@@ -20,6 +20,9 @@
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.layout.MavenJPackageDepmap;
+
+import java.util.Hashtable;
/**
* @author jdcasey
@@ -39,10 +42,25 @@
StringBuffer path = new StringBuffer();
+ String baseVersion = artifact.getBaseVersion();
+ String version = artifact.getVersion();
+
+ if (( System.getProperty("maven2.offline.mode") != null &&
+ System.getProperty("maven2.ignore.versions") != null ) ||
+ ( System.getProperty("maven2.jpp.mode") != null) ) {
+ MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
+ Hashtable newInfo = map.getMappedInfo(artifact.getGroupId(), artifact.getArtifactId(), version);
+
+ //System.err.println("Replacing[1] " + baseVersion + " and " + version + " with " + (String) newInfo.get("version") + " in offline+ignore versions mode");
+
+ baseVersion = (String) newInfo.get("version");
+ version = baseVersion;
+ }
+
path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR );
path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR );
- path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR );
- path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );
+ path.append( baseVersion ).append( PATH_SEPARATOR );
+ path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( version );
if ( artifact.hasClassifier() )
{
@@ -73,7 +91,19 @@
if ( metadata.storedInArtifactVersionDirectory() )
{
- path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR );
+ String baseVersion = metadata.getBaseVersion();
+
+ if (( System.getProperty("maven2.offline.mode") != null &&
+ System.getProperty("maven2.ignore.versions") != null ) ||
+ ( System.getProperty("maven2.jpp.mode") != null) ) {
+ MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
+ Hashtable newInfo = map.getMappedInfo(metadata.getGroupId(), metadata.getArtifactId(), baseVersion);
+
+ //System.err.println("Replacing[2] " + baseVersion + " with " + (String) newInfo.get("version") + " in offline+ignore versions mode");
+
+ baseVersion = (String) newInfo.get("version");
+ }
+ path.append( baseVersion ).append( PATH_SEPARATOR );
}
}
--- ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav 2006-10-12 14:19:36.000000000 -0400
+++ ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java 2006-10-12 15:38:17.000000000 -0400
@@ -232,7 +232,8 @@
// set the recommended version
// TODO: maybe its better to just pass the range through to retrieval and use a transformation?
ArtifactVersion version;
- if ( !artifact.isSelectedVersionKnown() )
+ if ( !artifact.isSelectedVersionKnown() &&
+ System.getProperty("maven2.ignore.versions") == null)
{
List versions = artifact.getAvailableVersions();
if ( versions == null )
@@ -267,7 +268,13 @@
version = artifact.getSelectedVersion();
}
- artifact.selectVersion( version.toString() );
+ if ( !artifact.isSelectedVersionKnown() &&
+ System.getProperty("maven2.ignore.versions") != null )
+ {
+ artifact.selectVersion( "2.0.4" );
+ } else {
+ artifact.selectVersion( version.toString() );
+ }
fireEvent( ResolutionListener.SELECT_VERSION_FROM_RANGE, listeners, child );
}
--- ./maven2/maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav 2005-11-29 00:14:20.000000000 -0500
+++ ./maven2/maven-artifact/src/main/resources/META-INF/plexus/components.xml 2006-10-02 12:02:34.000000000 -0400
@@ -12,6 +12,12 @@
<implementation>org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout</implementation>
</component>
+ <component>
+ <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
+ <role-hint>jpp</role-hint>
+ <implementation>org.apache.maven.artifact.repository.layout.JPackageRepositoryLayout</implementation>
+ </component>
+
<!--
|
| ArtifactHandlerManager
--- ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav 2006-02-21 00:18:50.000000000 -0500
+++ ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java 2006-10-11 17:43:24.000000000 -0400
@@ -81,8 +81,10 @@
boolean checkForUpdates = policy.checkOutOfDate( new Date( file.lastModified() ) ) || !file.exists();
boolean metadataIsEmpty = true;
-
- if ( checkForUpdates )
+
+ if ( checkForUpdates &&
+ ((System.getProperty("maven2.offline.mode") == null) &&
+ (System.getProperty("maven2.jpp.mode") == null)))
{
getLogger().info( metadata.getKey() + ": checking for updates from " + repository.getId() );
--- ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav 2006-02-21 01:40:38.000000000 -0500
+++ ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java 2006-10-02 12:02:34.000000000 -0400
@@ -114,7 +114,10 @@
try
{
- if ( artifact.getRepository() != null )
+ // In JPP mode, we do not care about artifact's repository. Make it go
+ // to jpp's repos for resolution
+
+ if ( artifact.getRepository() != null )
{
// the transformations discovered the artifact - so use it exclusively
wagonManager.getArtifact( artifact, artifact.getRepository() );
--- ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav 2006-02-21 00:18:50.000000000 -0500
+++ ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java 2006-10-13 14:05:01.000000000 -0400
@@ -275,9 +275,25 @@
else if ( repository.isBlacklisted() )
{
getLogger().debug( "Skipping blacklisted repository " + repository.getId() );
- }
+ } else if ( ((System.getProperty("maven2.offline.mode") != null) ||
+ (System.getProperty("maven2.jpp.mode") != null)) &&
+ !repository.getUrl().startsWith("file:") ) {
+ getLogger().warn( "Skipping non filebased repository " + repository.getUrl() + " in full offline mode");
+ }
else
{
+
+ // Else policy is enabled, this is not a blacklisted repo, and we
+ // may or may not be in jpp/offline mode. If we are not in
+ // jpp/offline mode, __jpp_repo__ needs to be disabled.
+
+ if (System.getProperty("maven2.usejppjars") == null &&
+ System.getProperty("maven2.jpp.mode") == null &&
+ repository.getId().equals("__jpp_repo__")) {
+ getLogger().warn( "Skipping jpp repository " + repository.getUrl() + " in vanilla mode");
+ return;
+ }
+
getLogger().debug( "Trying repository " + repository.getId() );
getRemoteFile( repository, artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy() );
getLogger().debug( " Artifact resolved" );
--- ./maven2/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav 2005-12-06 19:42:46.000000000 -0500
+++ ./maven2/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java 2006-10-16 18:06:13.000000000 -0400
@@ -40,7 +40,7 @@
public class DefaultModelValidator
implements ModelValidator
{
- private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
+ private static final String ID_REGEX = "[A-Za-z0-9_/\\\\.-]+";
///////////////////////////////////////////////////////////////////////////
// ModelValidator Implementation
@@ -85,7 +85,18 @@
validateStringNotEmpty( "dependencies.dependency.type", result, d.getType(), dependencySourceHint( d ) );
- validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), dependencySourceHint( d ) );
+ // Check disabled in "ignore versions" mode. On many occassions, JPackage
+ // builds modules that are not built by default in a project. A lot of
+ // these seem to have missing versions for dependencies, so we omit
+ // validation check for version in the "ignore versions" mode.
+
+ if (System.getProperty("maven2.ignore.versions") == null) {
+ validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), dependencySourceHint( d ) );
+ } else {
+ if ( d.getVersion() == null ) {
+ d.setVersion("2.0.4");
+ }
+ }
if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) )
{
@@ -209,7 +220,7 @@
boolean match = id.matches( ID_REGEX );
if ( !match )
{
- result.addMessage( "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern." );
+ result.addMessage( "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern: " + ID_REGEX);
}
return match;
}
--- ./maven2/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav 2006-10-12 10:20:20.000000000 -0400
+++ ./maven2/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml 2006-10-13 11:47:52.000000000 -0400
@@ -5,6 +5,15 @@
<repositories>
<repository>
+ <id>__jpp_repo__</id>
+ <name>JPackage Maven Repository</name>
+ <layout>jpp</layout>
+ <url>file:///usr/share/maven2/repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
@@ -20,6 +29,18 @@
<pluginRepositories>
<pluginRepository>
+ <id>__jpp_repo__</id>
+ <name>JPackage Maven Plugin Repository</name>
+ <url>file:///usr/share/maven2/repository</url>
+ <layout>jpp</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ </pluginRepository>
+ <pluginRepository>
<id>central</id>
<name>Maven Plugin Repository</name>
<!--
--- ./maven2/bootstrap.sh.sav 2006-10-13 22:06:45.000000000 -0400
+++ ./maven2/bootstrap.sh 2006-10-13 22:19:28.000000000 -0400
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
ARGS=$@
ORIG_ARGS=$ARGS
@@ -8,7 +8,7 @@
exit 1
fi
-JAVACMD="$JAVA_HOME/bin/java"
+JAVACMD="$JAVA_HOME/bin/java -classpath $CLASSPATH"
(
cd bootstrap/bootstrap-mini
maven2-noexternaljavadoclinks.patch:
--- NEW FILE maven2-noexternaljavadoclinks.patch ---
--- ./maven2/pom.xml.sav 2007-03-16 01:00:57.000000000 -0400
+++ ./maven2/pom.xml 2007-03-16 01:00:50.000000000 -0400
@@ -257,22 +260,6 @@
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <links>
- <link>http://java.sun.com/j2ee/1.4/docs/api</link>
- <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
- <link>http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/</link>
- <link>http://jakarta.apache.org/commons/dbcp/apidocs/</link>
- <link>http://jakarta.apache.org/commons/fileupload/apidocs/</link>
- <link>http://jakarta.apache.org/commons/httpclient/apidocs/</link>
- <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
- <link>http://jakarta.apache.org/commons/pool/apidocs/</link>
- <link>http://www.junit.org/junit/javadoc/</link>
- <link>http://logging.apache.org/log4j/docs/api/</link>
- <link>http://jakarta.apache.org/regexp/apidocs/</link>
- <link>http://jakarta.apache.org/velocity/api/</link>
- </links>
- </configuration>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
maven2-plugins-disablecglib.patch:
--- NEW FILE maven2-plugins-disablecglib.patch ---
--- ./maven2-plugins/maven-release-plugin/pom.xml.sav 2007-02-14 22:38:00.000000000 -0500
+++ ./maven2-plugins/maven-release-plugin/pom.xml 2007-02-14 22:38:16.000000000 -0500
@@ -93,12 +93,6 @@
<version>1.0-beta-3-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock-cglib</artifactId>
- <version>1.0.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-test</artifactId>
<version>1.0-beta-3-SNAPSHOT</version>
maven2-plugins-plexus151.patch:
--- NEW FILE maven2-plugins-plexus151.patch ---
--- ./maven2-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java.sav 2006-03-15 17:05:49.055552565 -0500
+++ ./maven2-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java 2006-03-15 17:07:12.765804751 -0500
@@ -334,6 +334,10 @@
compilerConfiguration.setFork( fork );
+ /*
+
+ Disabled so that this builds with plexus-compiler 1.5.1
+
if( fork )
{
if ( !StringUtils.isEmpty( meminitial ) )
@@ -364,6 +368,7 @@
}
}
}
+ */
compilerConfiguration.setExecutable( executable );
--- NEW FILE maven2-run-it-tests.sh ---
#!/bin/sh
ARGS=$@
ORIG_ARGS=$ARGS
if [ -z "$JAVA_HOME" ]; then
echo You must specify the JAVA_HOME environment variable
exit 1
fi
JAVACMD="$JAVA_HOME/bin/java"
BOOTSTRAP_JAR=bootstrap-mini/bootstrap-mini.jar
# TODO: get rid of M2_HOME once integration tests are in here
PREFIX=`dirname $M2_HOME`
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
esac
if [ "$cygwin" = "true" ]; then
PREFIX=`cygpath -w $PREFIX`
JAVA_HOME=`cygpath -w $JAVA_HOME`
fi
ARGS=$ORIG_ARGS
(
# TODO: should we be going back to the mini now that we have the real thing?
cd maven-core-it-verifier
$JAVACMD $MAVEN_OPTS -jar ../bootstrap/$BOOTSTRAP_JAR package $ARGS
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
)
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
(
cd ./maven-core-it
echo
echo "Running maven-core integration tests ..."
echo
./maven-core-it.sh $ARGS
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
)
ret=$?; if [ $ret != 0 ]; then exit $ret; fi
--- NEW FILE maven2-script ---
#!/bin/sh
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
set_jvm
set_javacmd
fi
export M2_HOME=/usr/share/maven2
echo $JAVA_HOME
export JAVA_HOME; $M2_HOME/bin/mvn $@
--- NEW FILE maven2-settings.xml ---
<settings>
<profiles>
<profile>
<id>JPP</id>
<repositories>
<repository>
<id>internal</id>
<layout>jpp</layout>
<url>__INTERNAL_REPO_PLACEHOLDER__</url>
</repository>
<repository>
<id>external</id>
<layout>jpp</layout>
<url>__EXTERNAL_REPO_PLACEHOLDER__</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>plugins-internal</id>
<name>plugins-internal</name>
<layout>jpp</layout>
<url>__INTERNAL_REPO_PLACEHOLDER__</url>
</pluginRepository>
<pluginRepository>
<id>plugins-external</id>
<name>plugins-external</name>
<layout>jpp</layout>
<url>__EXTERNAL_REPO_PLACEHOLDER__</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>JPP</activeProfile>
</activeProfiles>
</settings>
--- NEW FILE maven2.spec ---
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%define _with_gcj_support 1
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
%define _with_bootstrap 1
%define with_itests %{!?_with_itests:0}%{?_with_itests:1}
%define without_itests %{?_with_itests:0}%{!?_with_itests:1}
%define with_bootstrap %{!?_with_bootstrap:0}%{?_with_bootstrap:1}
%define without_bootstrap %{?_with_bootstrap:0}%{!?_with_bootstrap:1}
%define maven_version 2.0.4
%define NONFREE 0
%define base_name maven
%define name maven2
%define repo_dir m2_home_local/repository
%define maven_settings_file %{_builddir}/%{name}/settings.xml
Name: %{name}
Version: %{maven_version}
Release: 10jpp.3%{?dist}
Epoch: 0
Summary: Java project management and project comprehension tool
Group: Development/Build Tools
License: Apache Software License
URL: http://maven.apache.org/
# svn export http://svn.apache.org/repos/asf/maven/components/tags/maven-2.0.4 maven2
# tar czf maven2-src.tar.gz maven2
Source0: %{name}-src.tar.gz
# svn export -r {2006-04-20} http://svn.apache.org/repos/asf/maven/plugins/trunk maven2-plugins
# tar czf maven2-plugins-060420-src.tar.gz maven2-plugins
Source2: %{name}-plugins-060420-src.tar.gz
# No source location for these. They are ascii files generated from maven
# repositories, and are not in cvs/svn
# The files were originally aquired from: http://repo1.maven.org/maven2/
Source3: m2_pom_repo.tar.gz
# As with above, these files are from the maven repositories, and are not in
# cvs/svn
# The files were originally aquired from: http://repo1.maven.org/maven2/
Source4: m2_jar_repo.tar.gz
Source5: %{name}-script
Source6: maven2-JPackageRepositoryLayout.java
Source7: maven2-settings.xml
# svn export -r '{2006-03-08}' http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-site-plugin maven-site-plugin
# tar czf maven2-maven-site-plugin.tar.gz maven-site-plugin
Source8: %{name}-maven-site-plugin.tar.gz
Source9: %{name}-run-it-tests.sh
# svn export http://svn.apache.org/repos/asf/maven/components/tags/maven-2.0.4/maven-model
# cd maven-model
# mvn -P all-models package
# Find model jar in target/maven-model-2.0.4.jar
Source10: %{name}-model-v3.jar
Source11: %{name}-MavenJPackageDepmap.java
Source12: %{name}-addjdom-depmap.xml
Source13: %{name}-empty-dep.pom
# Empty jar file with just a manifest. No source destination to specify
Source14: %{name}-empty-dep.jar
Source15: %{name}-jpp-script
Source16: %{name}-jpp-readme.html
Patch0: maven2-disable-itests.patch
Patch1: maven2-addjdomtobootstrappath.patch
Patch2: maven2-plugins-plexus151.patch
Patch3: %{name}-jpprepolayout.patch
Patch4: %{name}-plugins-disablecglib.patch
Patch5: %{name}-buildallplugins.patch
Patch6: %{name}-enable-unbuilt-modules.patch
Patch7: %{name}-fastjar-manifest-fix.patch
Patch8: %{name}-noexternaljavadoclinks.patch
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: /bin/ls,/usr/bin/head,/usr/bin/find,/usr/bin/awk,/bin/grep,/bin/sed
BuildRequires: ant >= 1.6.5
BuildRequires: antlr >= 2.7.4
BuildRequires: bsh >= 1.3.0
#BuildRequires: cglib >= 2.1.0
BuildRequires: checkstyle >= 4.1
BuildRequires: classworlds >= 1.1
%if %{NONFREE}
BuildRequires: clover
%endif
BuildRequires: dom4j >= 1.6.1
BuildRequires: tomcat5-servlet-2.4-api
BuildRequires: gnu.regexp >= 1.1.4
BuildRequires: httpunit >= 1.6
BuildRequires: jakarta-commons-beanutils >= 1.7.0
BuildRequires: jakarta-commons-cli >= 1.0
BuildRequires: jakarta-commons-collections >= 3.1
BuildRequires: jakarta-commons-io >= 1.1
BuildRequires: jakarta-commons-lang >= 2.1
BuildRequires: jakarta-commons-logging >= 1.0.4
BuildRequires: jakarta-commons-validator >= 1.1.4
BuildRequires: jaxen >= 1.1
BuildRequires: jdom >= 1.0
#BuildRequires: jmock >= 1.0.1
BuildRequires: jline >= 0.8.1
BuildRequires: jsch >= 0.1.20
BuildRequires: jtidy >= 1.0
BuildRequires: junit >= 3.8.2
BuildRequires: maven2-common-poms >= 1.0-4
BuildRequires: maven-doxia >= 1.0-0.a7.3
BuildRequires: maven-jxr >= 1.0-2
BuildRequires: maven-surefire >= 1.5.3-2
BuildRequires: maven-surefire-booter >= 1.5.3-2
BuildRequires: maven-wagon >= 1.0
BuildRequires: nekohtml >= 0.9.3
BuildRequires: oro >= 2.0.8
BuildRequires: plexus-ant-factory >= 1.0-0.a1.2
BuildRequires: plexus-bsh-factory >= 1.0-0.a7s.2
BuildRequires: plexus-archiver >= 1.0-0.a6
BuildRequires: plexus-compiler >= 1.5.1
BuildRequires: plexus-container-default >= 1.0
BuildRequires: plexus-i18n >= 1.0
BuildRequires: plexus-interactivity >= 1.0
BuildRequires: plexus-utils >= 1.2
BuildRequires: plexus-velocity >= 1.1.2
BuildRequires: pmd >= 3.6
BuildRequires: qdox >= 1.5
BuildRequires: rhino >= 1.5
BuildRequires: saxon-scripts
BuildRequires: velocity >= 1.4
BuildRequires: xerces-j2 >= 2.7.1
BuildRequires: xalan-j2 >= 2.6.0
%if %{with_itests}
BuildRequires: log4j >= 1.2.13
BuildRequires: xml-commons-apis >= 1.3.02
%endif
%if %{without_bootstrap}
BuildRequires: %{name} = %{epoch}:%{version}
BuildRequires: maven2-plugin-assembly
BuildRequires: maven2-plugin-clean
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-plugin
BuildRequires: maven2-plugin-release
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-site
BuildRequires: maven2-plugin-surefire
BuildRequires: maven-scm >= 0:1.0-0.b3.2
BuildRequires: maven-scm-test >= 0:1.0-0.b3.2
BuildRequires: maven-shared-file-management >= 1.0-4
BuildRequires: maven-shared-plugin-testing-harness >= 1.0-4
BuildRequires: modello >= 1.0-0.a8.3
BuildRequires: modello-maven-plugin >= 1.0-0.a8.3
%endif
Requires: ant >= 1.6.5
Requires: antlr >= 2.7.4
Requires: bsh >= 1.3.0
#Requires: cglib >= 2.1.0
Requires: checkstyle >= 4.1
[...1952 lines suppressed...]
%files plugin-plugin
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/plugin-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/plugin-plugin.jar.*
%endif
%files plugin-pmd
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/pmd-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/pmd-plugin.jar.*
%endif
%files plugin-project-info-reports
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/project-info-reports-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/project-info-reports-plugin.jar.*
%endif
%files plugin-rar
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/rar-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/rar-plugin.jar.*
%endif
%files plugin-release
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/release-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/release-plugin.jar.*
%endif
%files plugin-repository
%defattr(-,root,root,-)
%doc maven2-plugins/maven-repository-plugin/LICENSE.txt
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/repository-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/repository-plugin.jar.*
%endif
%files plugin-resources
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/resources-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/resources-plugin.jar.*
%endif
%files plugin-site
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/site-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/site-plugin.jar.*
%endif
%files plugin-source
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/source-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/source-plugin.jar.*
%endif
%files plugin-surefire
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/surefire-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/surefire-plugin.jar.*
%endif
%files plugin-surefire-report
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/surefire-report-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/surefire-report-plugin.jar.*
%endif
%files plugin-verifier
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/verifier-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/verifier-plugin.jar.*
%endif
%files plugin-war
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}/plugins
%{_datadir}/%{name}/plugins/war-plugin.jar
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/war-plugin.jar.*
%endif
%changelog
* Fri Mar 16 2007 Deepak Bhole <dbhole at redhat.com> 0:2.0.4-10jpp.3
- Added gcj support
- Fix up per Fedora spec
- Added source locations/generation methods for binary %%SOURCEes
- Added workaround for gcj bug that causes plugin reload to fail
* Wed Dec 13 2006 Deepak Bhole <dbhole at redhat.com> 2.0.4-10jpp.2
- Build without bootstrap
* Mon Dec 04 2006 Deepak Bhole <dbhole at redhat.com> 2.0.4-10jpp.1
- Synch with jpp
- From dbhole at redhat:
- Added a new mapping system
- Added a jpp howto
- Added support for plugin mixing
- Wired in /usr/share/maven2/repository as one of the default repos
- Moved poms over to maven2-common-poms
- Reverted to original plugin groupid's
- Installer maven-{artifact-ant,embedder,meeper,script}
- From r.apel at r-apel.de:
- Fix maven-site-plugin pom in maven2-jpp-mapping.patch
- Add maven-shared-file-management to plugin-assembly Requires
- Add post/postun Requires for javadoc
* Wed Jul 12 2006 Fernando Nasser <fnasser at redhat.com> - 0:2.0.4-4jpp_1rh
- Merge with upstream
* Mon Jul 10 2006 Deepak Bhole <dbhole at redhat.com> - 0:2.0.4-4jpp
- Additional fixes (mostly to the dependency transformer xsl) for itests.
- Added a --with regereratedpoms switch.
* Wed Jul 05 2006 Deepak Bhole <dbhole at redhat.com> - 0:2.0.4-3jpp
- Added partial support for it tests, and appropriate fixes.
* Thu Jun 29 2006 Fernando Nasser <fnasser at redhat.com> - 0:2.0.4-2jpp_2rh
- Rebuild
* Tue Jun 27 2006 Fernando Nasser <fnasser at redhat.com> - 0:2.0.4-2jpp_1rh
- Full build
* Mon Jun 26 2006 Fernando Nasser <fnasser at redhat.com> - 0:2.0.4-2jpp_0rh
- Merge with upstream
- Bootstrap building
* Thu Jun 22 2006 Deepak Bhole <dbhole at redhat.com> - 0:2.0.4-2jpp
- Fixes for Tuscany building
* Fri Jun 02 2006 Deepak Bhole <dbhole at redhat.com> - 0:2.0.4-1jpp
- Upgrade to 2.0.4
* Wed May 31 2006 Fernando Nasser <fnasser at redhat.com> - 0:2.0.2-1jpp_1rh
- First Red Hat build
* Wed Feb 22 2006 Deepak Bhole <dbhole at redhat.com> - 0:2.0.2-1jpp
- Initial build.
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/maven2/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 19 Mar 2007 23:31:57 -0000 1.1
+++ .cvsignore 20 Mar 2007 00:52:40 -0000 1.2
@@ -0,0 +1,7 @@
+m2_jar_repo.tar.gz
+m2_pom_repo.tar.gz
+maven2-empty-dep.jar
+maven2-maven-site-plugin.tar.gz
+maven2-model-v3.jar
+maven2-plugins-060420-src.tar.gz
+maven2-src.tar.gz
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/maven2/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 19 Mar 2007 23:31:57 -0000 1.1
+++ sources 20 Mar 2007 00:52:40 -0000 1.2
@@ -0,0 +1,7 @@
+e6ad023874fce8fec9f8f975b96685c1 m2_jar_repo.tar.gz
+357c94ddd53c899169ff6da4d1b95b40 m2_pom_repo.tar.gz
+dc36ce1fbefedbdd27fa93c8584ba91a maven2-empty-dep.jar
+de45a278b88554bb545f092e2f82c56d maven2-maven-site-plugin.tar.gz
+1b28906cd308ed60db75e2973f0fbb22 maven2-model-v3.jar
+d556f5883f89a7348de42767fcb1aabe maven2-plugins-060420-src.tar.gz
+36465a60f5d7542c79df98ec6369205f maven2-src.tar.gz
More information about the fedora-extras-commits
mailing list