]>
Commit | Line | Data |
---|---|---|
bd00ca76 | 1 | diff -up ./maven2/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java.sav ./maven2/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java |
ad51ea80 | 2 | --- ./maven/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java.sav 2007-09-08 19:20:50.000000000 -0400 |
3 | +++ ./maven/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java 2009-05-05 15:28:38.000000000 -0400 | |
bd00ca76 | 4 | @@ -57,6 +57,8 @@ public class BootstrapInstaller |
5 | ||
6 | private boolean offline; | |
7 | ||
8 | + private String settingsFile; | |
9 | + | |
10 | public BootstrapInstaller( SimpleArgumentParser parser ) | |
11 | throws Exception | |
12 | { | |
13 | @@ -72,6 +74,8 @@ public class BootstrapInstaller | |
14 | this.updateSnapshots = parser.isArgumentSet( "--update-snapshots" ); | |
15 | ||
16 | this.offline = parser.isArgumentSet( "--offline" ); | |
17 | + | |
18 | + this.settingsFile = parser.getArgumentValue( "--settings" ); | |
19 | } | |
20 | ||
21 | public static void main( String[] args ) | |
22 | @@ -215,6 +219,11 @@ public class BootstrapInstaller | |
23 | cli.createArgument().setValue( "--update-snapshots" ); | |
24 | } | |
25 | ||
26 | + if (this.settingsFile != null) { | |
27 | + cli.createArgument().setValue( "-s" ); | |
28 | + cli.createArgument().setValue( this.settingsFile ); | |
29 | + } | |
30 | + | |
31 | for ( int i = 0; i < args.length; i++ ) | |
32 | { | |
33 | cli.createArgument().setValue( args[i] ); | |
34 | diff -up ./maven2/bootstrap/bootstrap-mini/build.sav ./maven2/bootstrap/bootstrap-mini/build | |
ad51ea80 | 35 | --- ./maven/bootstrap/bootstrap-mini/build.sav 2006-12-11 23:53:43.000000000 -0500 |
36 | +++ ./maven/bootstrap/bootstrap-mini/build 2009-05-05 15:28:38.000000000 -0400 | |
bd00ca76 | 37 | @@ -9,6 +9,11 @@ rm -rf bootstrap-mini.jar ${buildDir} > |
38 | mkdir -p ${classesDir} | |
39 | ||
40 | "$JAVA_HOME/bin/javac" -g -d ${classesDir} `find ${srcDir} -name '*.java'` | |
41 | +# FIXME: Is there a better way to make the compiler see the jdom classes? | |
42 | +# setting CLASSPATH, or giving -cp/-classpath didn't work :( | |
43 | +(cd ${classesDir} | |
44 | + jar xf $JDOMCLASS | |
45 | +) | |
46 | ret=$?; if [ $ret != 0 ]; then exit $ret; fi | |
47 | ||
48 | ( cd ${classesDir} ; "$JAVA_HOME/bin/jar" -cfm ../../bootstrap-mini.jar ../../src/main/resources/META-INF/MANIFEST.MF * ) | |
49 | diff -up ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java.sav ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java | |
ad51ea80 | 50 | --- ./maven/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java.sav 2007-06-15 02:19:15.000000000 -0400 |
51 | +++ ./maven/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/download/OnlineArtifactDownloader.java 2009-05-05 15:28:38.000000000 -0400 | |
bd00ca76 | 52 | @@ -49,7 +49,8 @@ public class OnlineArtifactDownloader |
53 | ||
54 | private String proxyPassword; | |
55 | ||
56 | - private static final String REPO_URL = "http://repo1.maven.org/maven2"; | |
57 | + private static final String INTERNAL_REPO_URL = "__INTERNAL_REPO_PLACEHOLDER__"; | |
58 | + private static final String EXTERNAL_REPO_URL = "__EXTERNAL_REPO_PLACEHOLDER__"; | |
59 | ||
60 | private Map downloadedArtifacts = new HashMap(); | |
61 | ||
62 | @@ -170,7 +171,10 @@ public class OnlineArtifactDownloader | |
63 | try | |
64 | { | |
65 | String version = dep.getVersion(); | |
66 | - if ( snapshot ) | |
67 | + if ( snapshot && | |
68 | + ((System.getProperty("maven2.offline.mode") == null) && | |
69 | + (System.getProperty("maven2.jpp.mode") == null)) ) | |
70 | + | |
71 | { | |
72 | String filename = "maven-metadata-" + remoteRepo.getId() + ".xml"; | |
73 | File localFile = getLocalRepository().getMetadataFile( dep.getGroupId(), dep.getArtifactId(), | |
74 | @@ -252,7 +256,10 @@ public class OnlineArtifactDownloader | |
75 | ||
76 | file.getParentFile().mkdirs(); | |
77 | ||
78 | - if ( !file.exists() || version.indexOf( "SNAPSHOT" ) >= 0 ) | |
79 | + if ( (!file.exists() || version.indexOf( "SNAPSHOT" ) >= 0) && | |
80 | + ((System.getProperty("maven2.offline.mode") == null) && | |
81 | + (System.getProperty("maven2.jpp.mode") == null)) ) | |
82 | + | |
83 | { | |
84 | String filename = dep.getArtifactId() + "-" + version + ".pom"; | |
85 | String metadataPath = remoteRepo.getMetadataPath( dep.getGroupId(), dep.getArtifactId(), | |
86 | @@ -340,11 +347,8 @@ public class OnlineArtifactDownloader | |
87 | ||
88 | if ( remoteRepositories.isEmpty() ) | |
89 | { | |
90 | - // TODO: use super POM? | |
91 | - remoteRepositories.add( new Repository( "central", REPO_URL, Repository.LAYOUT_DEFAULT, false, true ) ); | |
92 | - // TODO: use maven root POM? | |
93 | - remoteRepositories.add( new Repository( "apache.snapshots", "http://people.apache.org/repo/m2-snapshot-repository/", | |
94 | - Repository.LAYOUT_DEFAULT, true, false ) ); | |
95 | + remoteRepositories.add( new Repository( "internal", INTERNAL_REPO_URL, Repository.LAYOUT_JPP, true, true ) ); | |
96 | + remoteRepositories.add( new Repository( "external", EXTERNAL_REPO_URL, Repository.LAYOUT_JPP, true, true ) ); | |
97 | } | |
98 | ||
99 | return remoteRepositories; | |
100 | diff -up ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java.sav ./maven2/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java | |
ad51ea80 | 101 | --- ./maven/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java.sav 2006-07-08 11:46:08.000000000 -0400 |
102 | +++ ./maven/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/Repository.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 103 | @@ -18,6 +18,8 @@ package org.apache.maven.bootstrap.model |
104 | ||
105 | import java.io.File; | |
106 | import java.util.Collections; | |
107 | +import java.util.Hashtable; | |
108 | +import org.apache.maven.artifact.repository.layout.MavenJPackageDepmap; | |
109 | ||
110 | /** | |
111 | * Repository path management. | |
112 | @@ -35,6 +37,12 @@ public class Repository | |
113 | ||
114 | private String layout = LAYOUT_DEFAULT; | |
115 | ||
116 | + public static final String LAYOUT_JPP = "jpp"; | |
117 | + | |
118 | + private static final char GROUP_SEPARATOR = '.'; | |
119 | + | |
120 | + private static final char PATH_SEPARATOR = '/'; | |
121 | + | |
122 | private String id; | |
123 | ||
124 | private boolean releases = true; | |
125 | @@ -64,7 +72,25 @@ public class Repository | |
126 | public String getArtifactPath( Dependency dependency ) | |
127 | { | |
128 | String repositoryPath; | |
129 | - if ( LAYOUT_LEGACY.equals( layout ) ) | |
130 | + if ( LAYOUT_JPP.equals( layout ) ) | |
131 | + { | |
132 | + | |
133 | + String groupId, artifactId; | |
134 | + | |
135 | + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); | |
136 | + Hashtable newInfo = map.getMappedInfo(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion()); | |
137 | + | |
138 | + groupId = (String) newInfo.get("group"); | |
139 | + artifactId = (String) newInfo.get("artifact"); | |
140 | + | |
141 | + if (dependency.getType().equals("pom")) { | |
142 | + return getMetadataPath(groupId, artifactId, dependency.getVersion(), dependency.getType(), dependency.getArtifact()); | |
143 | + } | |
144 | + | |
145 | + // Same as legacy layout | |
146 | + repositoryPath = groupId + "/" + artifactId + ".jar"; | |
147 | + } | |
148 | + else if ( LAYOUT_LEGACY.equals( layout ) ) | |
149 | { | |
150 | repositoryPath = dependency.getArtifactDirectory() + "/" + dependency.getType() + "s/" + | |
151 | dependency.getArtifact(); | |
152 | @@ -94,7 +120,30 @@ public class Repository | |
153 | Dependency dependency = new Dependency( groupId, artifactId, version, type, Collections.EMPTY_LIST ); | |
154 | ||
155 | String repositoryPath; | |
156 | - if ( LAYOUT_LEGACY.equals( layout ) ) | |
157 | + if ( LAYOUT_JPP.equals( layout ) ) | |
158 | + { | |
159 | + if (filename.substring(filename.length()-4).equals(".pom") || type.equals("pom")) { | |
160 | + | |
161 | + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); | |
162 | + Hashtable newInfo = map.getMappedInfo(groupId, artifactId, version); | |
163 | + | |
164 | + groupId = (String) newInfo.get("group"); | |
165 | + artifactId = (String) newInfo.get("artifact"); | |
166 | + | |
167 | + String fName = groupId.replace(PATH_SEPARATOR, GROUP_SEPARATOR) + "-" + artifactId + ".pom"; | |
168 | + repositoryPath = System.getProperty("maven2.jpp.pom.path", "JPP/maven2/poms") + "/" + fName; | |
169 | + java.io.File f; | |
170 | + | |
171 | + // .substring(6) removes preceeding file:// | |
172 | + f = new File(basedir.substring(6) + "/" + repositoryPath); | |
173 | + if (!f.exists()) { | |
174 | + repositoryPath = System.getProperty("maven2.jpp.default.pom.path", "JPP/maven2/default_poms") + "/" + fName; | |
175 | + } | |
176 | + } else { | |
177 | + repositoryPath = System.getProperty("maven2.jpp.pom.path", "JPP/maven2/poms") + "/" + filename; | |
178 | + } | |
179 | + } | |
180 | + else if ( LAYOUT_LEGACY.equals( layout ) ) | |
181 | { | |
182 | repositoryPath = dependency.getArtifactDirectory() + "/poms/" + filename; | |
183 | } | |
184 | @@ -102,11 +151,29 @@ public class Repository | |
185 | { | |
186 | repositoryPath = dependency.getGroupId().replace( '.', '/' ); | |
187 | repositoryPath = repositoryPath + "/" + dependency.getArtifactId(); | |
188 | - if ( version != null ) | |
189 | + | |
190 | + String newVersion = version; | |
191 | + String newFilename = filename; | |
192 | + | |
193 | + if ( ( | |
194 | + ( System.getProperty("maven2.offline.mode") != null && | |
195 | + System.getProperty("maven2.ignore.versions") != null ) || | |
196 | + (System.getProperty("maven2.jpp.mode") != null) | |
197 | + ) && | |
198 | + version != null) { | |
199 | + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); | |
200 | + Hashtable newInfo = map.getMappedInfo(groupId, artifactId, version); | |
201 | + | |
202 | + newVersion = (String) newInfo.get("version"); | |
203 | + | |
204 | + newFilename = filename.replaceFirst(dependency.getVersion(), newVersion); | |
205 | + } | |
206 | + | |
207 | + if ( newVersion != null ) | |
208 | { | |
209 | - repositoryPath = repositoryPath + "/" + dependency.getVersion(); | |
210 | + repositoryPath = repositoryPath + "/" + newVersion; | |
211 | } | |
212 | - repositoryPath = repositoryPath + "/" + filename; | |
213 | + repositoryPath = repositoryPath + "/" + newFilename; | |
214 | } | |
215 | else | |
216 | { | |
217 | diff -up ./maven2/bootstrap.sh.sav ./maven2/bootstrap.sh | |
ad51ea80 | 218 | --- ./maven/bootstrap.sh.sav 2007-03-18 20:43:54.000000000 -0400 |
219 | +++ ./maven/bootstrap.sh 2009-05-05 15:28:38.000000000 -0400 | |
bd00ca76 | 220 | @@ -8,7 +8,7 @@ if [ -z "$JAVA_HOME" ]; then |
221 | exit 1 | |
222 | fi | |
223 | ||
224 | -JAVACMD="$JAVA_HOME/bin/java" | |
225 | +JAVACMD="$JAVA_HOME/bin/java -classpath $CLASSPATH" | |
226 | ||
227 | ( | |
228 | cd bootstrap/bootstrap-mini | |
229 | diff -up ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java | |
ad51ea80 | 230 | --- ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java.sav 2007-03-26 21:05:38.000000000 -0400 |
231 | +++ ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 232 | @@ -340,9 +340,25 @@ public class DefaultWagonManager |
233 | else if ( repository.isBlacklisted() ) | |
234 | { | |
235 | getLogger().debug( "Skipping blacklisted repository " + repository.getId() ); | |
236 | - } | |
237 | - else | |
238 | - { | |
239 | + } | |
240 | + else if ( ((System.getProperty("maven2.offline.mode") != null) || | |
241 | + (System.getProperty("maven2.jpp.mode") != null)) && | |
242 | + !repository.getUrl().startsWith("file:") ) { | |
243 | + getLogger().warn( "Skipping non filebased repository " + repository.getUrl() + " in full offline mode"); | |
244 | + } | |
245 | + else | |
246 | + { | |
247 | + // Else policy is enabled, this is not a blacklisted repo, and we | |
248 | + // may or may not be in jpp/offline mode. If we are not in | |
249 | + // jpp/offline mode, __jpp_repo__ needs to be disabled. | |
250 | + | |
251 | + if (System.getProperty("maven2.usejppjars") == null && | |
252 | + System.getProperty("maven2.jpp.mode") == null && | |
253 | + repository.getId().equals("__jpp_repo__")) { | |
254 | + getLogger().warn( "Skipping jpp repository " + repository.getUrl() + " in vanilla mode"); | |
255 | + return; | |
256 | + } | |
257 | + | |
258 | getLogger().debug( "Trying repository " + repository.getId() ); | |
259 | getRemoteFile( repository, artifact.getFile(), remotePath, downloadMonitor, policy.getChecksumPolicy(), | |
260 | false ); | |
261 | diff -up ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java | |
ad51ea80 | 262 | --- ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java.sav 2007-10-16 16:40:07.000000000 -0400 |
263 | +++ ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 264 | @@ -88,7 +88,9 @@ public class DefaultRepositoryMetadataMa |
265 | ||
266 | boolean metadataIsEmpty = true; | |
267 | ||
268 | - if ( checkForUpdates ) | |
269 | + if ( checkForUpdates && | |
270 | + ((System.getProperty("maven2.offline.mode") == null) && | |
271 | + (System.getProperty("maven2.jpp.mode") == null))) | |
272 | { | |
273 | getLogger().info( metadata.getKey() + ": checking for updates from " + repository.getId() ); | |
274 | ||
275 | diff -up ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java | |
ad51ea80 | 276 | --- ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java.sav 2007-09-10 20:36:31.000000000 -0400 |
277 | +++ ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 278 | @@ -184,7 +184,9 @@ public class DefaultArtifactResolver |
279 | try | |
280 | { | |
281 | // TODO: force should be passed to the wagon manager | |
282 | - if ( artifact.getRepository() != null ) | |
283 | + if ( artifact.getRepository() != null && | |
284 | + ((System.getProperty("maven2.offline.mode") == null) && | |
285 | + (System.getProperty("maven2.jpp.mode") == null))) | |
286 | { | |
287 | // the transformations discovered the artifact - so use it exclusively | |
288 | wagonManager.getArtifact( artifact, artifact.getRepository() ); | |
289 | diff -up ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java.sav ./maven2/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java | |
ad51ea80 | 290 | --- ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java.sav 2007-01-11 02:47:53.000000000 -0500 |
291 | +++ ./maven/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/ReleaseArtifactTransformation.java 2009-05-05 15:27:21.000000000 -0400 | |
bd00ca76 | 292 | @@ -46,7 +46,11 @@ public class ReleaseArtifactTransformati |
293 | { | |
294 | try | |
295 | { | |
296 | - String version = resolveVersion( artifact, localRepository, remoteRepositories ); | |
297 | + String version; | |
298 | + if (System.getProperty("maven2.ignore.versions") != null) | |
299 | + version = "2.0.8"; | |
300 | + else | |
301 | + version = resolveVersion( artifact, localRepository, remoteRepositories ); | |
302 | ||
303 | if ( Artifact.RELEASE_VERSION.equals( version ) ) | |
304 | { | |
305 | diff -up ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java | |
ad51ea80 | 306 | --- ./maven/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java.sav 2007-01-11 02:47:53.000000000 -0500 |
307 | +++ ./maven/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 308 | @@ -23,6 +23,9 @@ import org.apache.maven.artifact.Artifac |
309 | import org.apache.maven.artifact.handler.ArtifactHandler; | |
310 | import org.apache.maven.artifact.metadata.ArtifactMetadata; | |
311 | import org.apache.maven.artifact.repository.ArtifactRepository; | |
312 | +import org.apache.maven.artifact.repository.layout.MavenJPackageDepmap; | |
313 | + | |
314 | +import java.util.Hashtable; | |
315 | ||
316 | /** | |
317 | * @author jdcasey | |
318 | @@ -42,10 +45,24 @@ public class DefaultRepositoryLayout | |
319 | ||
320 | StringBuffer path = new StringBuffer(); | |
321 | ||
322 | + String baseVersion = artifact.getBaseVersion(); | |
323 | + String version = artifact.getVersion(); | |
324 | + | |
325 | + if (( System.getProperty("maven2.offline.mode") != null && | |
326 | + System.getProperty("maven2.ignore.versions") != null ) || | |
327 | + ( System.getProperty("maven2.jpp.mode") != null) ) { | |
328 | + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); | |
329 | + Hashtable newInfo = map.getMappedInfo(artifact.getGroupId(), artifact.getArtifactId(), version); | |
330 | + | |
331 | + //System.err.println("Replacing[1] " + baseVersion + " and " + version + " with " + (String) newInfo.get("version") + " in offline+ignore versions mode"); | |
332 | + baseVersion = (String) newInfo.get("version"); | |
333 | + version = baseVersion; | |
334 | + } | |
335 | + | |
336 | path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); | |
337 | path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); | |
338 | - path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); | |
339 | - path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); | |
340 | + path.append( baseVersion ).append( PATH_SEPARATOR ); | |
341 | + path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( version ); | |
342 | ||
343 | if ( artifact.hasClassifier() ) | |
344 | { | |
345 | @@ -76,7 +93,17 @@ public class DefaultRepositoryLayout | |
346 | ||
347 | if ( metadata.storedInArtifactVersionDirectory() ) | |
348 | { | |
349 | - path.append( metadata.getBaseVersion() ).append( PATH_SEPARATOR ); | |
350 | + String baseVersion = metadata.getBaseVersion(); | |
351 | + | |
352 | + if (( System.getProperty("maven2.offline.mode") != null && | |
353 | + System.getProperty("maven2.ignore.versions") != null ) || | |
354 | + ( System.getProperty("maven2.jpp.mode") != null) ) { | |
355 | + MavenJPackageDepmap map = MavenJPackageDepmap.getInstance(); | |
356 | + Hashtable newInfo = map.getMappedInfo(metadata.getGroupId(), metadata.getArtifactId(), baseVersion); | |
357 | + | |
358 | + baseVersion = (String) newInfo.get("version"); | |
359 | + } | |
360 | + path.append( baseVersion ).append( PATH_SEPARATOR ); | |
361 | } | |
362 | } | |
363 | ||
364 | diff -up ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav ./maven2/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java | |
ad51ea80 | 365 | --- ./maven/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java.sav 2007-11-05 09:24:53.000000000 -0500 |
366 | +++ ./maven/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 367 | @@ -267,7 +267,8 @@ public class DefaultArtifactCollector |
368 | // set the recommended version | |
369 | // TODO: maybe its better to just pass the range through to retrieval and use a transformation? | |
370 | ArtifactVersion version; | |
371 | - if ( !artifact.isSelectedVersionKnown() ) | |
372 | + if ( !artifact.isSelectedVersionKnown() && | |
373 | + System.getProperty("maven2.ignore.versions") == null) | |
374 | { | |
375 | List versions = artifact.getAvailableVersions(); | |
376 | if ( versions == null ) | |
377 | @@ -302,7 +303,14 @@ public class DefaultArtifactCollector | |
378 | version = artifact.getSelectedVersion(); | |
379 | } | |
380 | ||
381 | - artifact.selectVersion( version.toString() ); | |
382 | + if ( !artifact.isSelectedVersionKnown() && | |
383 | + System.getProperty("maven2.ignore.versions") != null ) | |
384 | + { | |
385 | + artifact.selectVersion( "2.0.8" ); | |
386 | + } else { | |
387 | + artifact.selectVersion( version.toString() ); | |
388 | + } | |
389 | + | |
390 | fireEvent( ResolutionListener.SELECT_VERSION_FROM_RANGE, listeners, child ); | |
391 | } | |
392 | ||
393 | diff -up ./maven2/maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav ./maven2/maven-artifact/src/main/resources/META-INF/plexus/components.xml | |
ad51ea80 | 394 | --- ./maven/maven-artifact/src/main/resources/META-INF/plexus/components.xml.sav 2007-09-18 15:19:35.000000000 -0400 |
395 | +++ ./maven/maven-artifact/src/main/resources/META-INF/plexus/components.xml 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 396 | @@ -31,6 +31,12 @@ under the License. |
397 | <implementation>org.apache.maven.artifact.repository.layout.LegacyRepositoryLayout</implementation> | |
398 | </component> | |
399 | ||
400 | + <component> | |
401 | + <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role> | |
402 | + <role-hint>jpp</role-hint> | |
403 | + <implementation>org.apache.maven.artifact.repository.layout.JPackageRepositoryLayout</implementation> | |
404 | + </component> | |
405 | + | |
406 | <!-- | |
407 | | | |
408 | | ArtifactHandlerManager | |
409 | diff -up ./maven2/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav ./maven2/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java | |
ad51ea80 | 410 | --- ./maven/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java.sav 2007-10-16 17:43:07.000000000 -0400 |
411 | +++ ./maven/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 412 | @@ -224,9 +224,16 @@ public class DefaultPluginVersionManager |
413 | } | |
414 | ||
415 | // if we still haven't found a version, then fail early before we get into the update goop. | |
416 | - if ( StringUtils.isEmpty( version ) ) | |
417 | + if ( StringUtils.isEmpty( version ) && ((System.getProperty("maven2.offline.mode") == null) && | |
418 | + (System.getProperty("maven2.jpp.mode") == null))) | |
419 | + | |
420 | { | |
421 | throw new PluginVersionNotFoundException( groupId, artifactId ); | |
422 | + } else if (((System.getProperty("maven2.offline.mode") != null) || | |
423 | + (System.getProperty("maven2.jpp.mode") != null))) { | |
424 | + // Doesn't matter what we have here. We need *something* because metadata | |
425 | + // is not retrieved in offline mode, so there needs to be some kind of version | |
426 | + version = "2.0.8"; | |
427 | } | |
428 | ||
429 | // if the plugin registry is inactive, then the rest of this goop is useless... | |
430 | diff -up ./maven2/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav ./maven2/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java | |
ad51ea80 | 431 | --- ./maven/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java.sav 2007-01-11 02:47:53.000000000 -0500 |
432 | +++ ./maven/maven-project/src/main/java/org/apache/maven/project/validation/DefaultModelValidator.java 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 433 | @@ -43,7 +43,7 @@ import java.util.List; |
434 | public class DefaultModelValidator | |
435 | implements ModelValidator | |
436 | { | |
437 | - private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+"; | |
438 | + private static final String ID_REGEX = "[A-Za-z0-9_/\\\\.-]+"; | |
439 | ||
440 | /////////////////////////////////////////////////////////////////////////// | |
441 | // ModelValidator Implementation | |
442 | @@ -88,7 +88,18 @@ public class DefaultModelValidator | |
443 | ||
444 | validateStringNotEmpty( "dependencies.dependency.type", result, d.getType(), dependencySourceHint( d ) ); | |
445 | ||
446 | - validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), dependencySourceHint( d ) ); | |
447 | + // Check disabled in "ignore versions" mode. On many occassions, JPackage | |
448 | + // builds modules that are not built by default in a project. A lot of | |
449 | + // these seem to have missing versions for dependencies, so we omit | |
450 | + // validation check for version in the "ignore versions" mode. | |
451 | + | |
452 | + if (System.getProperty("maven2.ignore.versions") == null) { | |
453 | + validateStringNotEmpty( "dependencies.dependency.version", result, d.getVersion(), dependencySourceHint( d ) ); | |
454 | + } else { | |
455 | + if ( d.getVersion() == null ) { | |
456 | + d.setVersion("2.0.8"); | |
457 | + } | |
458 | + } | |
459 | ||
460 | if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) ) | |
461 | { | |
462 | @@ -212,7 +223,7 @@ public class DefaultModelValidator | |
463 | boolean match = id.matches( ID_REGEX ); | |
464 | if ( !match ) | |
465 | { | |
466 | - result.addMessage( "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern." ); | |
467 | + result.addMessage( "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern: " + ID_REGEX); | |
468 | } | |
469 | return match; | |
470 | } | |
471 | diff -up ./maven2/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav ./maven2/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml | |
ad51ea80 | 472 | --- ./maven/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml.sav 2007-01-11 02:47:53.000000000 -0500 |
473 | +++ ./maven/maven-project/src/main/resources/org/apache/maven/project/pom-4.0.0.xml 2009-05-05 15:28:37.000000000 -0400 | |
bd00ca76 | 474 | @@ -24,6 +24,15 @@ under the License. |
475 | ||
476 | <repositories> | |
477 | <repository> | |
478 | + <id>__jpp_repo__</id> | |
479 | + <name>JPackage Maven Repository</name> | |
480 | + <layout>jpp</layout> | |
481 | + <url>file:///usr/share/maven2/repository</url> | |
482 | + <snapshots> | |
483 | + <enabled>true</enabled> | |
484 | + </snapshots> | |
485 | + </repository> | |
486 | + <repository> | |
487 | <id>central</id> | |
488 | <name>Maven Repository Switchboard</name> | |
489 | <layout>default</layout> | |
490 | @@ -38,6 +47,18 @@ under the License. | |
491 | </repositories> | |
492 | ||
493 | <pluginRepositories> | |
494 | + <pluginRepository> | |
495 | + <id>__jpp_repo__</id> | |
496 | + <name>JPackage Maven Plugin Repository</name> | |
497 | + <url>file:///usr/share/maven2/repository</url> | |
498 | + <layout>jpp</layout> | |
499 | + <snapshots> | |
500 | + <enabled>true</enabled> | |
501 | + </snapshots> | |
502 | + <releases> | |
503 | + <updatePolicy>never</updatePolicy> | |
504 | + </releases> | |
505 | + </pluginRepository> | |
506 | <pluginRepository> | |
507 | <id>central</id> | |
508 | <name>Maven Plugin Repository</name> |