You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2003/02/11 04:25:49 UTC

cvs commit: jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/jelly ResolveSnapshotsTag.java

jvanzyl     2003/02/10 19:25:49

  Modified:    src/plugins-build/release plugin.jelly
               src/plugins-build/release/src/main/org/apache/maven/release
                        AbstractPomTransformer.java SnapshotResolver.java
               src/plugins-build/release/src/main/org/apache/maven/release/jelly
                        ResolveSnapshotsTag.java
  Log:
  o I can now modify the POM interactively. Can't really view the XML that
    well as jelly tries to escape everything. Gotta be a way around that.
  
  Revision  Changes    Path
  1.13      +2 -2      jakarta-turbine-maven/src/plugins-build/release/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/release/plugin.jelly,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- plugin.jelly	11 Feb 2003 02:49:42 -0000	1.12
  +++ plugin.jelly	11 Feb 2003 03:25:49 -0000	1.13
  @@ -49,7 +49,7 @@
         transformations="transformations"/>
   
       <i:ask
  -      question="There are ${size(transformations)} snapshot dependencies, would you like to update them to use timestamped versions?"
  +      question="There are ${transformer.selectedNodeCount} snapshot dependencies, would you like to update them to use timestamped versions?"
         answer="answer"
         default="yes"/>
   
  @@ -75,7 +75,7 @@
           <j:if test="${answer == 'yes'}">
   
             <!-- Change the node. -->
  -          <r:transform transformation="${transformation}"/>
  +          ${transformation.transform()}"/>
   
           </j:if>
   
  
  
  
  1.6       +11 -8     jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/AbstractPomTransformer.java
  
  Index: AbstractPomTransformer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/AbstractPomTransformer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractPomTransformer.java	11 Feb 2003 02:40:41 -0000	1.5
  +++ AbstractPomTransformer.java	11 Feb 2003 03:25:49 -0000	1.6
  @@ -72,6 +72,7 @@
   import java.util.Iterator;
   import java.util.Properties;
   import java.util.ArrayList;
  +import java.util.Map;
   
   /**
    * This is the base class for any tool that attempts to transform fields
  @@ -98,12 +99,12 @@
       private File outputFile;
   
       /** Properties used in transformNode */
  -    private Properties properties;
  +    private Map variables;
   
       /** Nodes selected for transformation using xpath. */
       private List selectedNodes;
   
  -    private List transformations = new ArrayList();
  +    private List transformations;
   
       // -------------------------------------------------------------------------
       // Accessors
  @@ -113,18 +114,18 @@
        *
        * @return
        */
  -    public Properties getProperties()
  +    public Map getVariables()
       {
  -        return properties;
  +        return variables;
       }
   
       /**
        *
  -     * @param properties
  +     * @param variables
        */
  -    public void setProperties( Properties properties )
  +    public void setVariables( Map variables )
       {
  -        this.properties = properties;
  +        this.variables = variables;
       }
   
       /**
  @@ -238,6 +239,8 @@
        */
       public void createTransformations()
       {
  +        transformations = new ArrayList();
  +
           for ( Iterator i = getSelectedNodes().iterator(); i.hasNext(); )
           {
               Object o = i.next();
  
  
  
  1.6       +15 -6     jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/SnapshotResolver.java
  
  Index: SnapshotResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/SnapshotResolver.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SnapshotResolver.java	11 Feb 2003 00:56:36 -0000	1.5
  +++ SnapshotResolver.java	11 Feb 2003 03:25:49 -0000	1.6
  @@ -114,8 +114,16 @@
           // Now we need to attempt to find the the actual timestamp
           // version for this dependency.
   
  -        String url = getProperties().getProperty( MavenConstants.REPO_REMOTE ) + "/" +
  +        // Variables are being stored as ConstantExpressions ...
  +
  +        /*
  +        String url = getVariables().get( MavenConstants.REPO_REMOTE ) + "/" +
               groupId + "/jars/" + artifactId + "-snapshot-version";
  +        */
  +
  +        String url = "http://www.ibiblio.org/maven/" + groupId + "/jars/" + artifactId + "-snapshot-version";
  +
  +        System.out.println( "url: " + url );
   
           File snapshotVersionFile = new File( artifactId + "-snapshot-version" );
   
  @@ -125,16 +133,17 @@
                                  snapshotVersionFile,
                                  true, // ignore errors
                                  false, // use timestamps
  -                               getProperties().getProperty( MavenConstants.PROXY_HOST ), // proxy host
  -                               getProperties().getProperty( MavenConstants.PROXY_PORT ), // proxy port
  -                               getProperties().getProperty( MavenConstants.PROXY_USERNAME ), // proxy user name
  -                               getProperties().getProperty( MavenConstants.PROXY_PASSWORD ) // proxy password
  +                               (String) getVariables().get( MavenConstants.PROXY_HOST ), // proxy host
  +                               (String) getVariables().get( MavenConstants.PROXY_PORT ), // proxy port
  +                               (String) getVariables().get( MavenConstants.PROXY_USERNAME ), // proxy user name
  +                               (String) getVariables().get( MavenConstants.PROXY_PASSWORD ) // proxy password
               );
           }
           catch ( Exception e )
           {
               // Either doesn't exist, or we have a network problem. In
               // either event we can't update the version field.
  +            System.out.println( "Can't retrieve snapshot version file: " + e.getLocalizedMessage() );
           }
   
           if ( snapshotVersionFile.exists() )
  
  
  
  1.2       +2 -1      jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/jelly/ResolveSnapshotsTag.java
  
  Index: ResolveSnapshotsTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/release/src/main/org/apache/maven/release/jelly/ResolveSnapshotsTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResolveSnapshotsTag.java	11 Feb 2003 02:40:41 -0000	1.1
  +++ ResolveSnapshotsTag.java	11 Feb 2003 03:25:49 -0000	1.2
  @@ -63,7 +63,7 @@
   import org.apache.maven.project.Project;
   import org.apache.maven.MavenConstants;
   
  -public abstract class ResolveSnapshotsTag
  +public class ResolveSnapshotsTag
       extends TagSupport
   {
       private SnapshotResolver snapshotResolver;
  @@ -99,6 +99,7 @@
   
           snapshotResolver = new SnapshotResolver();
           snapshotResolver.setProject( project.getFile() );
  +        snapshotResolver.setVariables( project.getContext().getVariables() );
   
           context.setVariable( getTransformer(), snapshotResolver );
           context.setVariable( getTransformations(), snapshotResolver.getTransformations() );