Could this break on any POMs in the repository?

On 24/05/2008, at 7:50 AM, [EMAIL PROTECTED] wrote:

Author: jdcasey
Date: Fri May 23 14:50:50 2008
New Revision: 659677

URL: http://svn.apache.org/viewvc?rev=659677&view=rev
Log:
[MNG-2739] Adding validation to ProjectUtils for construction of ArtifactRepository instances (this is used ahead of the model validator invocation).

Modified:
maven/components/branches/maven-2.0.x/maven-model/src/main/mdo/ maven.mdo maven/components/branches/maven-2.0.x/maven-project/src/main/java/ org/apache/maven/project/ProjectUtils.java

Modified: maven/components/branches/maven-2.0.x/maven-model/src/main/ mdo/maven.mdo
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-model/src/main/mdo/maven.mdo?rev=659677&r1=659676&r2=659677&view=diff
= = = = = = = = ====================================================================== --- maven/components/branches/maven-2.0.x/maven-model/src/main/mdo/ maven.mdo (original) +++ maven/components/branches/maven-2.0.x/maven-model/src/main/mdo/ maven.mdo Fri May 23 14:50:50 2008
@@ -2636,6 +2636,7 @@
        <field>
          <name>id</name>
          <version>4.0.0</version>
+          <required>true</required>
          <description>
            <![CDATA[
A unique identifier for a repository. This is used to match the repository
@@ -2657,6 +2658,7 @@
        <field>
          <name>url</name>
          <version>4.0.0</version>
+          <required>true</required>
          <description>
            <![CDATA[
The url of the repository, in the form <code>protocol:// hostname/path</code>.

Modified: maven/components/branches/maven-2.0.x/maven-project/src/ main/java/org/apache/maven/project/ProjectUtils.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/project/ProjectUtils.java?rev=659677&r1=659676&r2=659677&view=diff
= = = = = = = = ====================================================================== --- maven/components/branches/maven-2.0.x/maven-project/src/main/ java/org/apache/maven/project/ProjectUtils.java (original) +++ maven/components/branches/maven-2.0.x/maven-project/src/main/ java/org/apache/maven/project/ProjectUtils.java Fri May 23 14:50:50 2008
@@ -96,6 +96,16 @@
            String id = repo.getId();
            String url = repo.getUrl();

+            if ( id == null || id.trim().length() < 1 )
+            {
+ throw new InvalidRepositoryException( "Repository ID must not be empty (URL is: " + url + ").", new IllegalArgumentException( "repository.id" ) );
+            }
+
+            if ( url == null || url.trim().length() < 1 )
+            {
+ throw new InvalidRepositoryException( "Repository URL must not be empty (ID is: " + id + ").", new IllegalArgumentException( "repository.url" ) );
+            }
+
// TODO: make this a map inside the factory instead, so no lookup needed ArtifactRepositoryLayout layout = getRepositoryLayout( repo, container );




--
Brett Porter
[EMAIL PROTECTED]
http://blogs.exist.com/bporter/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to