dion        2003/08/05 08:05:57

  Modified:    src/java/org/apache/maven/project Repository.java
               src/java/org/apache/maven DefaultProjectUnmarshaller.java
                        DefaultProjectMarshaller.java
  Log:
  Fixes for MAVEN-595
  
  Revision  Changes    Path
  1.14      +83 -1     maven/src/java/org/apache/maven/project/Repository.java
  
  Index: Repository.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Repository.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Repository.java   12 Apr 2003 00:02:03 -0000      1.13
  +++ Repository.java   5 Aug 2003 15:05:57 -0000       1.14
  @@ -78,6 +78,9 @@
       /** Connection URL. */
       private String connection;
   
  +    /** Developer connection URL. */
  +    private String developerConnection;
  +
       /** Web URL. */
       private String url;
   
  @@ -92,6 +95,16 @@
       }
   
       /**
  +     * Sets the connection attribute of the Repository object
  +     *
  +     * @param connection Developer connection URL.
  +     */
  +    public void setDeveloperConnection( String developerConnection )
  +    {
  +        this.developerConnection = developerConnection;
  +    }
  +
  +    /**
        * Gets the connection attribute of the Repository object
        *
        * @return Connection URL.
  @@ -102,6 +115,16 @@
       }
   
       /**
  +     * Gets the connection attribute of the Repository object
  +     *
  +     * @return Connection URL.
  +     */
  +    public String getDeveloperConnection()
  +    {
  +        return developerConnection;
  +    }
  +
  +    /**
        * Sets the url attribute of the Repository object
        *
        * @param url Web URL.
  @@ -151,6 +174,65 @@
           return null;
       }
       
  +    /**
  +     * Get cvs server.
  +     *
  +     * Used in xdocs/src/plugin-resources/templates/cvs-usage.xml
  +     *
  +     * @param conn six token connection string
  +     * @return CVS module.
  +     */
  +    public String getCvsServer(String conn)
  +    {
  +        String[] tokens = splitSCMConnection(conn);
  +        if(tokens[3].indexOf('@') >= 0)
  +        {
  +            return tokens[3].substring(tokens[3].indexOf('@')+1);
  +        }
  +        else
  +        {
  +            return tokens[3];
  +        }
  +    }
  +
  +    /**
  +     * Get cvs root.
  +     *
  +     * Used in xdocs/src/plugin-resources/templates/cvs-usage.xml
  +     *
  +     * @param conn six token connection string
  +     * @param username username override if non-empty.
  +     * @return CVS root.
  +     */
  +    public String getCvsRoot(String conn, String username)
  +    {
  +        String[] tokens = splitSCMConnection(conn);
  +        if(tokens[3].indexOf('@') >= 0)
  +        {
  +            if (username.length() == 0)
  +            {
  +                username = tokens[3].substring(0, tokens[3].indexOf('@'));
  +            }
  +            tokens[3] = username + "@" + tokens[3].substring(tokens[3].indexOf('@') 
+ 1);
  +        }
  +        String result = tokens[2] + ":" + tokens[3] + ":" + tokens[4];
  +        return result;
  +    }
  +  
  +    /**
  +     * Get cvs module.
  +     *
  +     * Used in xdocs/src/plugin-resources/templates/cvs-usage.xml
  +     *
  +     * @param conn six token connection string
  +     * @return CVS module.
  +     */
  +    public String getCvsModule(String conn)
  +    {
  +        String[] tokens = splitSCMConnection(conn);
  +        return tokens[5];
  +    }    
  +     
      
       /**
        * Splits an SCM string into parts 
  
  
  
  1.7       +57 -3     maven/src/java/org/apache/maven/DefaultProjectUnmarshaller.java
  
  Index: DefaultProjectUnmarshaller.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/DefaultProjectUnmarshaller.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultProjectUnmarshaller.java   29 Jul 2003 01:09:37 -0000      1.6
  +++ DefaultProjectUnmarshaller.java   5 Aug 2003 15:05:57 -0000       1.7
  @@ -1,5 +1,61 @@
   package org.apache.maven;
   
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * ====================================================================
  + */
  +
   import org.apache.maven.project.Build;
   import org.apache.maven.project.Branch;
   import org.apache.maven.project.Contributor;
  @@ -148,12 +204,10 @@
                           {
                               project.getRepository().setConnection( 
parser.nextText() );
                           }
  -                        /*
                           else if ( parser.getName().equals( "developerConnection" ) )
                           {
                               project.getRepository().setDeveloperConnection( 
parser.nextText() );
                           }
  -                        */
                           else if ( parser.getName().equals( "url" ) )
                           {
                               project.getRepository().setUrl( parser.nextText() );
  
  
  
  1.6       +57 -2     maven/src/java/org/apache/maven/DefaultProjectMarshaller.java
  
  Index: DefaultProjectMarshaller.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/DefaultProjectMarshaller.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultProjectMarshaller.java     28 Jul 2003 04:43:34 -0000      1.5
  +++ DefaultProjectMarshaller.java     5 Aug 2003 15:05:57 -0000       1.6
  @@ -1,5 +1,61 @@
   package org.apache.maven;
   
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * ====================================================================
  + */
  +
   import org.apache.maven.project.Build;
   import org.apache.maven.project.Branch;
   import org.apache.maven.project.Contributor;
  @@ -147,8 +203,7 @@
               serializer.startTag( NAMESPACE, "repository" );
   
               marshallRequiredString( project.getRepository().getConnection(), 
"connection" );
  -            //!!!
  -            //marshallString(project.getRepository().getDeveloperConnection(), 
"developerConnection");
  +            marshallString(project.getRepository().getDeveloperConnection(), 
"developerConnection");
               marshallString( project.getRepository().getUrl(), "url" );
   
               serializer.endTag( NAMESPACE, "repository" );
  
  
  

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

Reply via email to