maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r747923 - in /maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository: LegacyMavenRepositorySystem.java MavenRepositorySystem.java VersionNotFoundException.java
Date Wed, 25 Feb 2009 21:05:19 GMT
Author: ogusakov
Date: Wed Feb 25 21:05:19 2009
New Revision: 747923

URL: http://svn.apache.org/viewvc?rev=747923&view=rev
Log:
getting rid of project in the API layer

Added:
    maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
  (with props)
Modified:
    maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java
    maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/MavenRepositorySystem.java

Modified: maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java?rev=747923&r1=747922&r2=747923&view=diff
==============================================================================
--- maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java
(original)
+++ maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/LegacyMavenRepositorySystem.java
Wed Feb 25 21:05:19 2009
@@ -56,7 +56,7 @@
 import org.apache.maven.model.Exclusion;
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.RepositoryPolicy;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
+//import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.wagon.authentication.AuthenticationInfo;
 import org.apache.maven.wagon.events.TransferListener;
 import org.apache.maven.wagon.proxy.ProxyInfo;
@@ -188,7 +188,7 @@
      * @todo desperately needs refactoring. It's just here because it's implementation is
maven-project specific
      */
     public Set<Artifact> createArtifacts( List<Dependency> dependencies, String
inheritedScope, ArtifactFilter dependencyFilter, MavenRepositoryWrapper reactor )
-        throws InvalidDependencyVersionException
+        throws VersionNotFoundException
     {
         Set<Artifact> projectArtifacts = new LinkedHashSet<Artifact>( dependencies.size()
);
 
@@ -212,7 +212,7 @@
             }
             catch ( InvalidVersionSpecificationException e )
             {
-                throw new InvalidDependencyVersionException( reactor.getId(), d, reactor.getFile(),
e );
+                throw new VersionNotFoundException( reactor.getId(), d, reactor.getFile(),
e );
             }
             Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(),
d.getArtifactId(),
                                                                           versionRange, d.getType(),
d.getClassifier(),

Modified: maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/MavenRepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/MavenRepositorySystem.java?rev=747923&r1=747922&r2=747923&view=diff
==============================================================================
--- maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/MavenRepositorySystem.java
(original)
+++ maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/MavenRepositorySystem.java
Wed Feb 25 21:05:19 2009
@@ -33,7 +33,6 @@
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Repository;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.wagon.events.TransferListener;
 
 /**
@@ -63,7 +62,7 @@
     Artifact createDependencyArtifact( String groupId, String artifactId, String version,
String type, String classifier, String scope, String inheritedScope );
     
     Set<Artifact> createArtifacts( List<Dependency> dependencies, String inheritedScope,
ArtifactFilter dependencyFilter, MavenRepositoryWrapper reactor )
-        throws InvalidDependencyVersionException;
+        throws VersionNotFoundException;
 
     // Repository creation
 

Added: maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java?rev=747923&view=auto
==============================================================================
--- maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
(added)
+++ maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
Wed Feb 25 21:05:19 2009
@@ -0,0 +1,59 @@
+package org.apache.maven.repository;
+
+import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.model.Dependency;
+
+import java.io.File;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Thrown if a dependency has an invalid version.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id$
+ */
+public class VersionNotFoundException
+    extends Exception
+{
+    private Dependency dependency;
+
+    public VersionNotFoundException( String projectId
+                                     , Dependency dependency
+                                     , File pomFile
+                                     , InvalidVersionSpecificationException cause 
+                                     )
+    {
+        super( projectId+", "+formatLocationInPom( dependency )+ " " +dependency.getVersion()+",
pom file "+pomFile, cause );
+        
+        this.dependency = dependency;
+    }
+
+    private static String formatLocationInPom( Dependency dependency )
+    {
+        return "Dependency: " + ArtifactUtils.versionlessKey( dependency.getGroupId(), dependency.getArtifactId()
);
+    }
+
+    public Dependency getDependency()
+    {
+        return dependency;
+    }
+}

Propchange: maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-repository/src/main/java/org/apache/maven/repository/VersionNotFoundException.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message