Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154228 Details for
Bug 239123
bootstrap process is AAARGGGGH
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
jpprepolayout patch with extra verbosity
maven2-jpprepolayout-with-debug-msgs.patch (text/plain), 21.86 KB, created by
Deepak Bhole
on 2007-05-06 17:29:00 UTC
(
hide
)
Description:
jpprepolayout patch with extra verbosity
Filename:
MIME Type:
Creator:
Deepak Bhole
Created:
2007-05-06 17:29:00 UTC
Size:
21.86 KB
patch
obsolete
>--- ./bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java.sav 2005-11-16 22:39:28.000000000 -0500 >+++ ./bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java 2007-05-06 13:24:32.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; > } > >--- ./bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java.sav 2005-11-11 10:05:53.000000000 -0500 >+++ ./bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java 2007-05-06 13:24:32.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; >--- ./bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java.sav 2005-11-16 22:39:28.000000000 -0500 >+++ ./bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java 2007-05-06 13:25:05.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 ) >@@ -196,6 +200,7 @@ > cli.setWorkingDirectory( basedir.getAbsolutePath() ); > > cli.createArgument().setValue( "-e" ); >+ cli.createArgument().setValue( "-X" ); > cli.createArgument().setValue( "--batch-mode" ); > > if ( offline ) >@@ -206,6 +211,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++ ) > { >--- ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav 2005-10-13 22:57:13.000000000 -0400 >+++ ./maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java 2007-05-06 13:24:32.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() ) >--- ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav 2005-09-04 11:56:52.000000000 -0400 >+++ ./maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java 2007-05-06 13:24:33.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 ); > } > } > >--- ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav 2006-02-21 20:55:47.000000000 -0500 >+++ ./maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java 2007-05-06 13:24:33.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 ); > } > >--- ./maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav 2005-11-29 00:14:20.000000000 -0500 >+++ ./maven-artifact/src/main/resources/META-INF/plexus/components.xml 2007-05-06 13:24:33.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 >--- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav 2006-02-21 00:18:50.000000000 -0500 >+++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java 2007-05-06 13:24:33.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() ); > >--- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav 2006-02-21 01:40:38.000000000 -0500 >+++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java 2007-05-06 13:24:33.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() ); >--- ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav 2006-02-21 00:18:50.000000000 -0500 >+++ ./maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java 2007-05-06 13:24:33.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" ); >--- ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav 2005-12-06 19:42:46.000000000 -0500 >+++ ./maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java 2007-05-06 13:24:33.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; > } >--- ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav 2006-02-20 18:51:53.000000000 -0500 >+++ ./maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml 2007-05-06 13:24:33.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> > <!-- >--- ./bootstrap.sh.sav 2006-02-21 15:38:36.000000000 -0500 >+++ ./bootstrap.sh 2007-05-06 13:24:33.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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239123
: 154228