Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:vlj:fedora14:maven2
maven2
maven2-2.2.1-jpp.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File maven2-2.2.1-jpp.patch of Package maven2
diff -up ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java --- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav 2009-08-06 15:11:34.000000000 -0400 +++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java 2009-11-19 14:17:42.000000000 -0500 @@ -58,6 +58,8 @@ import org.codehaus.plexus.util.FileUtil import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.Xpp3Dom; +import org.apache.maven.artifact.repository.layout.MavenJPackageDepmap; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -66,6 +68,7 @@ import java.net.URL; import java.security.NoSuchAlgorithmException; import java.util.Collection; import java.util.HashMap; +import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -409,7 +412,20 @@ public class DefaultWagonManager ArtifactRepository repository ) throws TransferFailedException, ResourceDoesNotExistException { + + String originalVersion = artifact.getVersion(); + + if ( ( repository.getLayout() instanceof org.apache.maven.artifact.repository.layout.JPackageRepositoryLayout ) && + ( System.getProperty("maven2.jpp.mode") != null ) ) + { + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); + Hashtable newInfo = map.getMappedInfo(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); + + artifact.setVersion((String) newInfo.get("version")); + } + String remotePath = repository.pathOf( artifact ); + artifact.setVersion(originalVersion); // set it back ArtifactRepositoryPolicy policy = artifact.isSnapshot() ? repository.getSnapshots() : repository.getReleases(); @@ -421,8 +437,23 @@ public class DefaultWagonManager { getLogger().debug( "Skipping blacklisted repository " + repository.getId() ); } + else if ((System.getProperty("maven2.jpp.mode") != null) && + (!repository.getUrl().startsWith("file:"))) + { + // In JPP mode, repos other than those starting with file:// are + // not allowed + getLogger().warn( "Skipping non filebased repository " + repository.getUrl() + " in full offline mode"); + } else { + // In vanilla mode, the JPP repos should be ignored + if ((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( getMirrorRepository( repository ), artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy(), false ); diff -up ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java --- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav 2009-08-06 15:11:34.000000000 -0400 +++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java 2009-11-18 16:54:39.000000000 -0500 @@ -85,7 +85,7 @@ public class DefaultRepositoryMetadataMa boolean checkForUpdates = !file.exists() || policy.checkOutOfDate( new Date( file.lastModified() ) ); - if ( checkForUpdates ) + if ( checkForUpdates && (System.getProperty("maven2.jpp.mode") == null)) { if ( wagonManager.isOnline() ) { diff -up ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java --- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav 2009-08-06 15:11:34.000000000 -0400 +++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java 2009-11-18 16:54:39.000000000 -0500 @@ -206,7 +206,8 @@ public class DefaultArtifactResolver try { // TODO: force should be passed to the wagon manager - if ( artifact.getRepository() != null ) + if ( (artifact.getRepository() != null) && + (System.getProperty("maven2.jpp.mode") == null)) { // the transformations discovered the artifact - so use it exclusively wagonManager.getArtifact( artifact, artifact.getRepository() ); diff -up ./maven-artifact/pom.xml.sav ./maven-artifact/pom.xml --- ./maven-artifact/pom.xml.sav 2009-08-06 15:11:32.000000000 -0400 +++ ./maven-artifact/pom.xml 2009-11-19 14:54:43.000000000 -0500 @@ -39,5 +39,10 @@ under the License. <artifactId>plexus-container-default</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + </dependency> </dependencies> </project> diff -up ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java --- ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav 2009-08-06 15:11:31.000000000 -0400 +++ ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java 2009-11-19 14:15:45.000000000 -0500 @@ -23,6 +23,9 @@ import org.apache.maven.artifact.Artifac 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 @@ -42,6 +45,8 @@ public class DefaultRepositoryLayout StringBuffer path = new StringBuffer(); + String baseVersion = artifact.getBaseVersion(); + path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); @@ -76,7 +81,17 @@ public class DefaultRepositoryLayout if ( metadata.storedInArtifactVersionDirectory() ) { - path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR ); + String baseVersion = metadata.getBaseVersion(); + + if (System.getProperty("maven2.jpp.mode") != null) + { + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); + Hashtable newInfo = map.getMappedInfo(metadata.getGroupId(), metadata.getArtifactId(), baseVersion); + + baseVersion = (String) newInfo.get("version"); + } + + path.append( baseVersion ).append( PATH_SEPARATOR ); } } diff -up ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java --- ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav 2009-08-06 15:11:32.000000000 -0400 +++ ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java 2009-11-18 16:54:39.000000000 -0500 @@ -341,7 +341,7 @@ public class DefaultArtifactCollector // 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.jpp.mode") == null) { version = artifact.getSelectedVersion(); } @@ -380,7 +380,12 @@ public class DefaultArtifactCollector //this is dangerous because artifact.getSelectedVersion() can //return null. However it is ok here because we first check if the //selected version is known. As currently coded we can't get a null here. - artifact.selectVersion( version.toString() ); + + if ( !artifact.isSelectedVersionKnown() && System.getProperty("maven2.jpp.mode") != null) + artifact.selectVersion( "DUMMY_VER" ); + else + artifact.selectVersion( version.toString() ); + fireEvent( ResolutionListener.SELECT_VERSION_FROM_RANGE, listeners, child ); } diff -up ./maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav ./maven-artifact/src/main/resources/META-INF/plexus/components.xml --- ./maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav 2009-08-06 15:11:32.000000000 -0400 +++ ./maven-artifact/src/main/resources/META-INF/plexus/components.xml 2009-11-18 16:54:39.000000000 -0500 @@ -31,6 +31,12 @@ under the License. <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 diff -up ./maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java.sav ./maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java diff -up ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java.sav ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java --- ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java.sav 2009-11-19 11:36:53.000000000 -0500 +++ ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java 2009-11-19 11:47:25.000000000 -0500 @@ -60,6 +60,7 @@ public class MavenPluginCollector { pluginsInProcess.add( key ); + System.err.println("*DEBUG*: Putting in plugin descriptor list " + key + " and goal prefix is " + pluginDescriptor.getGoalPrefix()); pluginDescriptors.put( key, pluginDescriptor ); // TODO: throw an (not runtime) exception if there is a prefix overlap - means doing so elsewhere @@ -75,6 +76,17 @@ public class MavenPluginCollector public PluginDescriptor getPluginDescriptor( Plugin plugin ) { String key = PluginUtils.constructVersionedKey( plugin ); + System.err.println("*DEBUG*: Constructed plugin version key is " + key); + + PluginDescriptor descriptor = (PluginDescriptor) pluginDescriptors.get( key ); + + // In JPP mode, we give it a second chance + if ( ( descriptor == null ) && + ( System.getProperty("maven2.jpp.mode") != null ) ) + { + //for descriptors + } + return (PluginDescriptor) pluginDescriptors.get( key ); } diff -up ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java.sav ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java --- ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java.sav 2009-11-19 11:08:06.000000000 -0500 +++ ./maven-core/src/main/java/org/apache/maven/plugin/MavenPluginValidator.java 2009-11-19 11:08:29.000000000 -0500 @@ -57,8 +57,10 @@ public class MavenPluginValidator { errors.add( "Plugin's descriptor contains the wrong artifact ID: " + pluginDescriptor.getArtifactId() ); } - - if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) ) + + if ( !pluginArtifact.getBaseVersion().equals( pluginDescriptor.getVersion() ) && + ( System.getProperty("maven2.jpp.mode") == null ) + ) { errors.add( "Plugin's descriptor contains the wrong version: " + pluginDescriptor.getVersion() ); } diff -up ./maven-core/src/main/java/org/apache/maven/plugin/PluginUtils.java.sav ./maven-core/src/main/java/org/apache/maven/plugin/PluginUtils.java --- ./maven-core/src/main/java/org/apache/maven/plugin/PluginUtils.java.sav 2009-11-19 11:51:04.000000000 -0500 +++ ./maven-core/src/main/java/org/apache/maven/plugin/PluginUtils.java 2009-11-19 12:00:15.000000000 -0500 @@ -72,7 +72,13 @@ class PluginUtils String baseVersion = ArtifactUtils.toSnapshotVersion( version ); StringBuffer key = new StringBuffer( 128 ); - key.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( baseVersion ); + + // In JPP mode, we don't want to use versions in keys + + if (System.getProperty("maven2.jpp.mode") == null) + key.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( baseVersion ); + else + key.append( groupId ).append( ':' ).append( artifactId ); return key.toString(); } diff -up ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java --- ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav 2009-08-06 15:11:28.000000000 -0400 +++ ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java 2009-11-18 16:54:39.000000000 -0500 @@ -224,9 +224,15 @@ public class DefaultPluginVersionManager } // 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.jpp.mode") == null)) { throw new PluginVersionNotFoundException( groupId, artifactId ); + } else if (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 = "DUMMY_VER"; } // if the plugin registry is inactive, then the rest of this goop is useless... diff -up ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java --- ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav 2009-08-06 15:11:37.000000000 -0400 +++ ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java 2009-11-18 16:54:39.000000000 -0500 @@ -43,7 +43,7 @@ import java.util.List; 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 @@ -88,7 +88,13 @@ public class DefaultModelValidator validateStringNotEmpty( "dependencies.dependency.type", result, d.getType(), d.getManagementKey() ); - validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), d.getManagementKey() ); + // In JPP mode, don't bother validating. But do put a dummy + // version if one is not provided + if ((System.getProperty("maven2.jpp.mode") != null) && + (d.getVersion() == null)) + d.setVersion("DUMMY_VER"); + else + validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), d.getManagementKey() ); if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) ) { diff -up ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml --- ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav 2009-08-06 15:11:38.000000000 -0400 +++ ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml 2009-11-19 13:12:23.000000000 -0500 @@ -32,6 +32,15 @@ under the License. <enabled>false</enabled> </snapshots> </repository> + <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> </repositories> <pluginRepositories> @@ -47,6 +56,19 @@ under the License. <updatePolicy>never</updatePolicy> </releases> </pluginRepository> + <pluginRepository> + <id>__jpp_repo__</id> + <name>JPackage Maven Repository</name> + <layout>jpp</layout> + <url>file:///usr/share/maven2/repository</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + </pluginRepository> + </pluginRepositories> <build> diff -up ./pom.xml.sav ./pom.xml --- ./pom.xml.sav 2009-08-06 15:11:38.000000000 -0400 +++ ./pom.xml 2009-11-19 14:54:29.000000000 -0500 @@ -481,6 +481,11 @@ under the License. <artifactId>classworlds</artifactId> <version>1.1</version> </dependency> + <dependency> + <groupId>jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.0</version> + </dependency> </dependencies> <!--start--> </dependencyManagement>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor