maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r355404 - in /maven/components/trunk: maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/ maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/ maven-core/src/main/java/org/apache/maven/usab...
Date Fri, 09 Dec 2005 07:59:35 GMT
Author: brett
Date: Thu Dec  8 23:58:04 2005
New Revision: 355404

URL: http://svn.apache.org/viewcvs?rev=355404&view=rev
Log:
implement lax parsing of repository metadata XML files
PR: MNG-1788

Modified:
    maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
    maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
    maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java
    maven/components/trunk/maven-model/pom.xml
    maven/components/trunk/maven-plugin-descriptor/pom.xml
    maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
    maven/components/trunk/maven-plugin-parameter-documenter/pom.xml
    maven/components/trunk/maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo
    maven/components/trunk/maven-plugin-registry/pom.xml
    maven/components/trunk/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java
    maven/components/trunk/maven-profile/pom.xml
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/RegexBasedModelInterpolator.java
    maven/components/trunk/maven-repository-metadata/pom.xml
    maven/components/trunk/maven-repository-metadata/src/main/mdo/metadata.mdo
    maven/components/trunk/maven-settings/pom.xml

Modified: maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
(original)
+++ maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/manager/DefaultWagonManager.java
Thu Dec  8 23:58:04 2005
@@ -756,8 +756,7 @@
             throw new IllegalArgumentException( "arguments can't be null" );
         }
 
-        final XmlPlexusConfiguration xmlConf = ( configuration == null ) ? new XmlPlexusConfiguration(
"configuration" )
-                                                                        : new XmlPlexusConfiguration(
configuration );
+        final XmlPlexusConfiguration xmlConf = new XmlPlexusConfiguration( configuration
);
 
         serverConfigurationMap.put( repositoryId, xmlConf );
     }

Modified: maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
(original)
+++ maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
Thu Dec  8 23:58:04 2005
@@ -92,7 +92,7 @@
             {
                 reader = new FileReader( metadataFile );
 
-                metadata = mappingReader.read( reader );
+                metadata = mappingReader.read( reader, false );
             }
             finally
             {

Modified: maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
(original)
+++ maven/components/trunk/maven-artifact-manager/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java
Thu Dec  8 23:58:04 2005
@@ -268,7 +268,7 @@
 
             MetadataXpp3Reader mappingReader = new MetadataXpp3Reader();
 
-            result = mappingReader.read( fileReader );
+            result = mappingReader.read( fileReader, false );
         }
         catch ( FileNotFoundException e )
         {

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java
Thu Dec  8 23:58:04 2005
@@ -117,7 +117,7 @@
         
         ParamdocXpp3Reader paramdocReader = new ParamdocXpp3Reader();
         
-        ExpressionDocumentation documentation = paramdocReader.read( reader );
+        ExpressionDocumentation documentation = paramdocReader.read( reader, true );
         
         List expressions = documentation.getExpressions();
         

Modified: maven/components/trunk/maven-model/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-model/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-model/pom.xml (original)
+++ maven/components/trunk/maven-model/pom.xml Thu Dec  8 23:58:04 2005
@@ -15,7 +15,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <goals>
@@ -41,6 +41,7 @@
           <plugin>
             <groupId>org.codehaus.modello</groupId>
             <artifactId>modello-maven-plugin</artifactId>
+            <version>1.0-alpha-7-SNAPSHOT</version>
             <executions>
               <execution>
                 <id>v3</id>
@@ -81,4 +82,4 @@
       <artifactId>plexus-utils</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-plugin-descriptor/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-descriptor/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-descriptor/pom.xml (original)
+++ maven/components/trunk/maven-plugin-descriptor/pom.xml Thu Dec  8 23:58:04 2005
@@ -14,7 +14,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <goals>
@@ -47,4 +47,4 @@
       <artifactId>plexus-container-default</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
(original)
+++ maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
Thu Dec  8 23:58:04 2005
@@ -284,7 +284,7 @@
                     throw new FileNotFoundException( "Unable to find /META-INF/maven/lifecycle.xml
in the plugin" );
                 }
                 r = new InputStreamReader( resourceAsStream );
-                config = reader.read( r );
+                config = reader.read( r, true );
             }
             finally
             {

Modified: maven/components/trunk/maven-plugin-parameter-documenter/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-parameter-documenter/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-parameter-documenter/pom.xml (original)
+++ maven/components/trunk/maven-plugin-parameter-documenter/pom.xml Thu Dec  8 23:58:04 2005
@@ -13,7 +13,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <id>base</id>
@@ -49,4 +49,4 @@
       <artifactId>plexus-container-default</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo (original)
+++ maven/components/trunk/maven-plugin-parameter-documenter/src/main/mdo/paramdoc.mdo Thu
Dec  8 23:58:04 2005
@@ -30,19 +30,19 @@
       <codeSegments>
         <codeSegment>
           <version>1.0.0</version>
-          <code><![CDATA[    private Map expressionsBySyntax;
+          <code><![CDATA[    private java.util.Map expressionsBySyntax;
     
-    public Map getExpressionsBySyntax()
+    public java.util.Map getExpressionsBySyntax()
     {
         if ( expressionsBySyntax == null )
         {
-            expressionsBySyntax = new HashMap();
+            expressionsBySyntax = new java.util.HashMap();
        
-            List expressions = getExpressions();
+            java.util.List expressions = getExpressions();
        
             if ( expressions != null && !expressions.isEmpty() )
             {
-                for ( Iterator it = expressions.iterator(); it.hasNext(); )
+                for ( java.util.Iterator it = expressions.iterator(); it.hasNext(); )
                 {
                     Expression expr = (Expression) it.next();
        

Modified: maven/components/trunk/maven-plugin-registry/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-registry/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-registry/pom.xml (original)
+++ maven/components/trunk/maven-plugin-registry/pom.xml Thu Dec  8 23:58:04 2005
@@ -14,7 +14,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <goals>
@@ -41,4 +41,4 @@
       <artifactId>plexus-container-default</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java
(original)
+++ maven/components/trunk/maven-plugin-tools/maven-plugin-tools-pluggy/src/main/java/org/apache/maven/tools/plugin/pluggy/Main.java
Thu Dec  8 23:58:04 2005
@@ -63,7 +63,7 @@
         MavenXpp3Reader modelReader = new MavenXpp3Reader();
         FileReader reader = new FileReader( pom );
 
-        Model model = modelReader.read( reader );
+        Model model = modelReader.read( reader, true );
 
         // Not doing inheritence, except for groupId and version
         if ( model.getGroupId() == null )

Modified: maven/components/trunk/maven-profile/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-profile/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-profile/pom.xml (original)
+++ maven/components/trunk/maven-profile/pom.xml Thu Dec  8 23:58:04 2005
@@ -13,7 +13,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <goals>
@@ -45,4 +45,4 @@
       <artifactId>plexus-container-default</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Thu Dec  8 23:58:04 2005
@@ -249,7 +249,7 @@
                     VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion()
);
                     Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(),
d.getArtifactId(),
                                                                                   versionRange,
d.getType(),
-                                                                                  d.getClassifier(),
d.getScope(), 
+                                                                                  d.getClassifier(),
d.getScope(),
                                                                                   d.isOptional()
);
                     map.put( d.getManagementKey(), artifact );
                 }
@@ -286,23 +286,24 @@
                                               ProfileManager profileManager, boolean checkDistributionManagementStatus
)
         throws ProjectBuildingException
     {
-        Model model = readModel( "unknown", projectDescriptor );
+        Model model = readModel( "unknown", projectDescriptor, true );
 
         // Always cache files in the source tree over those in the repository
         MavenProject p = new MavenProject( model );
         p.setFile( projectDescriptor );
-        
+
         String modelKey = createCacheKey( model.getGroupId(), model.getArtifactId(), model.getVersion()
);
         if ( modelCache.containsKey( modelKey ) )
         {
-            throw new ProjectBuildingException( model.getGroupId() + ":" + model.getArtifactId(),

-                    "Duplicate project ID found in " + projectDescriptor.getAbsolutePath()
);
+            throw new ProjectBuildingException( model.getGroupId() + ":" + model.getArtifactId(),
+                                                "Duplicate project ID found in " +
+                                                    projectDescriptor.getAbsolutePath() );
         }
         modelCache.put( modelKey, p );
 
         MavenProject project = build( projectDescriptor.getAbsolutePath(), model, localRepository,
                                       buildArtifactRepositories( getSuperModel() ),
-                                      projectDescriptor.getAbsoluteFile().getParentFile(),
profileManager );
+                                      projectDescriptor.getAbsoluteFile().getParentFile(),
profileManager, true );
 
         if ( checkDistributionManagementStatus )
         {
@@ -350,7 +351,8 @@
 
         Model model = findModelFromRepository( artifact, remoteArtifactRepositories, localRepository,
allowStubModel );
 
-        return build( "Artifact [" + artifact + "]", model, localRepository, remoteArtifactRepositories,
null, null );
+        return build( "Artifact [" + artifact + "]", model, localRepository, remoteArtifactRepositories,
null, null,
+                      false );
     }
 
     private Model findModelFromRepository( Artifact artifact, List remoteArtifactRepositories,
@@ -385,7 +387,7 @@
                 artifactResolver.resolve( projectArtifact, remoteArtifactRepositories, localRepository
);
 
                 File file = projectArtifact.getFile();
-                model = readModel( projectId, file );
+                model = readModel( projectId, file, false );
 
                 String downloadUrl = null;
                 ArtifactStatus status = ArtifactStatus.NONE;
@@ -515,7 +517,8 @@
     }
 
     private MavenProject build( String pomLocation, Model model, ArtifactRepository localRepository,
-                                List parentSearchRepositories, File projectDir, ProfileManager
externalProfileManager )
+                                List parentSearchRepositories, File projectDir, ProfileManager
externalProfileManager,
+                                boolean strict )
         throws ProjectBuildingException
     {
         Model superModel = getSuperModel();
@@ -589,7 +592,7 @@
         try
         {
             project = assembleLineage( model, lineage, localRepository, projectDir, parentSearchRepositories,
-                                       aggregatedRemoteWagonRepositories, externalProfileManager
);
+                                       aggregatedRemoteWagonRepositories, externalProfileManager,
strict );
         }
         catch ( InvalidRepositoryException e )
         {
@@ -626,7 +629,8 @@
 
         try
         {
-            project = processProjectLogic( pomLocation, project, repositories, externalProfileManager,
projectDir );
+            project =
+                processProjectLogic( pomLocation, project, repositories, externalProfileManager,
projectDir, strict );
         }
         catch ( ModelInterpolationException e )
         {
@@ -684,7 +688,7 @@
      * and projects are not cached or reused
      */
     private MavenProject processProjectLogic( String pomLocation, MavenProject project, List
remoteRepositories,
-                                              ProfileManager profileMgr, File projectDir
)
+                                              ProfileManager profileMgr, File projectDir,
boolean strict )
         throws ProjectBuildingException, ModelInterpolationException, InvalidRepositoryException
     {
         Model model = project.getModel();
@@ -718,7 +722,7 @@
             context.put( "basedir", projectDir.getAbsolutePath() );
         }
 
-        model = modelInterpolator.interpolate( model, context );
+        model = modelInterpolator.interpolate( model, context, strict );
 
         // interpolation is before injection, because interpolation is off-limits in the
injected variables
         modelDefaultsInjector.injectDefaults( model );
@@ -796,7 +800,8 @@
      */
     private MavenProject assembleLineage( Model model, LinkedList lineage, ArtifactRepository
localRepository,
                                           File projectDir, List parentSearchRepositories,
-                                          Set aggregatedRemoteWagonRepositories, ProfileManager
externalProfileManager )
+                                          Set aggregatedRemoteWagonRepositories, ProfileManager
externalProfileManager,
+                                          boolean strict )
         throws ProjectBuildingException, InvalidRepositoryException
     {
         if ( !model.getRepositories().isEmpty() )
@@ -860,11 +865,11 @@
             {
                 throw new ProjectBuildingException( projectId, "Missing artifactId element
from parent element" );
             }
-            else if ( parentModel.getGroupId().equals( model.getGroupId() ) &&  
-                    parentModel.getArtifactId().equals( model.getArtifactId() ) )
+            else if ( parentModel.getGroupId().equals( model.getGroupId() ) &&
+                parentModel.getArtifactId().equals( model.getArtifactId() ) )
             {
-                throw new ProjectBuildingException( projectId, "Parent element is a duplicate
of " +
-                        "the current project " );
+                throw new ProjectBuildingException( projectId,
+                                                    "Parent element is a duplicate of " +
"the current project " );
             }
             else if ( StringUtils.isEmpty( parentModel.getVersion() ) )
             {
@@ -898,16 +903,16 @@
                 {
                     if ( getLogger().isDebugEnabled() )
                     {
-                        getLogger().debug(
-                                           "Path specified in <relativePath/> (" +
parentRelativePath
-                                               + ") is a directory. Searching for 'pom.xml'
within this directory." );
+                        getLogger().debug( "Path specified in <relativePath/> (" +
parentRelativePath +
+                            ") is a directory. Searching for 'pom.xml' within this directory."
);
                     }
-                    
+
                     parentDescriptor = new File( parentDescriptor, "pom.xml" );
 
                     if ( !parentDescriptor.exists() )
                     {
-                        throw new ProjectBuildingException( projectId, "missing parent project
descriptor: " + parentDescriptor.getAbsolutePath() );
+                        throw new ProjectBuildingException( projectId, "missing parent project
descriptor: " +
+                            parentDescriptor.getAbsolutePath() );
                     }
                 }
 
@@ -924,7 +929,7 @@
 
                 if ( parentDescriptor != null && parentDescriptor.exists() )
                 {
-                    Model candidateParent = readModel( projectId, parentDescriptor );
+                    Model candidateParent = readModel( projectId, parentDescriptor, strict
);
 
                     String candidateParentGroupId = candidateParent.getGroupId();
                     if ( candidateParentGroupId == null && candidateParent.getParent()
!= null )
@@ -985,9 +990,10 @@
 
             if ( model != null && !"pom".equals( model.getPackaging() ) )
             {
-                throw new ProjectBuildingException( projectId, "Parent: " + model.getId()
+ " of project: " + projectId + " has wrong packaging: " + model.getPackaging() + ". Must
be 'pom'." );
+                throw new ProjectBuildingException( projectId, "Parent: " + model.getId()
+ " of project: " +
+                    projectId + " has wrong packaging: " + model.getPackaging() + ". Must
be 'pom'." );
             }
-            
+
             File parentProjectDir = null;
             if ( parentDescriptor != null )
             {
@@ -995,7 +1001,7 @@
             }
             MavenProject parent = assembleLineage( model, lineage, localRepository, parentProjectDir,
                                                    parentSearchRepositories, aggregatedRemoteWagonRepositories,
-                                                   externalProfileManager );
+                                                   externalProfileManager, strict );
             parent.setFile( parentDescriptor );
 
             project.setParent( parent );
@@ -1080,14 +1086,14 @@
         }
     }
 
-    private Model readModel( String projectId, File file )
+    private Model readModel( String projectId, File file, boolean strict )
         throws ProjectBuildingException
     {
         Reader reader = null;
         try
         {
             reader = new FileReader( file );
-            return readModel( projectId, file.getAbsolutePath(), reader );
+            return readModel( projectId, file.getAbsolutePath(), reader, strict );
         }
         catch ( FileNotFoundException e )
         {
@@ -1105,7 +1111,7 @@
         }
     }
 
-    private Model readModel( String projectId, String pomLocation, Reader reader )
+    private Model readModel( String projectId, String pomLocation, Reader reader, boolean
strict )
         throws IOException, InvalidProjectModelException
     {
         StringWriter sw = new StringWriter();
@@ -1123,22 +1129,23 @@
 
         try
         {
-            return modelReader.read( sReader );
+            return modelReader.read( sReader, strict );
         }
         catch ( XmlPullParserException e )
         {
-            throw new InvalidProjectModelException( projectId, pomLocation, "Parse error
reading POM. Reason: " + e.getMessage(), e );
+            throw new InvalidProjectModelException( projectId, pomLocation,
+                                                    "Parse error reading POM. Reason: " +
e.getMessage(), e );
         }
     }
 
-    private Model readModel( String projectId, URL url )
+    private Model readModel( String projectId, URL url, boolean strict )
         throws ProjectBuildingException
     {
         InputStreamReader reader = null;
         try
         {
             reader = new InputStreamReader( url.openStream() );
-            return readModel( projectId, url.toExternalForm(), reader );
+            return readModel( projectId, url.toExternalForm(), reader, strict );
         }
         catch ( IOException e )
         {
@@ -1324,7 +1331,7 @@
         {
             List remoteRepositories = buildArtifactRepositories( superModel );
 
-            project = processProjectLogic( "<Super-POM>", project, remoteRepositories,
null, null );
+            project = processProjectLogic( "<Super-POM>", project, remoteRepositories,
null, null, true );
 
             project.setExecutionRoot( true );
 
@@ -1351,7 +1358,7 @@
 
         String projectId = safeVersionlessKey( STANDALONE_SUPERPOM_GROUPID, STANDALONE_SUPERPOM_ARTIFACTID
);
 
-        return readModel( projectId, url );
+        return readModel( projectId, url, true );
     }
 
     public void contextualize( Context context )

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/ProjectArtifactMetadata.java
Thu Dec  8 23:58:04 2005
@@ -97,7 +97,7 @@
             writer = new FileWriter( destination );
 
             MavenXpp3Reader modelReader = new MavenXpp3Reader();
-            Model model = modelReader.read( sReader );
+            Model model = modelReader.read( sReader, false );
             model.setVersion( artifact.getVersion() );
 
             DistributionManagement distributionManagement = model.getDistributionManagement();

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/ModelInterpolator.java
Thu Dec  8 23:58:04 2005
@@ -32,4 +32,6 @@
     Model interpolate( Model project, Map context )
         throws ModelInterpolationException;
 
+    Model interpolate( Model model, Map context, boolean strict )
+        throws ModelInterpolationException;
 }

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/RegexBasedModelInterpolator.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/RegexBasedModelInterpolator.java?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/RegexBasedModelInterpolator.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/interpolation/RegexBasedModelInterpolator.java
Thu Dec  8 23:58:04 2005
@@ -42,6 +42,12 @@
     extends AbstractLogEnabled
     implements ModelInterpolator
 {
+    public Model interpolate( Model project, Map context )
+        throws ModelInterpolationException
+    {
+        return interpolate( project, context, true );
+    }
+
     /**
      * Serialize the inbound Model instance to a StringWriter, perform the regex replacement
to resolve
      * POM expressions, then re-parse into the resolved Model instance.
@@ -52,7 +58,7 @@
      * @param context The other context map to be used during resolution
      * @return The resolved instance of the inbound Model. This is a different instance!
      */
-    public Model interpolate( Model model, Map context )
+    public Model interpolate( Model model, Map context, boolean strict )
         throws ModelInterpolationException
     {
         StringWriter sWriter = new StringWriter();
@@ -68,13 +74,13 @@
         }
 
         String serializedModel = sWriter.toString();
-        
+
         RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
-        
+
         interpolator.addValueSource( new MapBasedValueSource( context ) );
         interpolator.addValueSource( new MapBasedValueSource( model.getProperties() ) );
         interpolator.addValueSource( new ObjectBasedValueSource( model ) );
-        
+
         try
         {
             interpolator.addValueSource( new EnvarBasedValueSource() );
@@ -84,7 +90,7 @@
             getLogger().warn( "Cannot initialize environment variables resolver. Skipping
environmental resolution." );
             getLogger().debug( "Failed to initialize envar resolver. Skipping environmental
resolution.", e );
         }
-        
+
         serializedModel = interpolator.interpolate(serializedModel, "pom|project" );
 
         StringReader sReader = new StringReader( serializedModel );
@@ -92,7 +98,7 @@
         MavenXpp3Reader modelReader = new MavenXpp3Reader();
         try
         {
-            model = modelReader.read( sReader );
+            model = modelReader.read( sReader, strict );
         }
         catch ( IOException e )
         {

Modified: maven/components/trunk/maven-repository-metadata/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-repository-metadata/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-repository-metadata/pom.xml (original)
+++ maven/components/trunk/maven-repository-metadata/pom.xml Thu Dec  8 23:58:04 2005
@@ -15,7 +15,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <executions>
           <execution>
             <goals>
@@ -39,4 +39,4 @@
       <artifactId>plexus-utils</artifactId>
     </dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Modified: maven/components/trunk/maven-repository-metadata/src/main/mdo/metadata.mdo
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-repository-metadata/src/main/mdo/metadata.mdo?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-repository-metadata/src/main/mdo/metadata.mdo (original)
+++ maven/components/trunk/maven-repository-metadata/src/main/mdo/metadata.mdo Thu Dec  8
23:58:04 2005
@@ -99,7 +99,7 @@
                 changed = true;
             }
 
-            for ( Iterator i = versioning.getVersions().iterator(); i.hasNext(); )
+            for ( java.util.Iterator i = versioning.getVersions().iterator(); i.hasNext();
)
             {
                 String version = (String) i.next();
                 if ( !v.getVersions().contains( version ) )

Modified: maven/components/trunk/maven-settings/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-settings/pom.xml?rev=355404&r1=355403&r2=355404&view=diff
==============================================================================
--- maven/components/trunk/maven-settings/pom.xml (original)
+++ maven/components/trunk/maven-settings/pom.xml Thu Dec  8 23:58:04 2005
@@ -13,7 +13,7 @@
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-6</version>
+        <version>1.0-alpha-7-SNAPSHOT</version>
         <configuration>
           <version>1.0.0</version>
           <model>settings.mdo</model>



Mime
View raw message