maven-scm-1.3/0000755000175000017500000000000011345536673013216 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/0000755000175000017500000000000011345536663016676 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/0000755000175000017500000000000011345536663023512 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/0000755000175000017500000000000011345536663024301 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/site/0000755000175000017500000000000011345536663025245 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/site/site.xml0000644000175000017500000000212511051127665026723 0ustar twernertwerner maven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/0000755000175000017500000000000011345536663025225 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/0000755000175000017500000000000011345536663026146 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/0000755000175000017500000000000011345536663026735 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/0000755000175000017500000000000011345536663030156 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/0000755000175000017500000000000011345536663031264 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536663032046 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager/maven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager0000755000175000017500000000000011345536663033401 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager/plexus/maven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager0000755000175000017500000000000011345536663033401 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager/plexus/DefaultScmManager.javamaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager0000644000175000017500000000657711057610744033413 0ustar twernertwernerpackage org.apache.maven.scm.manager.plexus; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.manager.AbstractScmManager; import org.codehaus.plexus.logging.LogEnabled; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import java.util.HashMap; import java.util.Map; /** * @author Trygve Laugstøl * @author Brett Porter * @author Emmanuel Venisse * @version $Id: DefaultScmManager.java 691810 2008-09-03 22:38:28Z vsiveton $ * @plexus.component role="org.apache.maven.scm.manager.ScmManager" */ public class DefaultScmManager extends AbstractScmManager implements Initializable, LogEnabled { /** * @plexus.requirement role="org.apache.maven.scm.provider.ScmProvider" */ private Map scmProviders; private Logger logger; // ---------------------------------------------------------------------- // LogEnabled implementation // ---------------------------------------------------------------------- public void enableLogging( Logger logger ) { this.logger = logger; } protected Logger getLogger() { return logger; } protected void setupLogger( Object component ) { setupLogger( component, logger ); } protected void setupLogger( Object component, String subCategory ) { if ( subCategory == null ) { throw new IllegalStateException( "Logging category must be defined." ); } Logger logger = this.logger.getChildLogger( subCategory ); setupLogger( component, logger ); } protected void setupLogger( Object component, Logger logger ) { if ( component instanceof LogEnabled ) { ( (LogEnabled) component ).enableLogging( logger ); } } // ---------------------------------------------------------------------- // Component Lifecycle // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void initialize() { if ( scmProviders == null ) { scmProviders = new HashMap(); } if ( getLogger().isWarnEnabled() && scmProviders.size() == 0 ) { getLogger().warn( "No SCM providers configured." ); } setScmProviders( scmProviders ); } /** {@inheritDoc} */ protected ScmLogger getScmLogger() { return new PlexusLogger( getLogger() ); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager/plexus/PlexusLogger.javamaven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager0000644000175000017500000000610111050560546033367 0ustar twernertwernerpackage org.apache.maven.scm.manager.plexus; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.logging.Logger; /** * @author Emmanuel Venisse * @version $Id: PlexusLogger.java 685541 2008-08-13 13:28:06Z vsiveton $ */ public class PlexusLogger implements ScmLogger { private Logger logger; public PlexusLogger( Logger logger ) { this.logger = logger; } /** {@inheritDoc} */ public boolean isDebugEnabled() { return logger.isDebugEnabled(); } /** {@inheritDoc} */ public void debug( String content ) { logger.debug( content ); } /** {@inheritDoc} */ public void debug( String content, Throwable error ) { logger.debug( content, error ); } /** {@inheritDoc} */ public void debug( Throwable error ) { logger.debug( "", error ); } /** {@inheritDoc} */ public boolean isInfoEnabled() { return logger.isInfoEnabled(); } /** {@inheritDoc} */ public void info( String content ) { logger.info( content ); } /** {@inheritDoc} */ public void info( String content, Throwable error ) { logger.info( content, error ); } /** {@inheritDoc} */ public void info( Throwable error ) { logger.info( "", error ); } /** {@inheritDoc} */ public boolean isWarnEnabled() { return logger.isWarnEnabled(); } /** {@inheritDoc} */ public void warn( String content ) { logger.warn( content ); } /** {@inheritDoc} */ public void warn( String content, Throwable error ) { logger.warn( content, error ); } /** {@inheritDoc} */ public void warn( Throwable error ) { logger.warn( "", error ); } /** {@inheritDoc} */ public boolean isErrorEnabled() { return logger.isErrorEnabled(); } /** {@inheritDoc} */ public void error( String content ) { logger.error( content ); } /** {@inheritDoc} */ public void error( String content, Throwable error ) { logger.error( content, error ); } /** {@inheritDoc} */ public void error( Throwable error ) { logger.error( "", error ); } } maven-scm-1.3/maven-scm-managers/maven-scm-manager-plexus/pom.xml0000644000175000017500000000401311322611461025006 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-managers 1.3 maven-scm-manager-plexus Maven SCM Manager for Plexus SCM Plexus component. org.codehaus.plexus plexus-container-default org.apache.maven.scm maven-scm-api org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-managers/src/0000755000175000017500000000000011345536663017465 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/src/site/0000755000175000017500000000000011345536663020431 5ustar twernertwernermaven-scm-1.3/maven-scm-managers/src/site/site.xml0000644000175000017500000000215311051127665022110 0ustar twernertwerner maven-scm-1.3/maven-scm-managers/pom.xml0000644000175000017500000000272111322611461020176 0ustar twernertwerner 4.0.0 maven-scm org.apache.maven.scm 1.3 maven-scm-managers pom Maven SCM Managers Parent for SCM Managers. maven-scm-manager-plexus maven-scm-1.3/maven-scm-plugin/0000755000175000017500000000000011345536672016377 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/0000755000175000017500000000000011345536672017166 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/0000755000175000017500000000000011345536672020132 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/resources/0000755000175000017500000000000011345536672022144 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/resources/css/0000755000175000017500000000000011345536672022734 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/resources/css/site.css0000644000175000017500000000306610535556312024410 0ustar twernertwerner/* * 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. */ a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { background: none; padding-right: 0; } /* body ul { list-style-type: square; } */ #downloadbox { float: right; margin: 0 10px 20px 20px; padding: 5px; border: 1px solid #999; background-color: #eee; } #downloadbox h5 { color: #000; margin: 0; border-bottom: 1px solid #aaaaaa; font-size: smaller; padding: 0; } #downloadbox p { margin-top: 1em; margin-bottom: 0; } #downloadbox ul { margin-top: 0; margin-bottom: 1em; list-style-type: disc; } #downloadbox li { font-size: smaller; } /* h4 { padding: 0; border: none; color: #000; margin: 0; font-size: larger; font-weight: bold; } */ maven-scm-1.3/maven-scm-plugin/src/site/site.xml0000644000175000017500000000356011237302500021601 0ustar twernertwerner maven-scm-1.3/maven-scm-plugin/src/site/apt/0000755000175000017500000000000011345536672020716 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/apt/examples/0000755000175000017500000000000011345536672022534 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/site/apt/examples/scm-advance-features.apt.vm0000644000175000017500000001176411237266723027666 0ustar twernertwerner ------ Other SCM Commands ------ Pete Marvin King ------ 2008-08-13 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Other SCM Commands The scm plugin requires the scm to be configured in the <<>>. +---------+ ... jar 1.0-SNAPSHOT SCM Sample Project http://somecompany.com scm:svn:http://somerepository.com/svn_repo/trunk scm:svn:https://somerepository.com/svn_repo/trunk http://somerepository.com/view.cvs ... +---------+ If you want to change the default scm provider implementation, for exemple you want to use the native cvs instead of the pure java implementation, you must configure your plugin like that: +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} cvs_native ... ... +-----------+ Once the scm has been configured, scm operations can be performed. * changelog - displays the project commit changes for each revisions <<>> configuration : +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} YYYY-MM-DD YYYY-MM-DD ... ... +-----------+ Command : +---------+ mvn scm:changelog +---------+ or you can specify the startDate and endDate on the commandline +---------+ mvn -DstartDate=YYYY-MM-DD -DendDate=YYYY-MM-DD scm:changelog +---------+ * diff <<>> configuration : +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} connection connection ... ... +-----------+ Command : +---------+ mvn scm:diff +---------+ or you can specify the startRevision and endRevision in the command line +---------+ mvn -DstartRevision= -DendRevision= scm:diff +---------+ * edit - set the edit status of the file, locking the project sources if supported. Command : +---------+ mvn scm:edit +---------+ * status - displays the modified files in the project. Command : +---------+ mvn scm:status +---------+ * tag <<>> configuration : +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} tag name ... ... +-----------+ Command : +---------+ mvn scm:tag +---------+ or you can specify the tag name in the command line +---------+ mvn -Dtag="" scm:tag +---------+ * unedit - unset the edit status of the project sources and unlocking it if supported. Command : +---------+ mvn scm:unedit +---------+ * validate - check if the scm urls configured in the <<>> is valid. Command : +---------+ mvn scm:validate +---------+ or passing the scmConnection or/and the developerConnection in the command line +---------+ mvn -DscmConnection="" -DscmDeveloperConnection="" scm:validate +---------+ maven-scm-1.3/maven-scm-plugin/src/site/apt/examples/bootstrapping-with-pom.apt.vm0000644000175000017500000000624111237266723030320 0ustar twernertwerner ------ Bootstrapping a Project Using a POM ------ Pete Marvin King ------ 2008-08-13 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Bootstrapping a Project Using a POM Using the <<>> a project can be build from a fresh copy of the source in the scm repository. This is a convenient way to distribute a project because the bootstrap pom can be given to a developer to generate the maven build environment for the project. The <<>> should contain a scm configuration for the bootstrap to work. +-----------+ ... jar 1.0-SNAPSHOT SCM Sample Project http://somecompany.com scm:svn:http://somerepository.com/svn_repo/trunk scm:svn:https://somerepository.com/svn_repo/trunk http://somerepository.com/view.cvs ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} install ... ... +-----------+ Assuming the scm configuration has been configured in the <<>>, bootstrapping can be invoked by +---------+ mvn scm:bootstrap +---------+ By default the scm plugin will get the latest version from the trunk and generate it under <<>> and execute the configured goals in it. Configuring Authentication Most public repositories requires developers to authenticate first before they can pull the source from the repository. For repository requiring authentication, the scm plugin needs to be configured in the <<>> * specifying the username and password for svn and starteam +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} username password ... ... +-----------+ maven-scm-1.3/maven-scm-plugin/src/site/apt/usage.apt.vm0000644000175000017500000001007011237266723023144 0ustar twernertwerner ------ Usage ------ Pete Marvin King ------ 2008-08-13 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage The SCM Plugin maps a lot of commands to a variety of scm implementations. But there are only 2 frequently used commands: * checkin - commit the changes to the remote repository ( scm server ). * update - updates the local working copy with the one from the remote repository ( scm server ). [] Configuring SCM Each scm has a different command line invocation to commit the modified sources. Using maven this process is simplified by providing a uniform way to do this by letting maven handle the command line translation to perform the scm task. To configure the scm support for maven you need the scm configuration in your <<>>. +---------+ ... jar 1.0-SNAPSHOT SCM Sample Project http://somecompany.com scm:svn:http://somerepository.com/svn_repo/trunk scm:svn:https://somerepository.com/svn_repo/trunk http://somerepository.com/view.cvs ... +---------+ Maven will use the information embedded in the scm configuration to determine the command mapping for the scm command. The scm configuration url is composed of different information that defines the mapping: +------+ scm:svn:http://somerepository.com/svn_repo/trunk :: +------+ Check the {{{http://maven.apache.org/scm/scms-overview.html}maven scm list}} for the list of supported SCMs. Committing and updating changes through Maven Assuming that SCM has been configured in the <<>> and the project directory is managed by a SCM, invoking the checkin goal in the scm will start the commit process for all configured sources in your <<>>. <> +-----+ mvn -Dmessage="" scm:checkin +-----+ for update +-----+ mvn scm:update +-----+ Specifying the scm connection to use There two possible scm connections that can be used in the <<>>, connection and developerConnection. * connection configuration +-----------+ ... [...] org.apache.maven.plugins maven-scm-plugin ${project.version} connection ... ... +-----------+ * developerConnection configuration +-----------+ ... ... org.apache.maven.plugins maven-scm-plugin ${project.version} developerConnection ... ... +-----------+ Related Links * {{{http://docs.codehaus.org/display/SCM/SCM+Matrix}SCM Plugin Matrix}} [] maven-scm-1.3/maven-scm-plugin/src/site/apt/index.apt0000644000175000017500000001043211237302500022510 0ustar twernertwerner ------ Introduction ------ Pete Marvin King ------ 2008-08-13 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven SCM Plugin The SCM Plugin offers vendor independent access to common scm commands by offering a set of command mappings for the configured scm. Each command is implemented as a goal. * Goals Overview The SCM Plugin has 16 goals: * {{{./branch-mojo.html}scm:branch}} - branch the project * {{{./validate-mojo.html}scm:validate}} - validate the scm information in the pom * {{{./add-mojo.html}scm:add}} - command to add file * {{{./unedit-mojo.html}scm:unedit}} - command to stop editing the working copy * {{{./export-mojo.html}scm:export}} - command to get a fresh exported copy * {{{./bootstrap-mojo.html}scm:bootstrap}} - command to checkout and build a project * {{{./changelog-mojo.html}scm:changelog}} - command to show the source code revisions * {{{./list-mojo.html}scm:list}} - command for get the list of project files * {{{./checkin-mojo.html}scm:checkin}} - command for commiting changes * {{{./checkout-mojo.html}scm:checkout}} - command for getting the source code * {{{./status-mojo.html}scm:status}} - command for showing the scm status of the working copy * {{{./update-mojo.html}scm:update}} - command for updating the working copy with the latest changes * {{{./diff-mojo.html}scm:diff}} - command for showing the difference of the working copy with the remote one * {{{./update-subprojects-mojo.html}scm:update-subprojects}} - command for updating all projects in a multi project build * {{{./edit-mojo.html}scm:edit}} - command for starting edit on the working copy * {{{./tag-mojo.html}scm:tag}} - command for tagging a certain revision [] * Usage General instructions on how to use the SCM Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/SCM+Plugin}plugin's wiki page}}. In case you still have questions regarding the plugin's usage, please feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples To provide you with better understanding on some usages of the Maven SCM Plugin, you can take a look into the following examples: * {{{./examples/bootstrapping-with-pom.html}Bootstrapping using a POM file}} * {{{./examples/scm-advance-features.html}Other advanced scm commands}} [] maven-scm-1.3/maven-scm-plugin/src/test/0000755000175000017500000000000011345536672020145 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/0000755000175000017500000000000011345536672022157 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/0000755000175000017500000000000011345536672023306 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/validate/0000755000175000017500000000000011345536672025077 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml0000644000175000017500000000237310535556312033064 0ustar twernertwerner maven-scm-plugin scm:unknwonProvider:http://svn.apache.org/repos/asf/maven/scm/trunk scm:unknownProvider:https://svn.apache.org/repos/asf/maven/scm/trunk maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml0000644000175000017500000000200310535556312032110 0ustar twernertwerner maven-scm-plugin maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml0000644000175000017500000000247110535556312032534 0ustar twernertwerner maven-scm-plugin scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk scm:svn:https://svn.apache.org/repos/asf/maven/scm/trunk maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/branch/0000755000175000017500000000000011345536672024543 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/branch/checkout.xml0000644000175000017500000000260710606724727027076 0ustar twernertwerner maven-scm-plugin target/branches/mybranch connection scm:svn:file:///${basedir}/target/repository/trunk branch mybranch maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/branch/branch.xml0000644000175000017500000000240310606724727026520 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository/trunk connection mybranch maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/update/0000755000175000017500000000000011345536672024570 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml0000644000175000017500000000265510535556312032134 0ustar twernertwerner maven-scm-plugin connection scm:svn:file:///${basedir}/target/repository/trunk target/checkout scm.revision maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/0000755000175000017500000000000011345536672025113 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml0000644000175000017500000000210410535556312033517 0ustar twernertwerner maven-scm-plugin target/checkout maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml0000644000175000017500000000244010535556312032772 0ustar twernertwerner maven-scm-plugin target/checkout connection scm:svn:file:///${basedir}/target/repository/trunk maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutUsingExport.xml0000644000175000017500000000250611132454173031642 0ustar twernertwerner maven-scm-plugin target/checkout connection true scm:svn:file:///${basedir}/target/repository/trunk ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xmlmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExists0000644000175000017500000000234110535556312034231 0ustar twernertwerner maven-scm-plugin target/checkout scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk true maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/status/0000755000175000017500000000000011345536672024631 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/status/status.xml0000644000175000017500000000233710535556312026674 0ustar twernertwerner maven-scm-plugin connection scm:svn:file:///${basedir}/target/repository/trunk maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/export/0000755000175000017500000000000011345536672024627 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/export/exportWhenExportDirectoryExistsAndSkip.xmlmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/export/exportWhenExportDirectoryExistsAndSki0000644000175000017500000000232711132343520034260 0ustar twernertwerner maven-scm-plugin target/export scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk true maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/export/export.xml0000644000175000017500000000243211132335440026653 0ustar twernertwerner maven-scm-plugin target/export connection scm:svn:file:///${basedir}/target/repository/trunk maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/tag/0000755000175000017500000000000011345536672024061 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/tag/checkout.xml0000644000175000017500000000257210604260544026403 0ustar twernertwerner maven-scm-plugin target/tags/mytag connection scm:svn:file:///${basedir}/target/repository/trunk tag mytag maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/tag/tagWithTimestamp.xml0000644000175000017500000000262110535556312030070 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository/trunk connection mytag yyyyMMddHHmmss - true maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/tag/tag.xml0000644000175000017500000000237210535556312025353 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository/trunk connection mytag maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/0000755000175000017500000000000011345536672025235 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xmlmaven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml0000644000175000017500000000254510535556312033756 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository connection aabbccddeeffgg 2004-11-04 yyyyMMdd maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml0000644000175000017500000000232210535556312033644 0ustar twernertwerner maven-scm-plugin scm:svn:http://a.bad.host/repos/trunk connection maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/changelogWithParameters.xml0000644000175000017500000000245510535556312032565 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository connection 2004-11-01 2004-11-04 maven-scm-1.3/maven-scm-plugin/src/test/resources/mojos/changelog/changelog.xml0000644000175000017500000000233110535556312027676 0ustar twernertwerner maven-scm-plugin scm:svn:file:///${basedir}/target/repository connection maven-scm-1.3/maven-scm-plugin/src/test/java/0000755000175000017500000000000011345536672021066 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/0000755000175000017500000000000011345536672021655 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/0000755000175000017500000000000011345536672023076 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/0000755000175000017500000000000011345536672024204 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536672024766 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/0000755000175000017500000000000011345536672026264 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java0000644000175000017500000000341411053246641032067 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: StatusMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class StatusMojoTest extends AbstractMojoTestCase { public void testStatusMojo() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } StatusMojo mojo = (StatusMojo) lookupMojo( "status", getTestFile( "src/test/resources/mojos/status/status.xml" ) ); mojo.setWorkingDirectory( new File( getBasedir() ) ); mojo.execute(); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java0000644000175000017500000000570011053246641032026 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: UpdateMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class UpdateMojoTest extends AbstractMojoTestCase { File checkoutDir; File repository; protected void setUp() throws Exception { super.setUp(); checkoutDir = getTestFile( "target/checkout" ); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( checkoutDir ); } public void testSkipCheckoutWithConnectionUrl() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } SvnScmTestUtils.initializeRepository( repository ); CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) ); String connectionUrl = checkoutMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); checkoutMojo.setConnectionUrl( connectionUrl ); checkoutMojo.execute(); UpdateMojo updateMojo = (UpdateMojo) lookupMojo( "update", getTestFile( "src/test/resources/mojos/update/updateWithConnectionUrl.xml" ) ); connectionUrl = updateMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); updateMojo.setConnectionUrl( connectionUrl ); updateMojo.execute(); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java0000644000175000017500000000773611132454173032363 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: CheckoutMojoTest.java 733515 2009-01-11 20:37:15Z dantran $ */ public class CheckoutMojoTest extends AbstractMojoTestCase { File checkoutDir; File repository; protected void setUp() throws Exception { super.setUp(); checkoutDir = getTestFile( "target/checkout" ); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( checkoutDir ); } public void testSkipCheckoutWhenCheckoutDirectoryExistsAndSkip() throws Exception { checkoutDir.mkdirs(); CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml" ) ); mojo.setCheckoutDirectory( checkoutDir ); mojo.execute(); assertEquals( 0, checkoutDir.listFiles().length ); } public void testSkipCheckoutWithConnectionUrl() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } SvnScmTestUtils.initializeRepository( repository ); CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) ); mojo.setWorkingDirectory( new File( getBasedir() ) ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.setCheckoutDirectory( checkoutDir ); mojo.execute(); } public void testSkipCheckoutWithoutConnectionUrl() throws Exception { CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml" ) ); try { mojo.execute(); fail( "mojo execution must fail." ); } catch ( MojoExecutionException e ) { assertTrue( true ); } } public void testUseExport() throws Exception { checkoutDir.mkdirs(); CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutUsingExport.xml" ) ); mojo.setCheckoutDirectory( checkoutDir ); mojo.execute(); assertTrue( checkoutDir.listFiles().length > 0 ); assertFalse( new File( checkoutDir, ".svn" ).exists() ); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java0000644000175000017500000000417710535556312032347 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; /** * @author Emmanuel Venisse * @version $Id: ValidateMojoTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ValidateMojoTest extends AbstractMojoTestCase { public void testValidateWithoutScmUrl() throws Exception { ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile( "src/test/resources/mojos/validate/validateWithoutScmUrl.xml" ) ); mojo.execute(); } public void testValidateWithValidScmUrls() throws Exception { ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile( "src/test/resources/mojos/validate/validateWithValidScmUrls.xml" ) ); mojo.execute(); } public void testValidateWithInvalidScmUrls() throws Exception { ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile( "src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml" ) ); try { mojo.execute(); fail( "mojo execution must fail." ); } catch ( MojoExecutionException e ) { assertTrue( true ); } } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ExportMojoTest.java0000644000175000017500000000443511132343520032061 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import java.io.File; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; /** * @version $Id: ExportMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class ExportMojoTest extends AbstractMojoTestCase { File exportDir; File repository; protected void setUp() throws Exception { super.setUp(); exportDir = getTestFile( "target/export" ); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( exportDir ); } public void testExport() throws Exception { SvnScmTestUtils.initializeRepository( repository ); ExportMojo mojo = (ExportMojo) lookupMojo( "export", getTestFile( "src/test/resources/mojos/export/export.xml" ) ); mojo.setExportDirectory( exportDir.getAbsoluteFile() ); mojo.execute(); assertTrue( exportDir.listFiles().length > 0 ); assertFalse( new File( exportDir, ".svn" ).exists() ); } public void testSkipExportIfExists() throws Exception { exportDir.mkdirs(); ExportMojo mojo = (ExportMojo) lookupMojo( "export", getTestFile( "src/test/resources/mojos/export/exportWhenExportDirectoryExistsAndSkip.xml" ) ); mojo.setExportDirectory( exportDir ); mojo.execute(); assertEquals( 0, exportDir.listFiles().length ); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java0000644000175000017500000001242611053246641031322 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: TagMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class TagMojoTest extends AbstractMojoTestCase { File checkoutDir; File repository; protected void setUp() throws Exception { super.setUp(); checkoutDir = getTestFile( "target/checkout" ); FileUtils.forceDelete( checkoutDir ); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( repository ); if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored setUp." ); return; } SvnScmTestUtils.initializeRepository( repository ); CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) ); checkoutMojo.setWorkingDirectory( new File( getBasedir() ) ); String connectionUrl = checkoutMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); checkoutMojo.setConnectionUrl( connectionUrl ); checkoutMojo.setCheckoutDirectory( checkoutDir ); checkoutMojo.execute(); } public void testTag() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } TagMojo mojo = (TagMojo) lookupMojo( "tag", getTestFile( "src/test/resources/mojos/tag/tag.xml" ) ); mojo.setWorkingDirectory( checkoutDir ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.execute(); if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/tag/checkout.xml" ) ); checkoutMojo.setWorkingDirectory( new File( getBasedir() ) ); connectionUrl = checkoutMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); checkoutMojo.setConnectionUrl( connectionUrl ); File tagCheckoutDir = getTestFile( "target/tags/mytag" ); if ( tagCheckoutDir.exists() ) { FileUtils.deleteDirectory( tagCheckoutDir ); } checkoutMojo.setCheckoutDirectory( tagCheckoutDir ); assertFalse( new File( tagCheckoutDir, "pom.xml" ).exists() ); checkoutMojo.execute(); assertTrue( new File( tagCheckoutDir, "pom.xml" ).exists() ); } public void testTagWithTimestamp() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } TagMojo mojo = (TagMojo) lookupMojo( "tag", getTestFile( "src/test/resources/mojos/tag/tagWithTimestamp.xml" ) ); mojo.setWorkingDirectory( checkoutDir ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.execute(); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BranchMojoTest.java0000644000175000017500000001042111053246641031775 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: BranchMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class BranchMojoTest extends AbstractMojoTestCase { File checkoutDir; File repository; protected void setUp() throws Exception { super.setUp(); checkoutDir = getTestFile( "target/checkout" ); FileUtils.forceDelete( checkoutDir ); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( repository ); if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored setUp." ); return; } SvnScmTestUtils.initializeRepository( repository ); CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) ); checkoutMojo.setWorkingDirectory( new File( getBasedir() ) ); String connectionUrl = checkoutMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); checkoutMojo.setConnectionUrl( connectionUrl ); checkoutMojo.setCheckoutDirectory( checkoutDir ); checkoutMojo.execute(); } public void testBranch() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } BranchMojo mojo = (BranchMojo) lookupMojo( "branch", getTestFile( "src/test/resources/mojos/branch/branch.xml" ) ); mojo.setWorkingDirectory( checkoutDir ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.execute(); CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile( "src/test/resources/mojos/branch/checkout.xml" ) ); checkoutMojo.setWorkingDirectory( new File( getBasedir() ) ); connectionUrl = checkoutMojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); checkoutMojo.setConnectionUrl( connectionUrl ); File branchCheckoutDir = getTestFile( "target/branches/mybranch" ); if ( branchCheckoutDir.exists() ) { FileUtils.deleteDirectory( branchCheckoutDir ); } checkoutMojo.setCheckoutDirectory( branchCheckoutDir ); assertFalse( new File( branchCheckoutDir, "pom.xml" ).exists() ); checkoutMojo.execute(); assertTrue( new File( branchCheckoutDir, "pom.xml" ).exists() ); } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ChangeLogMojoTest.java0000644000175000017500000001246611053246641032442 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: ChangeLogMojoTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class ChangeLogMojoTest extends AbstractMojoTestCase { File repository; protected void setUp() throws Exception { super.setUp(); repository = getTestFile( "target/repository" ); FileUtils.forceDelete( repository ); if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVNADMIN_COMMAND_LINE + "' is not a system command. Ignored setUp." ); return; } SvnScmTestUtils.initializeRepository( repository ); } public void testChangeLog() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo( "changelog", getTestFile( "src/test/resources/mojos/changelog/changelog.xml" ) ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.setWorkingDirectory( new File( getBasedir() ) ); mojo.setConnectionType( "connection" ); mojo.execute(); } public void testChangeLogWithParameters() throws Exception { if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVN_COMMAND_LINE ) ) { System.err.println( "'" + SvnScmTestUtils.SVN_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo( "changelog", getTestFile( "src/test/resources/mojos/changelog/changelogWithParameters.xml" ) ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.setWorkingDirectory( new File( getBasedir() ) ); mojo.setConnectionType( "connection" ); mojo.execute(); } public void testChangeLogWithBadUserDateFormat() throws Exception { ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo( "changelog", getTestFile( "src/test/resources/mojos/changelog/changelogWithBadUserDateFormat.xml" ) ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.setWorkingDirectory( new File( getBasedir() ) ); mojo.setConnectionType( "connection" ); try { mojo.execute(); fail( "mojo execution must fail." ); } catch ( MojoExecutionException e ) { assertTrue( true ); } } public void testChangeLogWithBadConnectionUrl() throws Exception { ChangeLogMojo mojo = (ChangeLogMojo) lookupMojo( "changelog", getTestFile( "src/test/resources/mojos/changelog/changelogWithBadConnectionUrl.xml" ) ); String connectionUrl = mojo.getConnectionUrl(); connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() ); connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" ); mojo.setConnectionUrl( connectionUrl ); mojo.setWorkingDirectory( new File( getBasedir() ) ); mojo.setConnectionType( "connection" ); try { mojo.execute(); fail( "mojo execution must fail." ); } catch ( MojoExecutionException e ) { assertTrue( true ); } } } maven-scm-1.3/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/BootstrapMojoTest.java0000644000175000017500000000711110600210446032546 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.codehaus.plexus.util.FileUtils; import java.io.File; /** * Unit Test for BootstrapMojo * * @author Arne Degenring * @version $Id: BootstrapMojoTest.java 520837 2007-03-21 11:04:06Z evenisse $ */ public class BootstrapMojoTest extends AbstractMojoTestCase { File checkoutDir; File projectDir; File goalDir; BootstrapMojo bootstrapMojo; protected void setUp() throws Exception { super.setUp(); checkoutDir = getTestFile( "target/checkout" ); FileUtils.forceDelete( checkoutDir ); checkoutDir.mkdirs(); projectDir = getTestFile( "target/checkout/my/project" ); projectDir.mkdirs(); goalDir = getTestFile( "target/checkout/my/project/modules/1" ); goalDir.mkdirs(); bootstrapMojo = new BootstrapMojo(); } public void testDetermineWorkingDirectoryPath() throws Exception { // only checkout dir assertEquals( checkoutDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "", "" ) ); assertEquals( checkoutDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, null, null ) ); // checkout dir and goal dir assertEquals( projectDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "", "my/project" ) ); // checkout dir and relative path project dir assertEquals( projectDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my/project", null ) ); assertEquals( projectDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my/project/", null ) ); assertEquals( projectDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my" + File .separator + "project", null ) ); // checkout dir, relative path project dir and goal dir have been set assertEquals( goalDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my/project", "modules/1" ) ); assertEquals( goalDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my/project/", "modules/1/" ) ); assertEquals( goalDir.getPath(), bootstrapMojo.determineWorkingDirectoryPath( checkoutDir, "my" + File.separator + "project", "modules" + File.separator + "1" ) ); } } maven-scm-1.3/maven-scm-plugin/src/main/0000755000175000017500000000000011345536672020112 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/0000755000175000017500000000000011345536672021033 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/0000755000175000017500000000000011345536672021622 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/0000755000175000017500000000000011345536672023043 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/0000755000175000017500000000000011345536672024151 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536672024733 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/0000755000175000017500000000000011345536672026231 5ustar twernertwernermaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AddMojo.java0000644000175000017500000000377011050641524030402 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Add a file set to the project. * * @author Julien Henry * @version $Id: AddMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal add * @aggregator */ public class AddMojo extends AbstractScmMojo { /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); AddScmResult result = getScmManager().add( repository, getFileSet() ); checkResult( result ); getLog().info( "" + result.getAddedFiles().size() + "files successfully added." ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run add command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run add command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java0000644000175000017500000000675611050641524030571 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; /** * Display the difference of the working copy with the latest copy in the configured scm url. * * @author Emmanuel Venisse * @version $Id: DiffMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal diff * @aggregator */ public class DiffMojo extends AbstractScmMojo { /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${startScmVersionType}" */ private String startScmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${startScmVersion}" */ private String startScmVersion; /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${endScmVersionType}" */ private String endScmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${startScmVersion}" */ private String endScmVersion; /** * Output file name. * * @parameter expression="${outputFile}" * default-value="${project.artifactId}.diff" */ private File outputFile; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); DiffScmResult result = getScmManager().diff( repository, getFileSet(), getScmVersion( startScmVersionType, startScmVersion ), getScmVersion( endScmVersionType, endScmVersion ) ); checkResult( result ); getLog().info( result.getPatch() ); try { if ( outputFile != null ) { FileUtils.fileWrite( outputFile.getAbsolutePath(), result.getPatch() ); } } catch ( IOException e ) { throw new MojoExecutionException( "Can't write patch file.", e ); } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run diff command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run diff command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java0000644000175000017500000003070011130126175032110 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.settings.Server; import org.apache.maven.settings.Settings; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.Map; import java.util.Properties; /** * @author Emmanuel Venisse * @version $Id: AbstractScmMojo.java 731240 2009-01-04 12:33:01Z bentmann $ */ public abstract class AbstractScmMojo extends AbstractMojo { /** * The SCM connection URL. * * @parameter expression="${connectionUrl}" default-value="${project.scm.connection}" */ private String connectionUrl; /** * The SCM connection URL for developers. * * @parameter expression="${connectionUrl}" default-value="${project.scm.developerConnection}" */ private String developerConnectionUrl; /** * The type of connection to use (connection or developerConnection). * * @parameter expression="${connectionType}" default-value="connection" */ private String connectionType; /** * The working directory. * * @parameter expression="${workingDirectory}" */ private File workingDirectory; /** * The user name (used by svn, starteam and perforce protocol). * * @parameter expression="${username}" */ private String username; /** * The user password (used by svn, starteam and perforce protocol). * * @parameter expression="${password}" */ private String password; /** * The private key (used by java svn). * * @parameter expression="${privateKey}" */ private String privateKey; /** * The passphrase (used by java svn). * * @parameter expression="${passphrase}" */ private String passphrase; /** * The url of tags base directory (used by svn protocol). It is not * necessary to set it if you use the standard svn layout * (branches/tags/trunk). * * @parameter expression="${tagBase}" */ private String tagBase; /** * Comma separated list of includes file pattern. * * @parameter expression="${includes}" */ private String includes; /** * Comma separated list of excludes file pattern. * * @parameter expression="${excludes}" */ private String excludes; /** * @component */ private ScmManager manager; /** * The base directory. * * @parameter expression="${basedir}" * @required */ private File basedir; /** * @parameter expression="${settings}" * @required * @readonly */ private Settings settings; /** * List of System properties to pass to the JUnit tests. * * @parameter */ private Properties systemProperties; /** * List of provider implementations. * * @parameter */ private Map providerImplementations; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { if ( systemProperties != null ) { // Add all system properties configured by the user Iterator iter = systemProperties.keySet().iterator(); while ( iter.hasNext() ) { String key = (String) iter.next(); String value = systemProperties.getProperty( key ); System.setProperty( key, value ); } } if ( providerImplementations != null ) { for ( Iterator i = providerImplementations.keySet().iterator(); i.hasNext(); ) { String providerType = (String) i.next(); String providerImplementation = (String) providerImplementations.get( providerType ); getLog().info( "Change the default '" + providerType + "' provider implementation to '" + providerImplementation + "'." ); getScmManager().setScmProviderImplementation( providerType, providerImplementation ); } } } protected void setConnectionType( String connectionType ) { this.connectionType = connectionType; } public String getConnectionUrl() { boolean requireDeveloperConnection = !"connection".equals( connectionType.toLowerCase() ); if ( StringUtils.isNotEmpty( connectionUrl ) && !requireDeveloperConnection ) { return connectionUrl; } else if ( StringUtils.isNotEmpty( developerConnectionUrl ) ) { return developerConnectionUrl; } if ( requireDeveloperConnection ) { throw new NullPointerException( "You need to define a developerConnectionUrl parameter" ); } else { throw new NullPointerException( "You need to define a connectionUrl parameter" ); } } public void setConnectionUrl( String connectionUrl ) { this.connectionUrl = connectionUrl; } public File getWorkingDirectory() { if ( workingDirectory == null ) { return basedir; } return workingDirectory; } public void setWorkingDirectory( File workingDirectory ) { this.workingDirectory = workingDirectory; } public ScmManager getScmManager() { return manager; } public ScmFileSet getFileSet() throws IOException { if ( includes != null || excludes != null ) { return new ScmFileSet( getWorkingDirectory(), includes, excludes ); } else { return new ScmFileSet( getWorkingDirectory() ); } } public ScmRepository getScmRepository() throws ScmException { ScmRepository repository; try { repository = getScmManager().makeScmRepository( getConnectionUrl() ); ScmProviderRepository providerRepo = repository.getProviderRepository(); if ( !StringUtils.isEmpty( username ) ) { providerRepo.setUser( username ); } if ( !StringUtils.isEmpty( password ) ) { providerRepo.setPassword( password ); } if ( repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost ) { ScmProviderRepositoryWithHost repo = (ScmProviderRepositoryWithHost) repository.getProviderRepository(); loadInfosFromSettings( repo ); if ( !StringUtils.isEmpty( username ) ) { repo.setUser( username ); } if ( !StringUtils.isEmpty( password ) ) { repo.setPassword( password ); } if ( !StringUtils.isEmpty( privateKey ) ) { repo.setPrivateKey( privateKey ); } if ( !StringUtils.isEmpty( passphrase ) ) { repo.setPassphrase( passphrase ); } } if ( !StringUtils.isEmpty( tagBase ) && repository.getProvider().equals( "svn" ) ) { SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) repository.getProviderRepository(); svnRepo.setTagBase( tagBase ); } } catch ( ScmRepositoryException e ) { if ( !e.getValidationMessages().isEmpty() ) { for ( Iterator i = e.getValidationMessages().iterator(); i.hasNext(); ) { String message = (String) i.next(); getLog().error( message ); } } throw new ScmException( "Can't load the scm provider.", e ); } catch ( Exception e ) { throw new ScmException( "Can't load the scm provider.", e ); } return repository; } /** * Load username password from settings if user has not set them in JVM properties * * @param repo not null */ private void loadInfosFromSettings( ScmProviderRepositoryWithHost repo ) { if ( username == null || password == null ) { String host = repo.getHost(); int port = repo.getPort(); if ( port > 0 ) { host += ":" + port; } Server server = this.settings.getServer( host ); if ( server != null ) { if ( username == null ) { username = this.settings.getServer( host ).getUsername(); } if ( password == null ) { password = this.settings.getServer( host ).getPassword(); } if ( privateKey == null ) { privateKey = this.settings.getServer( host ).getPrivateKey(); } if ( passphrase == null ) { passphrase = this.settings.getServer( host ).getPassphrase(); } } } } public void checkResult( ScmResult result ) throws MojoExecutionException { if ( !result.isSuccess() ) { getLog().error( "Provider message:" ); getLog().error( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); getLog().error( "Command output:" ); getLog().error( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new MojoExecutionException( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } } public String getIncludes() { return includes; } public void setIncludes( String includes ) { this.includes = includes; } public String getExcludes() { return excludes; } public void setExcludes( String excludes ) { this.excludes = excludes; } public ScmVersion getScmVersion( String versionType, String version ) throws MojoExecutionException { if ( StringUtils.isEmpty( versionType ) && StringUtils.isNotEmpty( version ) ) { throw new MojoExecutionException( "You must specify the version type." ); } if ( StringUtils.isEmpty( version ) ) { return null; } if ( "branch".equals( versionType ) ) { return new ScmBranch( version ); } if ( "tag".equals( versionType ) ) { return new ScmTag( version ); } if ( "revision".equals( versionType ) ) { return new ScmRevision( version ); } throw new MojoExecutionException( "Unknown '" + versionType + "' version type." ); } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java0000644000175000017500000001122111161435327031452 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; /** * Get a fresh copy of the latest source from the configured scm url. * * @author Emmanuel Venisse * @version $Id: CheckoutMojo.java 757184 2009-03-22 13:19:19Z olamy $ * @goal checkout * @requiresProject false */ public class CheckoutMojo extends AbstractScmMojo { /** * Use Export instead of checkout * * @parameter expression="${useExport}" defaultValue="false"; */ private boolean useExport; /** * The directory to checkout the sources to for the bootstrap and checkout goals. * * @parameter expression="${checkoutDirectory}" default-value="${project.build.directory}/checkout" */ private File checkoutDirectory; /** * Skip checkout if checkoutDirectory exists. * * @parameter expression="${skipCheckoutIfExists}" default-value="false" */ private boolean skipCheckoutIfExists = false; /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** * allow extended mojo (ie BootStrap ) to see checkout result */ private ScmResult checkoutResult; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); //skip checkout if checkout directory is already created. See SCM-201 checkoutResult = null; if ( !getCheckoutDirectory().isDirectory() || !this.skipCheckoutIfExists ) { checkoutResult = checkout(); } } protected File getCheckoutDirectory() { return this.checkoutDirectory; } public void setCheckoutDirectory( File checkoutDirectory ) { this.checkoutDirectory = checkoutDirectory; } protected ScmResult checkout() throws MojoExecutionException { try { ScmRepository repository = getScmRepository(); this.prepareOutputDirectory( getCheckoutDirectory() ); ScmResult result = null; ScmFileSet fileSet = new ScmFileSet( getCheckoutDirectory().getAbsoluteFile() ); if ( useExport ) { result = getScmManager().export( repository,fileSet, getScmVersion( scmVersionType, scmVersion ) ); } else { result = getScmManager().checkOut( repository,fileSet , getScmVersion( scmVersionType, scmVersion ) ); } checkResult( result ); return result; } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run checkout command : ", e ); } } private void prepareOutputDirectory( File ouputDirectory ) throws MojoExecutionException { try { this.getLog().info( "Removing " + ouputDirectory ); FileUtils.deleteDirectory( getCheckoutDirectory() ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot remove " + ouputDirectory ); } if ( !getCheckoutDirectory().mkdirs() ) { throw new MojoExecutionException( "Cannot create " + ouputDirectory ); } } protected ScmResult getCheckoutResult() { return checkoutResult; } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java0000644000175000017500000000532511050641524031254 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Commit changes to the configured scm url. * * @author Emmanuel Venisse * @version $Id: CheckinMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal checkin * @aggregator */ public class CheckinMojo extends AbstractScmMojo { /** * Commit log. * * @parameter expression="${message}" */ private String message; /** * The configured scm url to use. * * @parameter expression="${connectionType}" default-value="developerConnection" */ private String connectionType; /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); setConnectionType( connectionType ); try { ScmRepository repository = getScmRepository(); CheckInScmResult result = getScmManager().checkIn( repository, getFileSet(), getScmVersion( scmVersionType, scmVersion ), message ); checkResult( result ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run checkin command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run checkin command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/EditMojo.java0000644000175000017500000000361711050560613030576 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Edit/lock a set of files. * * @author Dan Tran * @version $Id: EditMojo.java 685542 2008-08-13 13:28:43Z vsiveton $ * @goal edit * @aggregator */ public class EditMojo extends AbstractScmMojo { /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); EditScmResult result = getScmManager().edit( repository, getFileSet() ); checkResult( result ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run edit command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run edit command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java0000644000175000017500000000603611050560613031110 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.logging.Log; import org.apache.maven.scm.log.ScmLogger; /** * @author Emmanuel Venisse * @version $Id: DefaultLog.java 685542 2008-08-13 13:28:43Z vsiveton $ */ public class DefaultLog implements ScmLogger { private Log logger; public DefaultLog( Log logger ) { this.logger = logger; } /** {@inheritDoc} */ public boolean isDebugEnabled() { return logger.isDebugEnabled(); } /** {@inheritDoc} */ public void debug( String content ) { logger.debug( content ); } /** {@inheritDoc} */ public void debug( String content, Throwable error ) { logger.debug( content, error ); } /** {@inheritDoc} */ public void debug( Throwable error ) { logger.debug( error ); } /** {@inheritDoc} */ public boolean isInfoEnabled() { return logger.isInfoEnabled(); } /** {@inheritDoc} */ public void info( String content ) { logger.info( content ); } /** {@inheritDoc} */ public void info( String content, Throwable error ) { logger.info( content, error ); } /** {@inheritDoc} */ public void info( Throwable error ) { logger.info( error ); } /** {@inheritDoc} */ public boolean isWarnEnabled() { return logger.isWarnEnabled(); } /** {@inheritDoc} */ public void warn( String content ) { logger.warn( content ); } /** {@inheritDoc} */ public void warn( String content, Throwable error ) { logger.warn( content, error ); } /** {@inheritDoc} */ public void warn( Throwable error ) { logger.warn( error ); } /** {@inheritDoc} */ public boolean isErrorEnabled() { return logger.isErrorEnabled(); } /** {@inheritDoc} */ public void error( String content ) { logger.error( content ); } /** {@inheritDoc} */ public void error( String content, Throwable error ) { logger.error( content, error ); } /** {@inheritDoc} */ public void error( Throwable error ) { logger.error( error ); } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ListMojo.java0000644000175000017500000000640311050641524030621 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.repository.ScmRepository; import java.io.File; import java.io.IOException; import java.util.Iterator; /** * Get the list of project files. * * @author Emmanuel Venisse * @version $Id: ListMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal list * @aggregator */ public class ListMojo extends AbstractScmMojo { /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** * Use recursive mode. * * @parameter expression="${recursive}" default-value="true" */ private boolean recursive = true; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); ListScmResult result = getScmManager().list( repository, getFileSet(), recursive, getScmVersion( scmVersionType, scmVersion ) ); checkResult( result ); if ( result.getFiles() != null ) { for ( Iterator i = result.getFiles().iterator(); i.hasNext(); ) { ScmFile scmFile = (ScmFile) i.next(); getLog().info( scmFile.getPath() ); } } } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run list command : ", e ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run list command : ", e ); } } public ScmFileSet getFileSet() throws IOException { if ( getIncludes() != null || getExcludes() != null ) { return new ScmFileSet( getWorkingDirectory(), getIncludes(), getExcludes() ); } else { return new ScmFileSet( getWorkingDirectory(), new File( "." ) ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java0000644000175000017500000000704711050641524031176 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.io.IOException; import java.util.Iterator; /** * Display the modification status of the files in the configured scm url. * * @author Emmanuel Venisse * @version $Id: StatusMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal status * @aggregator */ public class StatusMojo extends AbstractScmMojo { /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); StatusScmResult result = getScmManager().status( repository, getFileSet() ); checkResult( result ); File baseDir = getFileSet().getBasedir(); // Determine the maximum length of the status column int maxLen = 0; for ( Iterator iter = result.getChangedFiles().iterator(); iter.hasNext(); ) { ScmFile file = (ScmFile) iter.next(); maxLen = Math.max( maxLen, file.getStatus().toString().length() ); } for ( Iterator iter = result.getChangedFiles().iterator(); iter.hasNext(); ) { ScmFile file = (ScmFile) iter.next(); // right align all of the statuses getLog().info( StringUtils.leftPad( file.getStatus().toString(), maxLen ) + " status for " + getRelativePath( baseDir, file.getPath() ) ); } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run status command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run status command : ", e ); } } /** * Formats the filename so that it is a relative directory from the base. * * @param baseDir * @param path * @return The relative path */ protected String getRelativePath( File baseDir, String path ) { if ( path.equals( baseDir.getAbsolutePath() ) ) { return "."; } else if ( path.indexOf( baseDir.getAbsolutePath() ) == 0 ) { // the + 1 gets rid of a leading file separator return path.substring( baseDir.getAbsolutePath().length() + 1 ); } else { return path; } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UnEditMojo.java0000644000175000017500000000364511050560613031102 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Unedit/unlock a set of files. * * @author Dan Tran * @version $Id: UnEditMojo.java 685542 2008-08-13 13:28:43Z vsiveton $ * @goal unedit * @aggregator */ public class UnEditMojo extends AbstractScmMojo { /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); UnEditScmResult result = getScmManager().unedit( repository, getFileSet() ); checkResult( result ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run unedit command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run unedit command : ", e ); } } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo.javamaven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckLocalModificationsMojo0000644000175000017500000000553011161552173033473 0ustar twernertwernerpackage org.apache.maven.scm.plugin; import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.repository.ScmRepository; /* * 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. */ /** * This mojo will fail the build if there is any local modifications * @goal check-local-modification * @author olamy * @since 1.2 */ public class CheckLocalModificationsMojo extends AbstractScmMojo { /** * Custom error message * * @parameter expression="${scm.checkLocalModification.errorMessage}" * default-value="The build will stop as there is local modifications"; */ private String errorMessage; /** * Custom error message * * @parameter expression="${scm.checkLocalModification.skip}" default-value="false"; */ private boolean skip; /** * current directory * * @parameter default-value="${basedir}"; * @readonly */ private File baseDirectory; public void execute() throws MojoExecutionException { if ( skip ) { getLog().info( "check-local-modification execution has been skipped" ); return; } super.execute(); StatusScmResult result = null; try { ScmRepository repository = getScmRepository(); result = getScmManager().status( repository, new ScmFileSet( baseDirectory ) ); } catch ( ScmException e ) { throw new MojoExecutionException( e.getMessage(), e ); } if ( !result.isSuccess() ) { throw new MojoExecutionException( "Unable to check for local modifications :" + result.getProviderMessage() ); } if ( !result.getChangedFiles().isEmpty() ) { getLog().error( errorMessage ); throw new MojoExecutionException( errorMessage ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ValidateMojo.java0000644000175000017500000000624611050560613031443 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import java.util.Iterator; import java.util.List; /** * Validate scm connection string. * * @author Emmanuel Venisse * @version $Id: ValidateMojo.java 685542 2008-08-13 13:28:43Z vsiveton $ * @goal validate * @execute phase="validate" * @requiresProject false */ public class ValidateMojo extends AbstractScmMojo { /** * The scm connection url. * * @parameter expression="${scmConnection}" default-value="${project.scm.connection}" */ private String scmConnection; /** * The scm connection url for developers. * * @parameter expression="${scmDeveloperConnection}" default-value="${project.scm.developerConnection}" */ private String scmDeveloperConnection; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); //check connectionUrl provided with cli try { validateConnection( getConnectionUrl(), "connectionUrl" ); } catch ( NullPointerException e ) { // nothing to do. connectionUrl isn't defined } //check scm connection if ( scmConnection != null ) { validateConnection( scmConnection, "project.scm.connection" ); } // Check scm developerConnection if ( scmDeveloperConnection != null ) { validateConnection( scmDeveloperConnection, "project.scm.developerConnection" ); } } private void validateConnection( String connectionString, String type ) throws MojoExecutionException { List messages = getScmManager().validateScmRepository( connectionString ); if ( !messages.isEmpty() ) { getLog().error( "Validation of scm url connection (" + type + ") failed :" ); Iterator iter = messages.iterator(); while ( iter.hasNext() ) { getLog().error( iter.next().toString() ); } getLog().error( "The invalid scm url connection: '" + connectionString + "'." ); throw new MojoExecutionException( "Command failed. Bad Scm URL." ); } else { getLog().info( type + " scm connection string is valid." ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BootstrapMojo.java0000644000175000017500000001443211132454173031667 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.DefaultConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; /** * Pull the project source from the configured scm and execute the configured goals. * * @author Dan T. Tran * @version $Id: BootstrapMojo.java 733515 2009-01-11 20:37:15Z dantran $ * @goal bootstrap * @requiresProject false */ public class BootstrapMojo extends CheckoutMojo { /** * The goals to run on the clean checkout of a project for the bootstrap goal. * If none are specified, then the default goal for the project is executed. * Multiple goals should be comma separated. * * @parameter expression="${goals}" */ private String goals; /** * A list of profiles to run with the goals. * Multiple profiles must be comma separated with no spaces. * * @parameter expression="${profiles}" */ private String profiles; /** * The subdirectory (under the project directory) in which to run the goals. * The project directory is the same as the checkout directory in most cases, * but for some SCMs, it is a subdirectory of the checkout directory. * * @parameter expression="${goalsDirectory}" default-value="" */ private String goalsDirectory; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); if ( this.getCheckoutResult() != null ) { ScmResult checkoutResult = this.getCheckoutResult(); //At the time of useExport feature is requested only SVN and and CVS have export command implemented // we will deal with this as more user using this feature specially clearcase where we need to // add relativePathProjectDirectory support to ExportScmResult String relativePathProjectDirectory = ""; if ( checkoutResult instanceof CheckOutScmResult ) { relativePathProjectDirectory = ( (CheckOutScmResult) checkoutResult).getRelativePathProjectDirectory(); } runGoals( relativePathProjectDirectory ); } } /** * @param relativePathProjectDirectory the project directory's path relative to the checkout * directory; or "" if they are the same * @throws MojoExecutionException if any */ private void runGoals( String relativePathProjectDirectory ) throws MojoExecutionException { Commandline cl = new Commandline(); try { cl.addSystemEnvironment(); } catch ( Exception e ) { throw new MojoExecutionException( "Can't add system environment variables to mvn command line.", e ); } cl.addEnvironment( "MAVEN_TERMINATE_CMD", "on" ); cl.setExecutable( "mvn" ); cl.setWorkingDirectory( determineWorkingDirectoryPath( this.getCheckoutDirectory(), relativePathProjectDirectory, goalsDirectory ) ); if ( this.goals != null ) { String[] tokens = StringUtils.split( this.goals, ", " ); for ( int i = 0; i < tokens.length; ++i ) { cl.createArg().setValue( tokens[i] ); } } if ( ! StringUtils.isEmpty( this.profiles ) ) { cl.createArg().setValue( "-P" + this.profiles ); } StreamConsumer consumer = new DefaultConsumer(); try { int result = CommandLineUtils.executeCommandLine( cl, consumer, consumer ); if ( result != 0 ) { throw new MojoExecutionException( "Result of mvn execution is: \'" + result + "\'. Release failed." ); } } catch ( CommandLineException e ) { throw new MojoExecutionException( "Can't run goal " + goals, e ); } } /** * Determines the path of the working directory. By default, this is the checkout directory. For some SCMs, * the project root directory is not the checkout directory itself, but a SCM-specific subdirectory. The * build can furthermore optionally be executed in a subdirectory of this project directory, in case. * * @param checkoutDirectory * @param relativePathProjectDirectory * @param goalsDirectory * @return */ protected String determineWorkingDirectoryPath( File checkoutDirectory, String relativePathProjectDirectory, String goalsDirectory ) { File projectDirectory; if ( StringUtils.isNotEmpty( relativePathProjectDirectory ) ) { projectDirectory = new File( checkoutDirectory, relativePathProjectDirectory ); } else { projectDirectory = checkoutDirectory; } if ( StringUtils.isEmpty( goalsDirectory ) ) { return projectDirectory.getPath(); } return new File( projectDirectory, goalsDirectory ).getPath(); } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ExportMojo.java0000644000175000017500000000767111132445262031201 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; /** * Get a fresh exported copy of the latest source from the configured scm url. * * @author Emmanuel Venisse * @version $Id: ExportMojo.java 733500 2009-01-11 19:38:26Z dantran $ * @goal export * @requiresProject false */ public class ExportMojo extends AbstractScmMojo { /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** * The directory to export the sources to. * * @parameter expression="${exportDirectory}" default-value="${project.build.directory}/export * @required */ private File exportDirectory; /** * Skip export if exportDirectory exists. * * @parameter expression="${skipExportIfExists}" default-value="false" */ private boolean skipExportIfExists = false; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); if ( this.skipExportIfExists && this.exportDirectory.isDirectory() ) { return; } export(); } protected File getExportDirectory() { return this.exportDirectory; } public void setExportDirectory( File exportDirectory ) { this.exportDirectory = exportDirectory; } protected void export() throws MojoExecutionException { try { ScmRepository repository = getScmRepository(); try { if ( this.exportDirectory.exists() ) { this.getLog().info( "Removing " + this.exportDirectory ); FileUtils.deleteDirectory( this.exportDirectory ); } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot remove " + getExportDirectory() ); } if ( !this.exportDirectory.mkdirs() ) { throw new MojoExecutionException( "Cannot create " + this.exportDirectory ); } ExportScmResult result = getScmManager().export( repository, new ScmFileSet( this.exportDirectory.getAbsoluteFile() ), getScmVersion( scmVersionType, scmVersion ) ); checkResult( result ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run export command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java0000644000175000017500000001151011161435664030425 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; /** * Tag the project. * * @author Emmanuel Venisse * @author Sharmarke Aden * @version $Id: TagMojo.java 757186 2009-03-22 13:23:00Z olamy $ * @goal tag * @aggregator */ public class TagMojo extends AbstractScmMojo { /** * The tag name. * * @parameter expression="${tag}" * @required */ private String tag; /** * The message applied to the tag creation. * * @parameter expression="${message}" */ private String message; /** * Set the timestamp format. * * @parameter expression="${timestampFormat}" default-value="yyyyMMddHHmmss" */ private String timestampFormat; /** * Use timestamp tagging. * * @parameter expression="${addTimestamp}" default-value="false" */ private boolean addTimestamp; /** * Define the timestamp position (end or begin). * * @parameter expression="${timestampPosition}" default-value="end" */ private String timestampPosition; /** * Timestamp tag prefix. * * @parameter expression="${timestampPrefix}" default-value="-" */ private String timestampPrefix; /** * currently only implemented with svn scm. Enable a workaround to prevent issue * due to svn client > 1.5.0 (http://jira.codehaus.org/browse/SCM-406) * * * @parameter expression="${remoteTagging}" default-value="true" * @since 1.2 */ private boolean remoteTagging; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { SimpleDateFormat dateFormat = null; String tagTimestamp = ""; String finalTag = tag; if ( addTimestamp ) { try { getLog().info( "Using timestamp pattern '" + timestampFormat + "'" ); dateFormat = new SimpleDateFormat( timestampFormat ); tagTimestamp = dateFormat.format( new Date() ); getLog().info( "Using timestamp '" + tagTimestamp + "'" ); } catch ( IllegalArgumentException e ) { String msg = "The timestamp format '" + timestampFormat + "' is invalid."; getLog().error( msg, e ); throw new MojoExecutionException( msg, e ); } if ( "end".equals( timestampPosition ) ) { finalTag += timestampPrefix + tagTimestamp; } else { finalTag = tagTimestamp + timestampPrefix + finalTag; } } ScmRepository repository = getScmRepository(); ScmProvider provider = getScmManager().getProviderByRepository( repository ); finalTag = provider.sanitizeTagName( finalTag ); getLog().info( "Final Tag Name: '" + finalTag + "'" ); ScmTagParameters scmTagParameters = new ScmTagParameters( message); scmTagParameters.setRemoteTagging( remoteTagging ); TagScmResult result = provider.tag( repository, getFileSet(), finalTag, scmTagParameters); checkResult( result ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run tag command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run tag command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java0000644000175000017500000000724611050641524031136 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Update the local working copy with the latest source from the configured scm url. * * @author Emmanuel Venisse * @version $Id: UpdateMojo.java 685670 2008-08-13 20:25:56Z vsiveton $ * @goal update * @aggregator */ public class UpdateMojo extends AbstractScmMojo { /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** * The project property where to store the revision name. * * @parameter expression="${revisionKey}" default-value="scm.revision" */ private String revisionKey; /** * The maven project. * * @parameter expression="${project}" * @required * @readonly */ private MavenProject project; /** * Run Changelog after update. * * @parameter expression="${runChangelog}" default-value="false" */ private boolean runChangelog = false; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); UpdateScmResult result = getScmManager().update( repository, getFileSet(), getScmVersion( scmVersionType, scmVersion ), runChangelog ); checkResult( result ); if ( result instanceof UpdateScmResultWithRevision ) { String revision = ( (UpdateScmResultWithRevision) result ).getRevision(); getLog().info( "Storing revision in '" + revisionKey + "' project property." ); if ( project.getProperties() != null ) // Remove the test when we'll use plugin-test-harness 1.0-alpha-2 { project.getProperties().put( revisionKey, revision ); } getLog().info( "Project at revision " + revision ); } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run update command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run update command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/BranchMojo.java0000644000175000017500000000603311313217341031100 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Branch the project. * * @author Emmanuel Venisse * @version $Id: BranchMojo.java 892496 2009-12-19 18:43:45Z olamy $ * @goal branch * @aggregator */ public class BranchMojo extends AbstractScmMojo { /** * The branch name. * * @parameter expression="${branch}" * @required */ private String branch; /** * The message applied to the tag creation. * * @parameter expression="${message}" */ private String message; /** * currently only implemented with svn scm. Enable a workaround to prevent issue * due to svn client > 1.5.0 (http://jira.codehaus.org/browse/SCM-406) * * * @parameter expression="${remoteBranching}" default-value="true" * @since 1.3 */ private boolean remoteBranching; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); ScmProvider provider = getScmManager().getProviderByRepository( repository ); String finalBranch = provider.sanitizeTagName( branch ); getLog().info( "Final Branch Name: '" + finalBranch + "'" ); ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message ); scmBranchParameters.setRemoteBranching( remoteBranching ); BranchScmResult result = provider.branch( repository, getFileSet(), finalBranch, scmBranchParameters ); checkResult( result ); } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run branch command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run branch command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/ChangeLogMojo.java0000644000175000017500000001137711050560613031542 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; /** * Dump changelog contents to console. It is mainly used to test maven-scm-api's changelog command. * * @author Dan Tran * @version $Id: ChangeLogMojo.java 685542 2008-08-13 13:28:43Z vsiveton $ * @goal changelog * @aggregator */ public class ChangeLogMojo extends AbstractScmMojo { private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; /** * Start Date. * * @parameter expression="${startDate}" */ private String startDate; /** * End Date. * * @parameter expression="${endDate}" */ private String endDate; /** * Date Format in changelog output of scm tool. * * @parameter expression="${dateFormat}" */ private String dateFormat; /** * Date format to use for the specified startDate and/or endDate. * * @parameter expression="${userDateFormat}" default-value="yyyy-MM-dd" */ private String userDateFormat = DEFAULT_DATE_FORMAT; /** * The version type (branch/tag) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); SimpleDateFormat localFormat = new SimpleDateFormat( userDateFormat ); try { ScmRepository repository = getScmRepository(); ScmProvider provider = getScmManager().getProviderByRepository( repository ); ChangeLogScmResult result = provider.changeLog( repository, getFileSet(), this.parseDate( localFormat, this.startDate ), this.parseDate( localFormat, this.endDate ), 0, (ScmBranch) getScmVersion( scmVersionType, scmVersion ), dateFormat ); checkResult( result ); ChangeLogSet changeLogSet = result.getChangeLog(); for ( Iterator i = changeLogSet.getChangeSets().iterator(); i.hasNext(); ) { ChangeSet changeSet = (ChangeSet) i.next(); System.out.println( changeSet.toString() ); } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run changelog command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run changelog command : ", e ); } } /** * Converts the localized date string pattern to date object. * * @return A date */ private Date parseDate( SimpleDateFormat format, String date ) throws MojoExecutionException { if ( date == null || date.trim().length() == 0 ) { return null; } try { return format.parse( date.toString() ); } catch ( ParseException e ) { throw new MojoExecutionException( "Please use this date pattern: " + format.toLocalizedPattern().toString(), e ); } } } maven-scm-1.3/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateSubprojectsMojo.java0000644000175000017500000000656711050560613033366 0ustar twernertwernerpackage org.apache.maven.scm.plugin; /* * 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. */ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.repository.ScmRepository; import java.io.IOException; /** * Updates all projects in a multi project build. This is useful for users who have adopted the flat project structure * where the aggregator project is a sibling of the sub projects rather than sitting in the parent directory. * * @goal update-subprojects * @version $Id: UpdateSubprojectsMojo.java 685542 2008-08-13 13:28:43Z vsiveton $ */ public class UpdateSubprojectsMojo extends AbstractScmMojo { /** * The version type (branch/tag/revision) of scmVersion. * * @parameter expression="${scmVersionType}" */ private String scmVersionType; /** * The version (revision number/branch name/tag name). * * @parameter expression="${scmVersion}" */ private String scmVersion; /** * The project property where to store the revision name. * * @parameter expression="${revisionKey}" default-value="scm.revision" */ private String revisionKey; /** * The maven project. * * @parameter expression="${project}" * @required * @readonly */ private MavenProject project; /** {@inheritDoc} */ public void execute() throws MojoExecutionException { super.execute(); try { ScmRepository repository = getScmRepository(); UpdateScmResult result = getScmManager().update( repository, getFileSet(), getScmVersion( scmVersionType, scmVersion ) ); checkResult( result ); if ( result instanceof UpdateScmResultWithRevision ) { getLog().info( "Storing revision in '" + revisionKey + "' project property." ); if ( project.getProperties() != null ) // Remove the test when we'll use plugin-test-harness 1.0-alpha-2 { project.getProperties().put( revisionKey, ( (UpdateScmResultWithRevision) result ).getRevision() ); } } } catch ( IOException e ) { throw new MojoExecutionException( "Cannot run update command : ", e ); } catch ( ScmException e ) { throw new MojoExecutionException( "Cannot run update command : ", e ); } } } maven-scm-1.3/maven-scm-plugin/pom.xml0000644000175000017500000001346611322611461017707 0ustar twernertwerner 4.0.0 org.apache.maven.plugins maven-plugins 16 org.apache.maven.plugins maven-scm-plugin 1.3 maven-plugin Maven SCM Plugin Maven Plugin that allows accessing different SCMs. 2.0.6 scm:svn:http://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.3/maven-scm-plugin scm:svn:https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.3/maven-scm-plugin http://svn.apache.org/viewvc/maven/scm/tags/maven-scm-1.3/trunk/maven-scm-plugin jira http://jira.codehaus.org/browse/SCM apache.website scp://people.apache.org/www/maven.apache.org/scm/maven-scm-plugin org.apache.maven maven-project 2.0.6 org.apache.maven maven-settings 2.0.6 org.apache.maven maven-plugin-api 2.0.6 org.apache.maven.scm maven-scm-manager-plexus 1.3 org.apache.maven.scm maven-scm-providers-standard 1.3 pom org.apache.maven.scm maven-scm-provider-local 1.3 org.apache.maven.scm maven-scm-provider-svn-commons 1.3 org.codehaus.plexus plexus-utils 1.5.6 junit junit 3.8.2 test org.apache.maven.plugin-testing maven-plugin-testing-harness 1.2 test org.apache.maven.scm maven-scm-provider-svntest 1.3 test org.apache.maven.plugins maven-release-plugin https://svn.apache.org/repos/asf/maven/scm/tags org.apache.maven.plugins maven-site-plugin scp://people.apache.org/www/maven.apache.org/scm/maven-scm-plugin-${project.version} reporting org.apache.maven.plugins maven-changes-plugin 2.1 Type,Key,Summary,Assignee,Status,Resolution,Fix Version true Closed Type,Key jira-report maven-scm-1.3/maven-scm-api/0000755000175000017500000000000011345536673015653 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/0000755000175000017500000000000011345536673016442 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/site/0000755000175000017500000000000011345536673017406 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/site/site.xml0000644000175000017500000000211211051127665021057 0ustar twernertwerner maven-scm-1.3/maven-scm-api/src/test/0000755000175000017500000000000011345536673017421 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/0000755000175000017500000000000011345536673021433 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/0000755000175000017500000000000011345536673022222 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/0000755000175000017500000000000011345536673023443 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/0000755000175000017500000000000011345536673024551 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/0000755000175000017500000000000011345536673025333 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/0000755000175000017500000000000011345536673027471 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/testFile20000644000175000017500000000000010423562170031226 0ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/testFile10000644000175000017500000000000010423562170031225 0ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/exclude/0000755000175000017500000000000011345536673031122 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/exclude/exclude20000644000175000017500000000000011046424000032520 0ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/resources/org/apache/maven/scm/scmfileset/exclude/exclude10000644000175000017500000000000011046424000032517 0ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/0000755000175000017500000000000011345536673020342 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/0000755000175000017500000000000011345536673021131 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/0000755000175000017500000000000011345536673022352 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/0000755000175000017500000000000011345536673023460 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536673024242 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java0000644000175000017500000001525211207614016027574 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import junit.framework.TestCase; import java.util.Calendar; import java.util.Date; /** * Tests for the {@link ChangeSet}class * * @author dion * @version $Id: ChangeSetTest.java 779790 2009-05-28 23:02:38Z olamy $ */ public class ChangeSetTest extends TestCase { /** * the {@link ChangeSet} used for testing */ private ChangeSet instance; /** * Initialize per test data */ public void setUp() { instance = createInstance(); } private static ChangeSet createInstance() { ChangeSet instance = new ChangeSet(); instance.setAuthor( "dion" ); instance.setComment( "comment" ); instance.setDate( "2002/04/01 00:00:00" ); return instance; } /** * Test of addFile methods: using ChangeFile */ public void testAddFileWithFile() { ChangeFile file = new ChangeFile( "maven:dummy" ); instance.addFile( file ); assertTrue( "File name not found in list", instance.toString().indexOf( "maven:dummy" ) != -1 ); assertTrue( instance.containsFilename("maven:") ); assertTrue( instance.containsFilename(":dummy") ); assertTrue( instance.containsFilename(":") ); assertTrue( instance.containsFilename("maven:dummy") ); assertFalse( instance.containsFilename("dammy") ); } /** * Test of toString method */ public void testToString() { //dion, Mon Apr 01 00:00:00 EST 2002, comment String value = instance.toString(); assertTrue( "author not found in string", value.indexOf( "dion" ) != -1 ); assertTrue( "comment not found in string", value.indexOf( "comment" ) != -1 ); assertTrue( "date not found in string", value.indexOf( "Mon Apr 01" ) != -1 ); } /** * Test of getAuthor method */ public void testGetAuthor() { assertEquals( "Author value not retrieved correctly", "dion", instance.getAuthor() ); } /** * Test of setAuthor method */ public void testSetAuthor() { instance.setAuthor( "maven:dion" ); assertEquals( "Author not set correctly", "maven:dion", instance.getAuthor() ); } /** * Test of getComment method */ public void testGetComment() { assertEquals( "Comment value not retrieved correctly", "comment", instance.getComment() ); } /** * Test of setComment method */ public void testSetComment() { instance.setComment( "maven:comment" ); assertEquals( "Comment not set correctly", "maven:comment", instance.getComment() ); } /** * Test of getDate method */ public void testGetDate() { assertEquals( "Date value not retrieved correctly", getDate( 2002, 3, 1 ), instance.getDate() ); } /** * Test of setDate method with Date object */ public void testSetDate() { Calendar cal = Calendar.getInstance(); Date date = cal.getTime(); instance.setDate( date ); assertEquals( "Date value not set correctly", date, instance.getDate() ); } /** * Test of setDate method with String */ public void testSetDateFromString() { instance.setDate( "2002/03/04 00:00:00" ); assertEquals( "Date value not set correctly from a string", getDate( 2002, 2, 4 ), instance.getDate() ); } /** * Test of getDateFormatted method */ public void testGetDateFormatted() { assertEquals( "Date not formatted correctly", "2002-04-01", instance.getDateFormatted() ); } /** * Test of getDateFormatted method */ public void testGetTimeFormatted() { assertEquals( "Time not formatted correctly", "00:00:00", instance.getTimeFormatted() ); } public static Date getDate( int year, int month, int day ) { Calendar cal = Calendar.getInstance(); cal.set( year, month, day, 0, 0, 0 ); cal.set( Calendar.MILLISECOND, 0 ); return cal.getTime(); } public void testEscapeValue() { assertEquals( "", ChangeSet.escapeValue("") ); assertEquals( "'", ChangeSet.escapeValue("'") ); assertEquals( "a", ChangeSet.escapeValue("a") ); assertEquals( "a'", ChangeSet.escapeValue("a'") ); assertEquals( "'a'", ChangeSet.escapeValue("'a'") ); assertEquals( "a<b>c", ChangeSet.escapeValue("ac") ); assertEquals( "'&;<>"", ChangeSet.escapeValue("'&;<>\"") ); } public void testEquals() { ChangeSet instance2 = createInstance(); assertEquals(instance, instance2); instance2.setComment("another comment"); assertFalse(instance2.equals(instance)); instance2.setComment("comment"); assertEquals(instance, instance2); } public void testHashCode() { int hashCode1 = instance.hashCode(); instance.setAuthor("anotherAuthor"); assertFalse( hashCode1 == instance.hashCode() ); instance.setAuthor( "dion" ); assertEquals( hashCode1, instance.hashCode() ); } public void testToXml() { String sXml = instance.toXML(); assertNotNull(sXml); assertTrue(sXml.indexOf("") > -1); assertTrue(sXml.indexOf("") > -1); } public void testToXmlWithFiles() { instance.addFile( new ChangeFile( "maven1:dummy" ) ); instance.addFile( new ChangeFile( "maven2:dummy2" ) ); String sXml = instance.toXML(); assertNotNull(sXml); assertTrue(sXml.indexOf("") > -1); assertTrue(sXml.indexOf("") > -1); assertTrue(sXml.indexOf("") > -1); assertTrue(sXml.indexOf("maven1:dummy") > -1); assertTrue(sXml.indexOf("maven2:dummy2") > -1); } } maven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/manager/0000755000175000017500000000000011345536673025654 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/manager/ScmManagerTest.java0000644000175000017500000000423210535556312031365 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import junit.framework.TestCase; /** * @author Emmanuel Venisse * @version $Id: ScmManagerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ScmManagerTest extends TestCase { public void testCleanScmUrl() throws Exception { BasicScmManager manager = new BasicScmManager(); assertEquals( "https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-api", manager.cleanScmUrl( "https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-api" ) ); assertEquals( "https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-manager", manager.cleanScmUrl( "https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-api/../maven-scm-manager" ) ); assertEquals( "https://svn.apache.org/repos/asf/maven/scm/trunk/", manager.cleanScmUrl( "https://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-api/../" ) ); assertEquals( "d:\\myrepo\\mydir", manager.cleanScmUrl( "d:\\myrepo\\mydir" ) ); assertEquals( "d:\\myrepo\\mydir2", manager.cleanScmUrl( "d:\\myrepo\\mydir\\..\\mydir2" ) ); assertEquals( "//depot/repos/...", manager.cleanScmUrl( "//depot/repos/..." ) ); assertEquals( "//depot/repo2/...", manager.cleanScmUrl( "//depot/repos/../repo2/..." ) ); } } maven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/command/0000755000175000017500000000000011345536673025660 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/0000755000175000017500000000000011345536673027607 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java0000644000175000017500000000646511207614016027737 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.List; import junit.framework.TestCase; /** * @author dtran */ public class ScmFileSetTest extends TestCase { private static String basedirPath; public static String getBasedir() { if ( basedirPath != null ) { return basedirPath; } basedirPath = System.getProperty( "basedir" ); if ( basedirPath == null ) { basedirPath = new File( "" ).getAbsolutePath(); } return basedirPath; } private String removeBasedir( String filename ) { return filename.substring( getBasedir().length(), filename.length() ); } public void testFilesList() throws IOException { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir(), "src" ), "**/**" ); assertEquals( "src", fileSet.getBasedir().getName() ); assertEquals( "**/**", fileSet.getIncludes() ); // assertEquals( ScmFileSet.DEFAULT_EXCLUDES, fileSet.getExcludes() ); assertTrue( "List of files should be longer than 10 elements, but received: " + fileSet.getFileList().size(), fileSet.getFileList().size() > 10 ); } public void testFilesListWithoutIncludesResultsEmptyList() throws IOException { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir(), "src" ) ); assertEquals( 0, fileSet.getFileList().size() ); } public void testFilesListExcludes() throws IOException { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir(), "src" ), "**/**", "**/exclude/**" ); List files = fileSet.getFileList(); Iterator it = files.iterator(); while ( it.hasNext() ) { File file = (File) it.next(); if ( removeBasedir( file.getAbsolutePath() ).indexOf( "exclude" ) != -1 ) { fail( "Found excludes in file set: " + file ); } } } public void testFilesListExcludes2() throws IOException { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir(), "src" ), "**/scmfileset/**", "**/exclude/**" ); assertEquals( 2, fileSet.getFileList().size() ); } public void testFilesListNoExcludes() throws IOException { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir(), "src" ), "**/scmfileset/**" ); assertEquals( 4, fileSet.getFileList().size() ); } } maven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/util/0000755000175000017500000000000011345536673025217 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/util/FilenameUtilsTest.java0000644000175000017500000000271611207614016031452 0ustar twernertwernerpackage org.apache.maven.scm.util; /* * 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. */ import junit.framework.TestCase; public class FilenameUtilsTest extends TestCase { public void testNormalize() { assertNull( FilenameUtils.normalizeFilename( (String) null ) ); assertEquals( "", FilenameUtils.normalizeFilename( "" ) ); assertEquals( "c:", FilenameUtils.normalizeFilename( "c:" ) ); assertEquals( "c:/", FilenameUtils.normalizeFilename( "c:\\" ) ); assertEquals( "c:/", FilenameUtils.normalizeFilename( "c:/" ) ); assertEquals( "c:/", FilenameUtils.normalizeFilename( "c://" ) ); assertEquals( "c:/", FilenameUtils.normalizeFilename( "c:\\/" ) ); } } maven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java0000644000175000017500000000355311207614016027721 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import junit.framework.TestCase; /** * @author Emmanuel Venisse * @version $Id: ChangeLogFileTest.java,v 1.1.1.1 2004/04/20 19:05:52 jvanzyl * Exp $ */ public class ChangeFileTest extends TestCase { public void testNewFile() { ChangeFile f = new ChangeFile( "test.java" ); assertEquals( "test.java", f.getName() ); assertEquals( null, f.getRevision() ); assertEquals( "test.java", f.toString() ); } public void testNewFileRevision() { ChangeFile f = new ChangeFile( "test.java", "1.2.3" ); assertEquals( "test.java", f.getName() ); assertEquals( "1.2.3", f.getRevision() ); assertEquals( "test.java, 1.2.3", f.toString() ); } public void testNewRevisionFile() { ChangeFile f = new ChangeFile( "test.java", "revision1" ); assertEquals( "test.java", f.getName() ); assertEquals( "revision1", f.getRevision() ); assertEquals( "test.java, revision1", f.toString() ); } } maven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536673026074 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/test/java/org/apache/maven/scm/provider/ScmUrlUtilsTest.java0000644000175000017500000001027410535556312032021 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ import junit.framework.TestCase; /** * @author Dennis Lundberg * @version $Id: ScmUrlUtilsTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ScmUrlUtilsTest extends TestCase { private static final String SCM_URL_CVS_COLON = "scm:cvs:local:repository:module"; private static final String SCM_URL_CVS_PIPE = "scm:cvs|local|repository|module"; private static final String SCM_URL_CVS_INVALID = "scm|cvs|local|repository|module"; private static final String SCM_URL_INVALID_1 = null; private static final String SCM_URL_INVALID_2 = "scm"; private static final String SCM_URL_INVALID_3 = "scm:a"; private static final String SCM_URL_INVALID_4 = "scm:a-"; private static final String SCM_URL_VALID_1 = "scm:a:"; private static final String SCM_URL_VALID_2 = "scm:a|"; private static final String SCM_URL_VALID_3 = "scm:a:provider-specific-part"; private static final String SCM_URL_VALID_4 = "scm:a|provider-specific-part"; public void testGetDelimiter() throws Exception { assertEquals( ":", ScmUrlUtils.getDelimiter( SCM_URL_CVS_COLON ) ); assertEquals( "|", ScmUrlUtils.getDelimiter( SCM_URL_CVS_PIPE ) ); assertEquals( "|", ScmUrlUtils.getDelimiter( SCM_URL_CVS_INVALID ) ); } public void testGetProvider() throws Exception { assertEquals( "cvs", ScmUrlUtils.getProvider( SCM_URL_CVS_COLON ) ); assertEquals( "cvs", ScmUrlUtils.getProvider( SCM_URL_CVS_PIPE ) ); assertEquals( "cvs", ScmUrlUtils.getProvider( SCM_URL_CVS_INVALID ) ); assertEquals( "a", ScmUrlUtils.getProvider( SCM_URL_VALID_1 ) ); assertEquals( "a", ScmUrlUtils.getProvider( SCM_URL_VALID_2 ) ); assertEquals( "a", ScmUrlUtils.getProvider( SCM_URL_VALID_3 ) ); assertEquals( "a", ScmUrlUtils.getProvider( SCM_URL_VALID_4 ) ); } public void testGetProviderSpecificPart() throws Exception { assertEquals( "local:repository:module", ScmUrlUtils.getProviderSpecificPart( SCM_URL_CVS_COLON ) ); assertEquals( "local|repository|module", ScmUrlUtils.getProviderSpecificPart( SCM_URL_CVS_PIPE ) ); assertEquals( "local|repository|module", ScmUrlUtils.getProviderSpecificPart( SCM_URL_CVS_INVALID ) ); assertEquals( "", ScmUrlUtils.getProviderSpecificPart( SCM_URL_VALID_1 ) ); assertEquals( "", ScmUrlUtils.getProviderSpecificPart( SCM_URL_VALID_2 ) ); assertEquals( "provider-specific-part", ScmUrlUtils.getProviderSpecificPart( SCM_URL_VALID_3 ) ); assertEquals( "provider-specific-part", ScmUrlUtils.getProviderSpecificPart( SCM_URL_VALID_4 ) ); } public void testIsValid() throws Exception { assertTrue( ScmUrlUtils.isValid( SCM_URL_CVS_COLON ) ); assertTrue( ScmUrlUtils.isValid( SCM_URL_CVS_PIPE ) ); assertFalse( ScmUrlUtils.isValid( SCM_URL_CVS_INVALID ) ); assertTrue( ScmUrlUtils.isValid( SCM_URL_VALID_1 ) ); assertTrue( ScmUrlUtils.isValid( SCM_URL_VALID_2 ) ); assertTrue( ScmUrlUtils.isValid( SCM_URL_VALID_3 ) ); assertFalse( ScmUrlUtils.isValid( SCM_URL_INVALID_1 ) ); assertFalse( ScmUrlUtils.isValid( SCM_URL_INVALID_2 ) ); assertFalse( ScmUrlUtils.isValid( SCM_URL_INVALID_3 ) ); assertFalse( ScmUrlUtils.isValid( SCM_URL_INVALID_4 ) ); } } maven-scm-1.3/maven-scm-api/src/main/0000755000175000017500000000000011345536673017366 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/0000755000175000017500000000000011345536673020307 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/0000755000175000017500000000000011345536673021076 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/0000755000175000017500000000000011345536673022317 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/0000755000175000017500000000000011345536673023425 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536673024207 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRevision.java0000644000175000017500000000240311203073254027272 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmRevision.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ScmRevision extends AbstractScmVersion { private static final long serialVersionUID = 3831426256650754391L; /** {@inheritDoc} */ public String getType() { return "Revision"; } public ScmRevision( String name ) { super( name ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/0000755000175000017500000000000011345536673025621 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/BasicScmManager.java0000644000175000017500000000235111157300235031424 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.log.ScmLogger; /** * @author Emmanuel Venisse * @version $Id: BasicScmManager.java 754778 2009-03-15 22:26:37Z olamy $ */ public class BasicScmManager extends AbstractScmManager { /** {@inheritDoc} */ protected ScmLogger getScmLogger() { return new DefaultLog(); } }maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java0000644000175000017500000006307511157300235030474 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.Date; import java.util.List; /** * @author Trygve Laugstøl * @author Brett Porter * @author Emmanuel Venisse * @version $Id: ScmManager.java 754778 2009-03-15 22:26:37Z olamy $ */ public interface ScmManager { String ROLE = ScmManager.class.getName(); // ---------------------------------------------------------------------- // Repository // ---------------------------------------------------------------------- /** * Generate a SCMRepository from a SCM url. * * @param scmUrl the scm url * @return The scm repository * @throws ScmRepositoryException if an error occurs in the scm repository construction * @throws NoSuchScmProviderException if the provider doesn't exist */ ScmRepository makeScmRepository( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException; ScmRepository makeProviderScmRepository( String providerType, File path ) throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException; /** * Validate a SCM URL. * * @param scmUrl the SCM URL to validate * @return List of String objects with the messages returned by the SCM provider */ List validateScmRepository( String scmUrl ); ScmProvider getProviderByUrl( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException; /** * Returns the default provider registered for this providerType or a specific implementation if the * 'maven.scm.provider.providerType.implementation' system property is defined. * For example: maven.scm.provider.cvs.implementation=cvs_native * * @param providerType The provider type (cvs, svn...) * @return The scm provider * @throws NoSuchScmProviderException if the provider doesn't exist */ ScmProvider getProviderByType( String providerType ) throws NoSuchScmProviderException; ScmProvider getProviderByRepository( ScmRepository repository ) throws NoSuchScmProviderException; /** * Set a provider to be used for a type of SCM. * If there was already a designed provider for that type it will be replaced. * * @param providerType the type of SCM, eg. svn, cvs * @param provider the provider that will be used for that SCM type */ void setScmProvider( String providerType, ScmProvider provider ); /** * Set the provider implementation * * @param providerType The provider type, eg. cvs * @param providerImplementation The provider implementation (the role-hint of the provider), * eg. cvs, cvs_native */ void setScmProviderImplementation( String providerType, String providerImplementation ); /** * Adds the given files to the source control system * * @param repository the source control system * @param fileSet the files to be added * @return an {@link org.apache.maven.scm.command.add.AddScmResult} that contains the files that have been added * @throws org.apache.maven.scm.ScmException * */ AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Adds the given files to the source control system * * @param repository the source control system * @param fileSet the files to be added * @param message a string that is a comment on the new added file * @return an {@link AddScmResult} that contains the files that have been added * @throws ScmException if any */ AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Branch (or label in some systems) will create a branch of the source file with a certain branch name * * @param repository the source control system * @param fileSet the files to branch. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param branchName the branch name to apply to the files * @return * @throws ScmException if any */ BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException; /** * Branch (or label in some systems) will create a branch of the source file with a certain branch name * * @param repository the source control system * @param fileSet the files to branch. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param branchName the branch name to apply to the files * @param message the commit message used for the tag creation * @return * @throws ScmException if any */ BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag * @param datePattern the date pattern use in changelog output returned by scm tool * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startVersion the start branch/tag/revision * @param endVersion the end branch/tag/revision * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startRevision the start revision * @param endRevision the end revision * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern ) throws ScmException; /** * Save the changes you have done into the repository. This will create a new version of the file or * directory in the repository. *

* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet * are committed. * * @param repository the source control system * @param fileSet the files to check in (sometimes called commit) * @param message a string that is a comment on the changes that where done * @return * @throws ScmException if any */ CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Save the changes you have done into the repository. This will create a new version of the file or * directory in the repository. *

* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet * are committed. * * @param repository the source control system * @param fileSet the files to check in (sometimes called commit) * @param revision branch/tag/revision * @param message a string that is a comment on the changes that where done * @return * @throws ScmException if any */ CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) throws ScmException; /** * Create a copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Create a copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the revision, branch or tag * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Create a copy of the repository on your local machine. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param recursive whether to check out recursively * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, boolean recursive ) throws ScmException; /** * Create a copy of the repository on your local machine. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the revision, branch or tag * @param recursive whether to check out recursively * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version, boolean recursive ) throws ScmException; /** * Create a diff between two branch/tag/revision. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param startVersion the start branch/tag/revision * @param endVersion the end branch/tag/revision * @return * @throws ScmException if any */ DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException; /** * Make a file editable. This is used in source control systems where you look at read-only files * and you need to make them not read-only anymore before you can edit them. This can also mean * that no other user in the system can make the file not read-only anymore. * * @param repository the source control system * @param fileSet the files to make editable * @return * @throws ScmException if any */ EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the branch/tag/revision * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param outputDirectory the directory where the export will be stored * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String outputDirectory ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the branch/tag/revision * @param outputDirectory the directory where the export will be stored * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException; /** * List each element (files and directories) of fileSet as they exist in the repository. * * @param repository the source control system * @param fileSet the files to list * @param recursive descend recursively * @param version use the version defined by the branch/tag/revision * @return the list of files in the repository */ ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException; /** * Removes the given files from the source control system * * @param repository the source control system * @param fileSet the files to be removed * @param message * @return * @throws ScmException if any */ RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Returns the status of the files in the source control system. The state of each file can be one * of the {@link org.apache.maven.scm.ScmFileStatus} flags. * * @param repository the source control system * @param fileSet the files to know the status about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @return * @throws ScmException if any */ StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Tag (or label in some systems) will tag the source file with a certain tag * * @param repository the source control system * @param fileSet the files to tag. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param tagName the tag name to apply to the files * @return * @throws ScmException if any */ TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) throws ScmException; /** * Tag (or label in some systems) will tag the source file with a certain tag * * @param repository the source control system * @param fileSet the files to tag. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param tagName the tag name to apply to the files * @param message the commit message used for the tag creation * @return * @throws ScmException if any */ TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException; /** * Make a file no longer editable. This is the conterpart of * {@link #edit(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)}. * It makes the file read-only again. * * @param repository the source control system * @param fileSet the files to make uneditable * @return * @throws ScmException if any */ UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param runChangelog Run the changelog command after the update * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param runChangelog Run the changelog command after the update * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param lastUpdate * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param lastUpdate * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param lastUpdate Date of last update * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param lastUpdate Date of last update * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern ) throws ScmException; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/NoSuchScmProviderException.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/NoSuchScmProviderException.ja0000644000175000017500000000301211157300235033345 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import org.apache.maven.scm.ScmException; /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @version $Id: NoSuchScmProviderException.java 754778 2009-03-15 22:26:37Z olamy $ */ public class NoSuchScmProviderException extends ScmException { static final long serialVersionUID = 4770645185214496323L; private String providerName; public NoSuchScmProviderException( String providerName ) { super( "No such provider: '" + providerName + "'." ); this.providerName = providerName; } public String getProviderName() { return providerName; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java0000644000175000017500000005076011157300235032155 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.ScmUrlUtils; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * @author Trygve Laugstøl * @author Brett Porter * @author Emmanuel Venisse * @version $Id: AbstractScmManager.java 754778 2009-03-15 22:26:37Z olamy $ */ public abstract class AbstractScmManager implements ScmManager { private Map scmProviders = new HashMap(); private ScmLogger logger; private Map userProviderTypes = new HashMap(); protected void setScmProviders( Map/**/ providers ) { this.scmProviders = providers; } /** * @deprecated use {@link #setScmProvider(String,ScmProvider)} instead */ protected void addScmProvider( String providerType, ScmProvider provider ) { setScmProvider( providerType, provider ); } /** * Set a provider to be used for a type of SCM. * If there was already a designed provider for that type it will be replaced. * * @param providerType the type of SCM, eg. svn, cvs * @param provider the provider that will be used for that SCM type */ public void setScmProvider( String providerType, ScmProvider provider ) { scmProviders.put( providerType, provider ); } protected abstract ScmLogger getScmLogger(); // ---------------------------------------------------------------------- // ScmManager Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public ScmProvider getProviderByUrl( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException { if ( scmUrl == null ) { throw new NullPointerException( "The scm url cannot be null." ); } String providerType = ScmUrlUtils.getProvider( scmUrl ); return getProviderByType( providerType ); } /** {@inheritDoc} */ public void setScmProviderImplementation( String providerType, String providerImplementation ) { userProviderTypes.put( providerType, providerImplementation ); } /** {@inheritDoc} */ public ScmProvider getProviderByType( String providerType ) throws NoSuchScmProviderException { if ( logger == null ) { logger = getScmLogger(); for ( Iterator i = scmProviders.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); ScmProvider p = (ScmProvider) scmProviders.get( key ); p.addListener( logger ); } } String usedProviderType = System.getProperty( "maven.scm.provider." + providerType + ".implementation" ); if ( usedProviderType == null ) { if ( userProviderTypes.containsKey( providerType ) ) { usedProviderType = (String) userProviderTypes.get( providerType ); } else { usedProviderType = providerType; } } ScmProvider scmProvider = (ScmProvider) scmProviders.get( usedProviderType ); if ( scmProvider == null ) { throw new NoSuchScmProviderException( usedProviderType ); } return scmProvider; } /** {@inheritDoc} */ public ScmProvider getProviderByRepository( ScmRepository repository ) throws NoSuchScmProviderException { return getProviderByType( repository.getProvider() ); } // ---------------------------------------------------------------------- // Repository // ---------------------------------------------------------------------- /** {@inheritDoc} */ public ScmRepository makeScmRepository( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException { if ( scmUrl == null ) { throw new NullPointerException( "The scm url cannot be null." ); } char delimiter = ScmUrlUtils.getDelimiter( scmUrl ).charAt( 0 ); String providerType = ScmUrlUtils.getProvider( scmUrl ); ScmProvider provider = getProviderByType( providerType ); String scmSpecificUrl = cleanScmUrl( scmUrl.substring( providerType.length() + 5 ) ); ScmProviderRepository providerRepository = provider.makeProviderScmRepository( scmSpecificUrl, delimiter ); return new ScmRepository( providerType, providerRepository ); } /** * Clean the SCM url by removing all ../ in path * * @param scmUrl the SCM url * @return the cleaned SCM url */ protected String cleanScmUrl( String scmUrl ) { if ( scmUrl == null ) { throw new NullPointerException( "The scm url cannot be null." ); } String pathSeparator = ""; int indexOfDoubleDot = -1; // Clean Unix path if ( scmUrl.indexOf( "../" ) > 1 ) { pathSeparator = "/"; indexOfDoubleDot = scmUrl.indexOf( "../" ); } // Clean windows path if ( scmUrl.indexOf( "..\\" ) > 1 ) { pathSeparator = "\\"; indexOfDoubleDot = scmUrl.indexOf( "..\\" ); } if ( indexOfDoubleDot > 1 ) { int startOfTextToRemove = scmUrl.substring( 0, indexOfDoubleDot - 1 ).lastIndexOf( pathSeparator ); String beginUrl = ""; if ( startOfTextToRemove >= 0 ) { beginUrl = scmUrl.substring( 0, startOfTextToRemove ); } String endUrl = scmUrl.substring( indexOfDoubleDot + 3 ); scmUrl = beginUrl + pathSeparator + endUrl; // Check if we have other double dot if ( scmUrl.indexOf( "../" ) > 1 || scmUrl.indexOf( "..\\" ) > 1 ) { scmUrl = cleanScmUrl( scmUrl ); } } return scmUrl; } /** {@inheritDoc} */ public ScmRepository makeProviderScmRepository( String providerType, File path ) throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException { if ( providerType == null ) { throw new NullPointerException( "The provider type cannot be null." ); } ScmProvider provider = getProviderByType( providerType ); ScmProviderRepository providerRepository = provider.makeProviderScmRepository( path ); return new ScmRepository( providerType, providerRepository ); } /** {@inheritDoc} */ public List validateScmRepository( String scmUrl ) { List messages = new ArrayList(); messages.addAll( ScmUrlUtils.validate( scmUrl ) ); String providerType = ScmUrlUtils.getProvider( scmUrl ); ScmProvider provider; try { provider = getProviderByType( providerType ); } catch ( NoSuchScmProviderException e ) { messages.add( "No such provider installed '" + providerType + "'." ); return messages; } String scmSpecificUrl = cleanScmUrl( scmUrl.substring( providerType.length() + 5 ) ); List providerMessages = provider.validateScmUrl( scmSpecificUrl, ScmUrlUtils.getDelimiter( scmUrl ).charAt( 0 ) ); if ( providerMessages == null ) { throw new RuntimeException( "The SCM provider cannot return null from validateScmUrl()." ); } messages.addAll( providerMessages ); return messages; } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).add( repository, fileSet ); } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).add( repository, fileSet, message ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException { return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException { return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName, message ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startDate, endDate, numDays, branch ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startDate, endDate, numDays, branch, datePattern ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startVersion, endVersion ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startRevision, endRevision, datePattern ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).checkIn( repository, fileSet, message ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) throws ScmException { return this.getProviderByRepository( repository ).checkIn( repository, fileSet, revision, message ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, boolean recursive ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, recursive ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version, recursive ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return this.getProviderByRepository( repository ).diff( repository, fileSet, startVersion, endVersion ); } /** {@inheritDoc} */ public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).edit( repository, fileSet ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet, version ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String outputDirectory ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet, (ScmVersion) null, outputDirectory ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet, version, outputDirectory ); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).list( repository, fileSet, recursive, version ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).remove( repository, fileSet, message ); } /** {@inheritDoc} */ public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).status( repository, fileSet ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) throws ScmException { return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException { return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName, message ); } /** {@inheritDoc} */ public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).unedit( repository, fileSet ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate, datePattern ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/0000755000175000017500000000000011345536673025625 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java0000644000175000017500000000476611050560477031537 0ustar twernertwernerpackage org.apache.maven.scm.command; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractCommand implements Command { private ScmLogger logger; protected abstract ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException; /** {@inheritDoc} */ public final ScmResult execute( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { if ( repository == null ) { throw new NullPointerException( "repository cannot be null" ); } if ( fileSet == null ) { throw new NullPointerException( "fileSet cannot be null" ); } try { return executeCommand( repository, fileSet, parameters ); } catch ( Exception ex ) { throw new ScmException( "Exception while executing SCM command.", ex ); } } /** {@inheritDoc} */ public final ScmLogger getLogger() { return logger; } /** {@inheritDoc} */ public final void setLogger( ScmLogger logger ) { this.logger = logger; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/0000755000175000017500000000000011345536673026735 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/AbstractLoginCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/AbstractLoginCommand.ja0000644000175000017500000000355011050560477033277 0ustar twernertwernerpackage org.apache.maven.scm.command.login; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @version $Id: AbstractLoginCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractLoginCommand extends AbstractCommand { public abstract LoginScmResult executeLoginCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException; /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeLoginCommand( repository, fileSet, parameters ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/login/LoginScmResult.java0000644000175000017500000000241610535556312032505 0ustar twernertwernerpackage org.apache.maven.scm.command.login; /* * 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. */ import org.apache.maven.scm.ScmResult; /** * @author Emmanuel Venisse * @version $Id: LoginScmResult.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class LoginScmResult extends ScmResult { public LoginScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock/0000755000175000017500000000000011345536673026555 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock/AbstractLockCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock/AbstractLockCommand.java0000644000175000017500000000374510604473233033271 0ustar twernertwernerpackage org.apache.maven.scm.command.lock; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractLockCommand.java 525180 2007-04-03 15:45:31Z evenisse $ */ public abstract class AbstractLockCommand extends AbstractCommand { protected abstract ScmResult executeLockCommand( ScmProviderRepository repository, File workingDirectory, String filename ) throws ScmException; public ScmResult executeCommand( ScmProviderRepository repository, File workingDirectory, CommandParameters parameters ) throws ScmException { String file = parameters.getString( CommandParameter.FILE ); return executeLockCommand( repository, workingDirectory, file ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/0000755000175000017500000000000011345536673027062 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/BranchScmResult.java0000644000175000017500000000333510605466756032772 0ustar twernertwernerpackage org.apache.maven.scm.command.branch; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: BranchScmResult.java 526209 2007-04-06 15:57:34Z evenisse $ */ public class BranchScmResult extends ScmResult { private List branchedFiles; public BranchScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public BranchScmResult( String commandLine, List branchedFiles ) { super( commandLine, null, null, true ); this.branchedFiles = branchedFiles; } public BranchScmResult( List branchedFiles, ScmResult result ) { super( result ); this.branchedFiles = branchedFiles; } public List getBranchedFiles() { return branchedFiles; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.0000644000175000017500000000626411313217053033232 0ustar twernertwernerpackage org.apache.maven.scm.command.branch; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractBranchCommand.java 892494 2009-12-19 18:40:43Z olamy $ */ public abstract class AbstractBranchCommand extends AbstractCommand { protected abstract ScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException; /** * default impl to provide backward comp * @since 1.3 * @param repository * @param fileSet * @param branchName * @param scmBranchParameters * @return * @throws ScmException */ protected ScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet, String branchName, ScmBranchParameters scmBranchParameters ) throws ScmException { return executeBranchCommand( repository, fileSet, branchName, scmBranchParameters.getMessage() ); } /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { String branchName = parameters.getString( CommandParameter.BRANCH_NAME ); ScmBranchParameters scmBranchParameters = parameters.getScmBranchParameters( CommandParameter.SCM_BRANCH_PARAMETERS ); String message = parameters.getString( CommandParameter.MESSAGE, "[maven-scm] copy for branch " + branchName ); if (StringUtils.isBlank( scmBranchParameters.getMessage()) && StringUtils.isNotBlank( message ) ) { scmBranchParameters.setMessage( message ); } return executeBranchCommand( repository, fileSet, branchName, scmBranchParameters ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/0000755000175000017500000000000011345536673027107 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResult.java0000644000175000017500000000405610575247737033047 0ustar twernertwernerpackage org.apache.maven.scm.command.update; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: UpdateScmResult.java 517196 2007-03-12 13:04:31Z evenisse $ */ public class UpdateScmResult extends ScmResult { private List updatedFiles; private List changes; public UpdateScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public UpdateScmResult( String commandLine, List updatedFiles ) { super( commandLine, null, null, true ); this.updatedFiles = updatedFiles; } public UpdateScmResult( List updatedFiles, List changes, ScmResult result ) { super( result ); this.updatedFiles = updatedFiles; this.changes = changes; } public List getUpdatedFiles() { return updatedFiles; } public List getChanges() { if ( changes == null ) { return new ArrayList(); } return changes; } public void setChanges( List changes ) { this.changes = changes; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResultWithRevision.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResultWithRev0000644000175000017500000000374510535556312033430 0ustar twernertwernerpackage org.apache.maven.scm.command.update; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @version $Id: UpdateScmResultWithRevision.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class UpdateScmResultWithRevision extends UpdateScmResult { private String revision; public UpdateScmResultWithRevision( String commandLine, String providerMessage, String commandOutput, String revision, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); this.revision = revision; } public UpdateScmResultWithRevision( String commandLine, List updatedFiles, String revision ) { super( commandLine, updatedFiles ); this.revision = revision; } public UpdateScmResultWithRevision( List updatedFiles, List changes, String revision, ScmResult result ) { super( updatedFiles, changes, result ); this.revision = revision; } public String getRevision() { return revision; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.0000644000175000017500000001114011050560477033302 0ustar twernertwernerpackage org.apache.maven.scm.command.update; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractUpdateCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractUpdateCommand extends AbstractCommand { protected abstract UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null ); boolean runChangelog = Boolean.valueOf( parameters.getString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, "true" ) ).booleanValue(); UpdateScmResult updateScmResult = executeUpdateCommand( repository, fileSet, scmVersion ); List filesList = updateScmResult.getUpdatedFiles(); if ( !runChangelog ) { return updateScmResult; } ChangeLogCommand changeLogCmd = getChangeLogCommand(); if ( filesList != null && filesList.size() > 0 && changeLogCmd != null ) { ChangeLogScmResult changeLogScmResult = (ChangeLogScmResult) changeLogCmd.executeCommand( repository, fileSet, parameters ); List changes = new ArrayList(); ChangeLogSet changeLogSet = changeLogScmResult.getChangeLog(); if ( changeLogSet != null ) { Date startDate = null; try { startDate = parameters.getDate( CommandParameter.START_DATE ); } catch ( ScmException e ) { //Do nothing, startDate isn't define. } for ( Iterator i = changeLogSet.getChangeSets().iterator(); i.hasNext(); ) { ChangeSet change = (ChangeSet) i.next(); if ( startDate != null && change.getDate() != null ) { if ( startDate.after( change.getDate() ) ) { continue; } } for ( Iterator j = filesList.iterator(); j.hasNext(); ) { ScmFile currentFile = (ScmFile) j.next(); if ( change.containsFilename( currentFile.getPath(), repository ) ) { changes.add( change ); break; } } } } updateScmResult.setChanges( changes ); } return updateScmResult; } protected abstract ChangeLogCommand getChangeLogCommand(); } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/Command.java0000644000175000017500000000361311050560477030041 0ustar twernertwernerpackage org.apache.maven.scm.command; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: Command.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public interface Command { /** Plexus component key */ String ROLE = Command.class.getName(); /** * @param repository not null * @param fileSet not null * @param parameters could be null * @return the result object * @throws ScmException if any */ ScmResult execute( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException; /** * @param logger not null */ void setLogger( ScmLogger logger ); /** * @return the current logger */ ScmLogger getLogger(); } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/0000755000175000017500000000000011345536673027432 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutComm0000644000175000017500000000672211057002547033355 0ustar twernertwernerpackage org.apache.maven.scm.command.checkout; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCheckOutCommand.java 690992 2008-09-01 15:08:23Z vsiveton $ */ public abstract class AbstractCheckOutCommand extends AbstractCommand { /** * Execute Check out command line in a recursive check out way. * * @param repository not null * @param fileSet not null * @param scmVersion not null * @return the checkout result * @throws ScmException if any * @see #executeCheckOutCommand(ScmProviderRepository, ScmFileSet, ScmVersion, boolean) */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException { return executeCheckOutCommand( repository, fileSet, scmVersion, true ); } /** * Execute Check out command line. * * @param repository not null * @param fileSet not null * @param scmVersion not null * @param recursive true if recursive check out is wanted, false otherwise. * @return the checkout result * @throws ScmException if any * @since 1.1.1 */ protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, boolean recursive ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null ); String recursiveParam = parameters.getString( CommandParameter.RECURSIVE, null ); if ( recursiveParam != null ) { boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE ); return executeCheckOutCommand( repository, fileSet, scmVersion, recursive ); } return executeCheckOutCommand( repository, fileSet, scmVersion ); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.ja0000644000175000017500000000605310600210446033275 0ustar twernertwernerpackage org.apache.maven.scm.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: CheckOutScmResult.java 520837 2007-03-21 11:04:06Z evenisse $ */ public class CheckOutScmResult extends ScmResult { private List checkedOutFiles; /** * The relative path of the directory of the checked out project in comparison to the checkout directory, or * an empty String in case the checkout directory equals the project directory. *

* With most SCMs, this is just an empty String, meaning that the checkout directory equals the project directory. * But there are cases (e.g. ClearCase) where within the checkout directory, the directory structure of the * SCM system is repeated. E.g. if you check out the project "my/project" to "/some/dir", the project sources * are actually checked out to "my/project/some/dir". In this example, relativePathProjectDirectory would * contain "my/project". */ protected String relativePathProjectDirectory = ""; public CheckOutScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public CheckOutScmResult( String commandLine, List checkedOutFiles ) { super( commandLine, null, null, true ); this.checkedOutFiles = checkedOutFiles; } public CheckOutScmResult( String commandLine, List checkedOutFiles, String relativePathProjectDirectory ) { this( commandLine, checkedOutFiles ); if ( relativePathProjectDirectory != null ) { this.relativePathProjectDirectory = relativePathProjectDirectory; } } public CheckOutScmResult( List checkedOutFiles, ScmResult result ) { super( result ); this.checkedOutFiles = checkedOutFiles; } public List getCheckedOutFiles() { return checkedOutFiles; } /** * @return the contents of {@link #relativePathProjectDirectory} * @see #relativePathProjectDirectory */ public String getRelativePathProjectDirectory() { return relativePathProjectDirectory; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/0000755000175000017500000000000011345536673027150 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/AbstractStatusCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/AbstractStatusCommand.0000644000175000017500000000340211050560477033406 0ustar twernertwernerpackage org.apache.maven.scm.command.status; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Brett Porter * @version $Id: AbstractStatusCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractStatusCommand extends AbstractCommand { protected abstract StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeStatusCommand( repository, fileSet ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/StatusScmResult.java0000644000175000017500000000405411046443663033135 0ustar twernertwernerpackage org.apache.maven.scm.command.status; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.Collections; import java.util.List; /** * @author Brett Porter * @version $Id: StatusScmResult.java 683454 2008-08-07 00:54:11Z bentmann $ */ public class StatusScmResult extends ScmResult { private List changedFiles; public StatusScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); this.changedFiles = Collections.EMPTY_LIST; } public StatusScmResult( String commandLine, List changedFiles ) { super( commandLine, null, null, true ); if ( changedFiles == null ) { throw new NullPointerException( "changedFiles can't be null." ); } this.changedFiles = changedFiles; } public StatusScmResult( List changedFiles, ScmResult result ) { super( result ); if ( changedFiles == null ) { throw new NullPointerException( "changedFiles can't be null." ); } this.changedFiles = changedFiles; } public List getChangedFiles() { return changedFiles; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock/0000755000175000017500000000000011345536673027120 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock/AbstractUnlockCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock/AbstractUnlockCommand.0000644000175000017500000000346011051271351033321 0ustar twernertwernerpackage org.apache.maven.scm.command.unlock; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractUnlockCommand.java 686197 2008-08-15 12:13:29Z vsiveton $ */ public abstract class AbstractUnlockCommand extends AbstractCommand { protected abstract ScmResult executeUnlockCommand( ScmProviderRepository repository, File workingDirectory ) throws ScmException; public ScmResult executeCommand( ScmProviderRepository repository, File workingDirectory, CommandParameters parameters ) throws ScmException { return executeUnlockCommand( repository, workingDirectory ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/0000755000175000017500000000000011345536673027115 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/AbstractUnEditCommand.0000644000175000017500000000327611050560477033271 0ustar twernertwernerpackage org.apache.maven.scm.command.unedit; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @version $Id: AbstractUnEditCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractUnEditCommand extends AbstractCommand { /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeUnEditCommand( repository, fileSet ); } protected abstract ScmResult executeUnEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException; } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/unedit/UnEditScmResult.java0000644000175000017500000000320711050560477033004 0ustar twernertwernerpackage org.apache.maven.scm.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @version $Id: UnEditScmResult.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class UnEditScmResult extends ScmResult { private List unEditFiles; public UnEditScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public UnEditScmResult( String commandLine, List unEditFiles ) { super( commandLine, null, null, true ); this.unEditFiles = unEditFiles; } public UnEditScmResult( List unEditFiles, ScmResult result ) { super( result ); this.unEditFiles = unEditFiles; } public List getUnEditFiles() { return unEditFiles; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/0000755000175000017500000000000011345536673027146 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/ExportScmResult.java0000644000175000017500000000310510600001076033104 0ustar twernertwernerpackage org.apache.maven.scm.command.export; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: ExportScmResult.java 520441 2007-03-20 15:48:14Z evenisse $ */ public class ExportScmResult extends ScmResult { private List exportedFiles; public ExportScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public ExportScmResult( String commandLine, List updatedFiles ) { super( commandLine, null, null, true ); this.exportedFiles = updatedFiles; } public List getExportedFiles() { return exportedFiles; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/AbstractExportCommand.0000644000175000017500000000426211050560477033407 0ustar twernertwernerpackage org.apache.maven.scm.command.export; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @version $Id: AbstractExportCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractExportCommand extends AbstractCommand { protected abstract ExportScmResult executeExportCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, String outputDirectory ) throws ScmException; /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null ); String outputDirectory = parameters.getString( CommandParameter.OUTPUT_DIRECTORY, null ); return executeExportCommand( repository, fileSet, scmVersion, outputDirectory ); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/ExportScmResultWithRevision.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/export/ExportScmResultWithRev0000644000175000017500000000325210600001076033500 0ustar twernertwernerpackage org.apache.maven.scm.command.export; /* * 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. */ import java.util.List; /** * @author Emmanuel Venisse * @version $Id: ExportScmResultWithRevision.java 520441 2007-03-20 15:48:14Z evenisse $ */ public class ExportScmResultWithRevision extends ExportScmResult { private String revision; public ExportScmResultWithRevision( String commandLine, String providerMessage, String commandOutput, String revision, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); this.revision = revision; } public ExportScmResultWithRevision( String commandLine, List exportedFiles, String revision ) { super( commandLine, exportedFiles ); this.revision = revision; } public String getRevision() { return revision; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/0000755000175000017500000000000011345536673027122 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/RemoveScmResult.java0000644000175000017500000000331510535556312033056 0ustar twernertwernerpackage org.apache.maven.scm.command.remove; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Brett Porter * @version $Id: RemoveScmResult.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class RemoveScmResult extends ScmResult { private List removedFiles; public RemoveScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public RemoveScmResult( String commandLine, List removedFiles ) { super( commandLine, null, null, true ); this.removedFiles = removedFiles; } public RemoveScmResult( List removedFiles, ScmResult result ) { super( result ); this.removedFiles = removedFiles; } public List getRemovedFiles() { return removedFiles; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/AbstractRemoveCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/AbstractRemoveCommand.0000644000175000017500000000403311050560477033333 0ustar twernertwernerpackage org.apache.maven.scm.command.remove; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractRemoveCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractRemoveCommand extends AbstractCommand { protected abstract ScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { String message = parameters.getString( CommandParameter.MESSAGE ); return executeRemoveCommand( repository, fileSet, message ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/0000755000175000017500000000000011345536673026400 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java0000644000175000017500000000644111176266046032742 0ustar twernertwernerpackage org.apache.maven.scm.command.tag; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractTagCommand.java 770123 2009-04-30 09:15:18Z olamy $ */ public abstract class AbstractTagCommand extends AbstractCommand { /** * @deprecated use method {@link #executeTagCommand(ScmProviderRepository, ScmFileSet, String, ScmTagParameters)} * @param repository * @param fileSet * @param tagName * @param message * @return * @throws ScmException */ protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException { return executeTagCommand( repository, fileSet, tagName, new ScmTagParameters( message ) ); } protected abstract ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { String tagName = parameters.getString( CommandParameter.TAG_NAME ); ScmTagParameters scmTagParameters = parameters.getScmTagParameters( CommandParameter.SCM_TAG_PARAMETERS ); String message = parameters.getString( CommandParameter.MESSAGE, null ); if ( message != null ) { // if message was passed by CommandParameter.MESSAGE then use it. scmTagParameters.setMessage( message ); } if ( scmTagParameters.getMessage() == null ) { // if message hasn't been passed nor by ScmTagParameters nor by CommandParameter.MESSAGE then use default. scmTagParameters.setMessage( "[maven-scm] copy for tag " + tagName ); } return executeTagCommand( repository, fileSet, tagName, scmTagParameters ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/TagScmResult.java0000644000175000017500000000327410535556312031616 0ustar twernertwernerpackage org.apache.maven.scm.command.tag; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: TagScmResult.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class TagScmResult extends ScmResult { private List taggedFiles; public TagScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public TagScmResult( String commandLine, List taggedFiles ) { super( commandLine, null, null, true ); this.taggedFiles = taggedFiles; } public TagScmResult( List taggedFiles, ScmResult result ) { super( result ); this.taggedFiles = taggedFiles; } public List getTaggedFiles() { return taggedFiles; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/0000755000175000017500000000000011345536673027231 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInComman0000644000175000017500000000435711050560477033300 0ustar twernertwernerpackage org.apache.maven.scm.command.checkin; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCheckInCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractCheckInCommand extends AbstractCommand { public static final String NAME = "check-in"; protected abstract CheckInScmResult executeCheckInCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, ScmVersion scmVersion ) throws ScmException; public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { String message = parameters.getString( CommandParameter.MESSAGE ); ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null ); return executeCheckInCommand( repository, fileSet, message, scmVersion ); } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/CheckInScmResult.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/CheckInScmResult.java0000644000175000017500000000441011157547031033230 0ustar twernertwernerpackage org.apache.maven.scm.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: CheckInScmResult.java 755019 2009-03-16 22:09:29Z olamy $ */ public class CheckInScmResult extends ScmResult { private List checkedInFiles; private String scmRevision; public CheckInScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public CheckInScmResult( String commandLine, List checkedInFiles ) { super( commandLine, null, null, true ); this.checkedInFiles = checkedInFiles; } /** * @param commandLine * @param checkedInFiles * @param scmRevision * @since 1.2 */ public CheckInScmResult( String commandLine, List checkedInFiles, String scmRevision ) { this( commandLine, checkedInFiles ); this.scmRevision = scmRevision; } public CheckInScmResult( List checkedInFiles, ScmResult result ) { super( result ); this.checkedInFiles = checkedInFiles; } public List getCheckedInFiles() { return checkedInFiles; } /** * @since 1.2 * @return can be null for some providers (implemented at least for svn) */ public String getScmRevision() { return scmRevision; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/0000755000175000017500000000000011345536673026600 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/ListScmResult.java0000644000175000017500000000375611051271351032212 0ustar twernertwernerpackage org.apache.maven.scm.command.list; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.ArrayList; import java.util.List; /** * Result of {@link org.apache.maven.scm.provider.ScmProvider#list(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet, boolean, org.apache.maven.scm.ScmVersion)} operation * * @author Carlos Sanchez * @version $Id: ListScmResult.java 686197 2008-08-15 12:13:29Z vsiveton $ */ public class ListScmResult extends ScmResult { // XXX List of what? private List files; public ListScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); files = new ArrayList( 0 ); } public ListScmResult( String commandLine, List/**/ files ) { super( commandLine, null, null, true ); this.files = files; } public ListScmResult( List/**/ files, ScmResult result ) { super( result ); this.files = files; } // XXX List of what? public List/**/ getFiles() { return files; } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/list/AbstractListCommand.java0000644000175000017500000000504611050560477033336 0ustar twernertwernerpackage org.apache.maven.scm.command.list; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Carlos Sanchez * @version $Id: AbstractListCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractListCommand extends AbstractCommand { /** * List contents of the remote repository * * @param repository what to list * @param fileSet the files to list * @param recursive whether list should return subfolder listing * @return the list of files * @throws ScmException */ protected abstract ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion scmVersion ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { if ( fileSet.getFileList().isEmpty() ) { throw new IllegalArgumentException( "fileSet can not be empty" ); } boolean recursive = parameters.getBoolean( CommandParameter.RECURSIVE ); ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null ); return executeListCommand( repository, fileSet, recursive, scmVersion ); } }maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/0000755000175000017500000000000011345536673026552 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/AbstractEditCommand.java0000644000175000017500000000326411050560477033262 0ustar twernertwernerpackage org.apache.maven.scm.command.edit; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @version $Id: AbstractEditCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractEditCommand extends AbstractCommand { /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeEditCommand( repository, fileSet ); } protected abstract ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException; } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/edit/EditScmResult.java0000644000175000017500000000315111050560477032134 0ustar twernertwernerpackage org.apache.maven.scm.command.edit; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; /** * @version $Id: EditScmResult.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class EditScmResult extends ScmResult { private List editFiles; public EditScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public EditScmResult( String commandLine, List editFiles ) { super( commandLine, null, null, true ); this.editFiles = editFiles; } public EditScmResult( List editFiles, ScmResult result ) { super( result ); this.editFiles = editFiles; } public List getEditFiles() { return editFiles; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo/0000755000175000017500000000000011345536673027420 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo/AbstractFileInfoCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo/AbstractFileInfoComm0000644000175000017500000000377510604473233033337 0ustar twernertwernerpackage org.apache.maven.scm.command.fileinfo; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractFileInfoCommand.java 525180 2007-04-03 15:45:31Z evenisse $ */ public abstract class AbstractFileInfoCommand extends AbstractCommand { protected abstract ScmResult executeFileInfoCommand( ScmProviderRepository repository, File workingDirectory, String filename ) throws ScmException; public ScmResult executeCommand( ScmProviderRepository repository, File workingDirectory, CommandParameters parameters ) throws ScmException { String file = parameters.getString( CommandParameter.FILE ); return executeFileInfoCommand( repository, workingDirectory, file ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/0000755000175000017500000000000011345536673026535 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java0000644000175000017500000000510711050560477033226 0ustar twernertwernerpackage org.apache.maven.scm.command.diff; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * TODO: Better support for entire filesets. * TODO: Better support for entire changesets (ie consistency between revision handling in CVS and SVN). * TODO: Consistent handling of revisions, tags and dates - currently only revisions supported, though tags will work for CVS * * @author Emmanuel Venisse * @author Trygve Laugstøl * @author Brett Porter * @version $Id: AbstractDiffCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractDiffCommand extends AbstractCommand { protected abstract DiffScmResult executeDiffCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision ) throws ScmException; /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ScmVersion startRevision = parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null ); ScmVersion endRevision = parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null ); return executeDiffCommand( repository, fileSet, startRevision, endRevision ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java0000644000175000017500000000413711046443663032111 0ustar twernertwernerpackage org.apache.maven.scm.command.diff; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.List; import java.util.Map; /** * @author Brett Porter * @version $Id: DiffScmResult.java 683454 2008-08-07 00:54:11Z bentmann $ */ public class DiffScmResult extends ScmResult { private List changedFiles; private Map differences; private String patch; public DiffScmResult( String commandLine, List changedFiles, Map differences, String patch ) { this( commandLine, null, null, true ); this.changedFiles = changedFiles; this.differences = differences; this.patch = patch; } public DiffScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public DiffScmResult( List changedFiles, Map differences, String patch, ScmResult result ) { super( result ); this.changedFiles = changedFiles; this.differences = differences; this.patch = patch; } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/0000755000175000017500000000000011345536673027554 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.0000644000175000017500000000332610535556312033242 0ustar twernertwernerpackage org.apache.maven.scm.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmResult; /** * @author Trygve Laugstøl * @version $Id: ChangeLogScmResult.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ChangeLogScmResult extends ScmResult { private ChangeLogSet changeLog; public ChangeLogScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); } public ChangeLogScmResult( String commandLine, ChangeLogSet changeLog ) { super( commandLine, null, null, true ); this.changeLog = changeLog; } public ChangeLogScmResult( ChangeLogSet changeLog, ScmResult result ) { super( result ); this.changeLog = changeLog; } public ChangeLogSet getChangeLog() { return changeLog; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCo0000644000175000017500000001024311160257765033271 0ustar twernertwernerpackage org.apache.maven.scm.command.changelog; /* * 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. */ import java.util.Date; import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Trygve Laugstøl * @version $Id: AbstractChangeLogCommand.java 755730 2009-03-18 20:56:21Z olamy $ */ public abstract class AbstractChangeLogCommand extends AbstractCommand implements ChangeLogCommand { protected abstract ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException; protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { throw new ScmException( "Unsupported method for this provider." ); } /** {@inheritDoc} */ public ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { Date startDate = parameters.getDate( CommandParameter.START_DATE, null ); Date endDate = parameters.getDate( CommandParameter.END_DATE, null ); int numDays = parameters.getInt( CommandParameter.NUM_DAYS, 0 ); ScmBranch branch = (ScmBranch) parameters.getScmVersion( CommandParameter.BRANCH, null ); ScmVersion startVersion = parameters.getScmVersion( CommandParameter.START_SCM_VERSION, null ); ScmVersion endVersion = parameters.getScmVersion( CommandParameter.END_SCM_VERSION, null ); String datePattern = parameters.getString( CommandParameter.CHANGELOG_DATE_PATTERN, null ); if ( startVersion != null ) { return executeChangeLogCommand( repository, fileSet, startVersion, endVersion, datePattern ); } else { if ( numDays != 0 && ( startDate != null || endDate != null ) ) { throw new ScmException( "Start or end date cannot be set if num days is set." ); } if ( endDate != null && startDate == null ) { throw new ScmException( "The end date is set but the start date isn't." ); } if ( numDays > 0 ) { int day = 24 * 60 * 60 * 1000; startDate = new Date( System.currentTimeMillis() - (long) numDays * day ); endDate = new Date( System.currentTimeMillis() + (long) day ); } else if ( endDate == null ) { endDate = new Date(); } return executeChangeLogCommand( repository, fileSet, startDate, endDate, branch, datePattern ); } } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogCommand.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogCommand.ja0000644000175000017500000000261610535556312033213 0ustar twernertwernerpackage org.apache.maven.scm.command.changelog; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @version $Id: ChangeLogCommand.java 483105 2006-12-06 15:07:54Z evenisse $ */ public interface ChangeLogCommand { ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException; } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogSet.java0000644000175000017500000001312010607125733032706 0ustar twernertwernerpackage org.apache.maven.scm.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmVersion; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: ChangeLogSet.java 527432 2007-04-11 09:35:23Z evenisse $ */ public class ChangeLogSet { public static final String DEFAULT_ENCODING = "ISO-8859-1"; private List/**/ entries; private Date startDate; private Date endDate; private ScmVersion startVersion; private ScmVersion endVersion; /** * Initializes a new instance of this class. * * @param startDate the start date/tag for this set. * @param endDate the end date/tag for this set, or null if this set goes to the present time. */ public ChangeLogSet( Date startDate, Date endDate ) { this.startDate = startDate; this.endDate = endDate; } /** * Initializes a new instance of this class. * * @param entries collection of {@link org.apache.maven.scm.ChangeSet} objects for this set. * @param startDate the start date/tag for this set. * @param endDate the end date/tag for this set, or null if this set goes to the present time. */ public ChangeLogSet( List/**/ entries, Date startDate, Date endDate ) { this( startDate, endDate ); setChangeSets( entries ); } /** * Returns the start date. * * @return the start date. */ public Date getStartDate() { return startDate; } /** * Returns the end date for this set. * * @return the end date for this set, or null if this set goes to the present time. */ public Date getEndDate() { return endDate; } /** * Returns the start version (revision/branch/label) for this set. * * @return the start version (revision/branch/label) for this set, or null. */ public ScmVersion getStartVersion() { return startVersion; } public void setStartVersion( ScmVersion startVersion ) { this.startVersion = startVersion; } /** * Returns the end version (revision/branch/label) for this set. * * @return the end version (revision/branch/label) for this set, or null. */ public ScmVersion getEndVersion() { return endVersion; } public void setEndVersion( ScmVersion endVersion ) { this.endVersion = endVersion; } /** * Returns the collection of changeSet. * * @return the collection of {@link org.apache.maven.scm.ChangeSet} objects for this set. */ public List/**/ getChangeSets() { return entries; } public void setChangeSets( List changeSets ) { this.entries = changeSets; } /** * Creates an XML representation of this change log set with a default encoding (ISO-8859-1). */ public String toXML() { return toXML( DEFAULT_ENCODING ); } /** * Creates an XML representation of this change log set. */ public String toXML( String encoding ) { String encodingString = encoding; if ( encodingString == null ) { encodingString = DEFAULT_ENCODING; } StringBuffer buffer = new StringBuffer(); String pattern = "yyyyMMdd HH:mm:ss z"; SimpleDateFormat formatter = new SimpleDateFormat( pattern ); buffer.append( "\n" ); buffer.append( "\n" ); // Write out the entries for ( Iterator i = getChangeSets().iterator(); i.hasNext(); ) { buffer.append( ( (ChangeSet) i.next() ).toXML() ); } buffer.append( "\n" ); return buffer.toString(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/0000755000175000017500000000000011345536673026355 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AbstractAddCommand.java0000644000175000017500000000400511050560477032662 0ustar twernertwernerpackage org.apache.maven.scm.command.add; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Trygve Laugstøl * @version $Id: AbstractAddCommand.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public abstract class AbstractAddCommand extends AbstractCommand { protected abstract ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary ) throws ScmException; /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeAddCommand( repository, fileSet, parameters.getString( CommandParameter.MESSAGE ), parameters.getBoolean( CommandParameter.BINARY ) ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AddScmResult.java0000644000175000017500000000431210602203560031527 0ustar twernertwernerpackage org.apache.maven.scm.command.add; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.ArrayList; import java.util.List; /** * Result of adding files to the SCM * * @author Brett Porter * @version $Id: AddScmResult.java 522876 2007-03-27 12:00:48Z evenisse $ */ public class AddScmResult extends ScmResult { private List/**/ addedFiles; public AddScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); addedFiles = new ArrayList( 0 ); } public AddScmResult( String commandLine, List/**/ addedFiles ) { this( commandLine, null, null, true ); if ( addedFiles == null ) { throw new NullPointerException( "addedFiles can't be null" ); } this.addedFiles = addedFiles; } public AddScmResult( List/**/ addedFiles, ScmResult result ) { super( result ); if ( addedFiles == null ) { throw new NullPointerException( "addedFiles can't be null" ); } this.addedFiles = addedFiles; } /** * List with all the added files in the SCM operation. * * @return non null list of added files */ public List/**/ getAddedFiles() { return addedFiles; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTag.java0000644000175000017500000000242211203073254026210 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmTag.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ScmTag extends ScmBranch { private static final long serialVersionUID = 2286671802987769257L; /** {@inheritDoc} */ public String getType() { return "Tag"; } /** * @param name not null */ public ScmTag( String name ) { super( name ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTagParameters.java0000644000175000017500000000370111203073254030235 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author olamy * @since 1.2 */ public class ScmTagParameters implements Serializable { private static final long serialVersionUID = 7241536408630606807L; private String message; private boolean remoteTagging = false; private String scmRevision; public ScmTagParameters() { this.remoteTagging = false; } public ScmTagParameters( String message ) { this.message = message; } public String getMessage() { return message; } public void setMessage( String message ) { this.message = message; } public boolean isRemoteTagging() { return remoteTagging; } public void setRemoteTagging( boolean remoteTagging ) { this.remoteTagging = remoteTagging; } public String getScmRevision() { return scmRevision; } public void setScmRevision( String scmRevision ) { this.scmRevision = scmRevision; } public String toString() { return "[" + scmRevision + "] " + message; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/NoSuchCommandScmException.java0000644000175000017500000000267011050560477032067 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: NoSuchCommandScmException.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class NoSuchCommandScmException extends ScmException { static final long serialVersionUID = 5789657554664703221L; private String commandName; public NoSuchCommandScmException( String commandName ) { super( "No such command '" + commandName + "'." ); } /** * Return the command name. * * @return The command name */ public String getCommandName() { return commandName; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java0000644000175000017500000000661011313217053030253 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: CommandParameter.java 892494 2009-12-19 18:40:43Z olamy $ */ public class CommandParameter implements Serializable { private static final long serialVersionUID = -3391190831054016735L; public static final CommandParameter BINARY = new CommandParameter( "binary" ); public static final CommandParameter RECURSIVE = new CommandParameter( "recursive" ); public static final CommandParameter MESSAGE = new CommandParameter( "message" ); public static final CommandParameter BRANCH_NAME = new CommandParameter( "branchName" ); public static final CommandParameter START_DATE = new CommandParameter( "startDate" ); public static final CommandParameter END_DATE = new CommandParameter( "endDate" ); public static final CommandParameter NUM_DAYS = new CommandParameter( "numDays" ); public static final CommandParameter BRANCH = new CommandParameter( "branch" ); public static final CommandParameter START_SCM_VERSION = new CommandParameter( "startScmVersion" ); public static final CommandParameter END_SCM_VERSION = new CommandParameter( "endScmVersion" ); public static final CommandParameter CHANGELOG_DATE_PATTERN = new CommandParameter( "changelogDatePattern" ); public static final CommandParameter SCM_VERSION = new CommandParameter( "scmVersion" ); public static final CommandParameter TAG_NAME = new CommandParameter( "tagName" ); public static final CommandParameter FILE = new CommandParameter( "file" ); public static final CommandParameter FILES = new CommandParameter( "files" ); public static final CommandParameter OUTPUT_FILE = new CommandParameter( "outputFile" ); public static final CommandParameter OUTPUT_DIRECTORY = new CommandParameter( "outputDirectory" ); public static final CommandParameter RUN_CHANGELOG_WITH_UPDATE = new CommandParameter( "run_changelog_with_update" ); public static final CommandParameter SCM_TAG_PARAMETERS = new CommandParameter( "ScmTagParameters" ); public static final CommandParameter SCM_BRANCH_PARAMETERS = new CommandParameter( "ScmBranchParameters" ); /** * Parameter name */ private String name; /** * @param name The parameter name */ private CommandParameter( String name ) { this.name = name; } /** * @return The parameter name */ public String getName() { return name; } public String toString() { return name; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java0000644000175000017500000000610611203073254027022 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * A set of information about revisions of a file as returned by CVS's log * command * * @author dIon Gillard * @author Emmanuel Venisse * @version $Id: ChangeFile.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ChangeFile implements Serializable { private static final long serialVersionUID = 6294855290542668753L; /** * the name of the file relative to the project directory. */ private String name; /** * the latest revision of the file. */ private String revision; /** * Constructor for the ChangeFile object without all details available * * @param name file name */ public ChangeFile( String name ) { setName( name ); } /** * Constructor for the ChangeFile object * * @param name file name * @param rev latest revision of the file */ public ChangeFile( String name, String rev ) { setName( name ); setRevision( rev ); } /** * Gets the name attribute of the ChangeLogFile object. * * @return the file name */ public String getName() { return name; } /** * Gets the revision attribute of the ChangeLogFile object. * * @return the latest revision of the file */ public String getRevision() { return revision; } /** * Setter for property name. * * @param name New value of property name. */ public void setName( String name ) { this.name = name; } /** * Setter for property revision. * * @param revision New value of property revision. */ public void setRevision( String revision ) { this.revision = revision; } /** * Provide a version of the object as a string for debugging purposes * * @return a {@link String}made up of the properties of the object */ public String toString() { StringBuffer buffer = new StringBuffer( getName() ); if ( getRevision() != null ) { buffer.append( ", " ).append( getRevision() ); } return buffer.toString(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/AbstractScmVersion.java0000644000175000017500000000324411203073254030611 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: AbstractScmVersion.java 774900 2009-05-14 19:53:16Z olamy $ */ public abstract class AbstractScmVersion implements ScmVersion, Serializable { private static final long serialVersionUID = -3388495744009098066L; private String name; /** * @param name could be null */ public AbstractScmVersion( String name ) { setName( name ); } /** {@inheritDoc} */ public String getName() { return name; } /** {@inheritDoc} */ public void setName( String name ) { if ( name != null ) { name = name.trim(); } this.name = name; } /** {@inheritDoc} */ public String toString() { return getName(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/log/0000755000175000017500000000000011345536673024770 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java0000644000175000017500000000550111050560477027652 0ustar twernertwernerpackage org.apache.maven.scm.log; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: DefaultLog.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class DefaultLog implements ScmLogger { /** {@inheritDoc} */ public boolean isDebugEnabled() { return false; } /** {@inheritDoc} */ public void debug( String content ) { } /** {@inheritDoc} */ public void debug( String content, Throwable error ) { } /** {@inheritDoc} */ public void debug( Throwable error ) { } /** {@inheritDoc} */ public boolean isInfoEnabled() { return true; } /** {@inheritDoc} */ public void info( String content ) { System.out.println( content ); } /** {@inheritDoc} */ public void info( String content, Throwable error ) { System.out.println( content ); error.printStackTrace(); } /** {@inheritDoc} */ public void info( Throwable error ) { error.printStackTrace(); } /** {@inheritDoc} */ public boolean isWarnEnabled() { return true; } /** {@inheritDoc} */ public void warn( String content ) { System.out.println( content ); } /** {@inheritDoc} */ public void warn( String content, Throwable error ) { System.out.println( content ); error.printStackTrace(); } /** {@inheritDoc} */ public void warn( Throwable error ) { error.printStackTrace(); } /** {@inheritDoc} */ public boolean isErrorEnabled() { return true; } /** {@inheritDoc} */ public void error( String content ) { System.out.print( "[ERROR] " + content ); } /** {@inheritDoc} */ public void error( String content, Throwable error ) { System.out.println( "[ERROR] " + content ); error.printStackTrace(); } /** {@inheritDoc} */ public void error( Throwable error ) { error.printStackTrace(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java0000644000175000017500000000313410535556312027506 0ustar twernertwernerpackage org.apache.maven.scm.log; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmLogger.java 483105 2006-12-06 15:07:54Z evenisse $ */ public interface ScmLogger { boolean isDebugEnabled(); void debug( String content ); void debug( String content, Throwable error ); void debug( Throwable error ); boolean isInfoEnabled(); void info( String content ); void info( String content, Throwable error ); void info( Throwable error ); boolean isWarnEnabled(); void warn( String content ); void warn( String content, Throwable error ); void warn( Throwable error ); boolean isErrorEnabled(); void error( String content ); void error( String content, Throwable error ); void error( Throwable error ); } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java0000644000175000017500000001347511057621704031026 0ustar twernertwernerpackage org.apache.maven.scm.log; /* * 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. */ import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: ScmLogDispatcher.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class ScmLogDispatcher implements ScmLogger { private List listeners = new ArrayList(); public void addListener( ScmLogger logger ) { listeners.add( logger ); } /** {@inheritDoc} */ public void debug( String content, Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.debug( content, error ); } } /** {@inheritDoc} */ public void debug( String content ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.debug( content ); } } /** {@inheritDoc} */ public void debug( Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.debug( error ); } } /** {@inheritDoc} */ public void error( String content, Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.error( content, error ); } } /** {@inheritDoc} */ public void error( String content ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.error( content ); } } /** {@inheritDoc} */ public void error( Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.error( error ); } } /** {@inheritDoc} */ public void info( String content, Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isInfoEnabled() ) { logger.info( content, error ); } } } /** {@inheritDoc} */ public void info( String content ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isInfoEnabled() ) { logger.info( content ); } } } /** {@inheritDoc} */ public void info( Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isInfoEnabled() ) { logger.info( error ); } } } /** {@inheritDoc} */ public boolean isDebugEnabled() { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isDebugEnabled() ) { return true; } } return false; } /** {@inheritDoc} */ public boolean isErrorEnabled() { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isErrorEnabled() ) { return true; } } return false; } /** {@inheritDoc} */ public boolean isInfoEnabled() { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isInfoEnabled() ) { return true; } } return false; } /** {@inheritDoc} */ public boolean isWarnEnabled() { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); if ( logger.isWarnEnabled() ) { return true; } } return false; } /** {@inheritDoc} */ public void warn( String content, Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.warn( content, error ); } } /** {@inheritDoc} */ public void warn( String content ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.warn( content ); } } /** {@inheritDoc} */ public void warn( Throwable error ) { for ( Iterator i = listeners.iterator(); i.hasNext(); ) { ScmLogger logger = (ScmLogger) i.next(); logger.warn( error ); } } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileSet.java0000644000175000017500000001361211207614016027034 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import java.io.File; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * Set of files used for SCM operations. * Consists of the base directory of the files and a list of files relative to that directory. * * @author Brett Porter * @version $Id: ScmFileSet.java 779790 2009-05-28 23:02:38Z olamy $ */ public class ScmFileSet implements Serializable { private static final long serialVersionUID = -5978597349974797556L; private static final String DELIMITER = ","; /** @see DirectoryScanner#DEFAULTEXCLUDES */ private static final String DEFAULT_EXCLUDES = StringUtils.join( DirectoryScanner.DEFAULTEXCLUDES, DELIMITER ); private final File basedir; private String includes; private String excludes; /** * List of File objects, all relative to the basedir. */ private final List files; /** * Create a file set with no files, only the base directory. * * @param basedir directory files in the set are relative to */ public ScmFileSet( File basedir ) { this( basedir, new ArrayList( 0 ) ); } /** * Create a file set with only the file provided, relative to basedir. * * @param basedir directory file is relative to * @param file file that the set will contain, has to be relative to basedir */ public ScmFileSet( File basedir, File file ) { this( basedir, new File[]{file} ); } /** * Create a file set with only files (not directories) from basefile, * using includes and excludes provided. * * @param basedir directory files are relative to * @param includes Ant pattern for files to include * @param excludes Ant pattern for files to exclude, * if null DEFAULT_EXCLUDES is used, else DEFAULT_EXCLUDES is added. * @throws IOException if any */ public ScmFileSet( File basedir, String includes, String excludes ) throws IOException { this.basedir = basedir; if ( excludes != null && excludes.length() > 0 ) { excludes += DELIMITER + DEFAULT_EXCLUDES; } else { excludes = DEFAULT_EXCLUDES; } this.files = FileUtils.getFiles( basedir, includes, excludes, false ); this.includes = includes; this.excludes = excludes; } /** * Create a file set with files from basefile, using includes provided and default excludes. * * @param basedir directory files are relative to * @param includes Ant pattern for files to include * @throws IOException if any * @since 1.0 */ public ScmFileSet( File basedir, String includes ) throws IOException { this( basedir, includes, null ); } /** * Create a file set with the files provided, relative to basedir. * * @param basedir directory files are relative to * @param files files that the set will contain, have to be relative to basedir * @deprecated use ScmFileSet( File, List ) */ public ScmFileSet( File basedir, File[] files ) { this( basedir, Arrays.asList( files ) ); } /** * Create a file set with the files provided, relative to basedir. * * @param basedir directory files are relative to * @param files list of File objects, files that the set will contain, have to be relative to basedir */ public ScmFileSet( File basedir, List files ) { if ( basedir == null ) { throw new NullPointerException( "basedir must not be null" ); } if ( files == null ) { throw new NullPointerException( "files must not be null" ); } this.basedir = basedir; this.files = files; } /** * Get the base directory of the file set. It's the directory files in the set are relative to. * * @return base directory */ public File getBasedir() { return basedir; } /** * Get the list of files in the set, relative to basedir * * @return files in this set * @deprecated use getFileList() instead */ public File[] getFiles() { return (File[]) this.files.toArray( new File[0] ); } /** * Get the list of files in the set, relative to basedir * * @return List of File objects */ public List getFileList() { return this.files; } /** * @return the includes files as a comma separated string */ public String getIncludes() { return this.includes; } /** * @return the excludes files as a comma separated string */ public String getExcludes() { return this.excludes; } /** {@inheritDoc} */ public String toString() { return "basedir = " + basedir + "; files = " + files; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/util/0000755000175000017500000000000011345536673025164 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/util/FilenameUtils.java0000644000175000017500000000247411207614016030560 0ustar twernertwernerpackage org.apache.maven.scm.util; /* * 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. */ import java.io.File; import org.codehaus.plexus.util.StringUtils; public class FilenameUtils { public static String normalizeFilename( File file ) { return normalizeFilename( file.getName() ); } /** * Replace duplicated [back]slash to slash. * * @param filename * @return */ public static String normalizeFilename( String filename ) { return StringUtils.replace( StringUtils.replace( filename, "\\", "/" ), "//", "/" ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/util/AbstractConsumer.java0000644000175000017500000000750011176416024031275 0ustar twernertwernerpackage org.apache.maven.scm.util; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * @author Emmanuel Venisse * @version $Id: AbstractConsumer.java 770459 2009-04-30 21:45:56Z olamy $ */ public abstract class AbstractConsumer implements StreamConsumer { private ScmLogger logger; /** * AbstractConsumer constructor. * * @param logger The logger to use in the consumer */ public AbstractConsumer( ScmLogger logger ) { setLogger( logger ); } public ScmLogger getLogger() { return logger; } public void setLogger( ScmLogger logger ) { this.logger = logger; } /** * Converts the date timestamp from the output into a date object. * * @return A date representing the timestamp of the log entry. */ protected Date parseDate( String date, String userPattern, String defaultPattern ) { return parseDate( date, userPattern, defaultPattern, null ); } /** * Converts the date timestamp from the output into a date object. * * @return A date representing the timestamp of the log entry. */ protected Date parseDate( String date, String userPattern, String defaultPattern, Locale locale ) { DateFormat format; String patternUsed = null; if ( StringUtils.isNotEmpty( userPattern ) ) { format = new SimpleDateFormat( userPattern ); patternUsed = userPattern; } else { if ( StringUtils.isNotEmpty( defaultPattern ) ) { if ( locale != null ) { format = new SimpleDateFormat( defaultPattern, locale ); } else { format = new SimpleDateFormat( defaultPattern ); } patternUsed = defaultPattern; } else { // Use the English short date pattern if no pattern is specified format = DateFormat.getDateInstance( DateFormat.SHORT, Locale.ENGLISH ); patternUsed = " DateFormat.SHORT "; } } try { return format.parse( date ); } catch ( ParseException e ) { if ( getLogger() != null && getLogger().isErrorEnabled() ) { getLogger().error( "skip ParseException: " + e.getMessage() + " during parsing date " + date + " with pattern " + patternUsed + " with Locale " + ( locale == null ? Locale.ENGLISH : locale ), e ); } return null; } } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/util/ThreadSafeDateFormat.java0000644000175000017500000000453011207614016031767 0ustar twernertwernerpackage org.apache.maven.scm.util; /* * 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. */ import java.lang.ref.SoftReference; import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; /** * Thread-safe version of java.text.DateFormat. * You can declare it as a static final variable: * * private static final ThreadSafeDateFormat DATE_FORMAT = new ThreadSafeDateFormat( DATE_PATTERN ); * */ public class ThreadSafeDateFormat extends DateFormat { private static final long serialVersionUID = 3786090697869963812L; private final String m_sDateFormat; public ThreadSafeDateFormat(String sDateFormat) { m_sDateFormat = sDateFormat; } private final ThreadLocal m_formatCache = new ThreadLocal() { public Object get() { SoftReference softRef = (SoftReference) super.get(); if (softRef == null || softRef.get() == null) { softRef = new SoftReference( new SimpleDateFormat(m_sDateFormat) ); super.set(softRef); } return softRef; } }; private DateFormat getDateFormat() { return (DateFormat) ((SoftReference)m_formatCache.get()).get(); } public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { return getDateFormat().format(date, toAppendTo, fieldPosition); } public Date parse(String source, ParsePosition pos) { return getDateFormat().parse(source, pos); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileStatus.java0000644000175000017500000001236611203073254027570 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** *

* Typesafe enum for file status *

*

* There are two types of status defined in this class:
* 1) Status: Changes in the working tree, not yet committed to the repository eg. MODIFIED
* 2) Transaction: The file is part of some transaction with the repository eg. CHECKED_IN *

* * @author Trygve Laugstøl * @version $Id: ScmFileStatus.java 774900 2009-05-14 19:53:16Z olamy $ */ public final class ScmFileStatus implements Serializable { private static final long serialVersionUID = -7840223279162817915L; /** * File is added to the working tree and does not yet exist in the repository */ public static final ScmFileStatus ADDED = new ScmFileStatus( "added" ); /** * File is removed from the working tree thus not revisioned anymore.
* The file is still present in the repository.
* The file could be deleted from the filesystem depending on the provider. */ public static final ScmFileStatus DELETED = new ScmFileStatus( "deleted" ); /** * The file has been modified in the working tree. */ public static final ScmFileStatus MODIFIED = new ScmFileStatus( "modified" ); /** * The file is missing in the working tree. */ public static final ScmFileStatus MISSING = new ScmFileStatus( "missing" ); /** * File from working tree is checked into the repository */ public static final ScmFileStatus CHECKED_IN = new ScmFileStatus( "checked-in" ); /** * File is checked out from the repository and into the working tree */ public static final ScmFileStatus CHECKED_OUT = new ScmFileStatus( "checked-out" ); /** * The file in the working tree has differences to the one in repository that * conflicts ie. it cannot automatically be merged. */ public static final ScmFileStatus CONFLICT = new ScmFileStatus( "conflict" ); /** * The file in the working tree has been updated with changes from the repository. */ public static final ScmFileStatus PATCHED = new ScmFileStatus( "patched" ); /** * The file is added, removed or updated from the repository, thus its * up-to-date with the version in the repository. See also isUpdate() */ public static final ScmFileStatus UPDATED = new ScmFileStatus( "updated" ); /** * The file is part of a tag. */ public static final ScmFileStatus TAGGED = new ScmFileStatus( "tagged" ); /** * The file is locked. */ public static final ScmFileStatus LOCKED = new ScmFileStatus( "locked" ); /** * The file is in the working tree but is not versioned and not ignored either. */ public static final ScmFileStatus UNKNOWN = new ScmFileStatus( "unknown" ); /** * The status name */ private final String name; private ScmFileStatus( String name ) { this.name = name; } /** {@inheritDoc} */ public String toString() { return name; } /** * There are changes in the working tree that are not committed to the repository, or
* the file is unknown for the working tree. * * @return true on changes in the working tree or if the file is unknown. */ public boolean isStatus() { return this == UNKNOWN || isDiff(); } /** * There are changes in the working tree that are not committed to the repository.
* * @return true on changes in the working tree */ public boolean isDiff() { return this == ADDED || this == DELETED || this == MODIFIED; } /** * @return true if the file was part of a transaction with the repository. */ public boolean isTransaction() { return this == CHECKED_IN || this == CHECKED_OUT || this == LOCKED || this == TAGGED || isUpdate(); } /** * File is part of an update transaction with the repository.
* Note: ADDED and REMOVED are not an update status since they indicates * that the working tree has changed.
* An update indicates the opposite, that the repository was changed compared to * the working tree and that it is now synchronized unless there are conflicts. * * @return true if the status is conflict, updated or patched. */ public boolean isUpdate() { return this == CONFLICT || this == UPDATED || this == PATCHED; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFile.java0000644000175000017500000000506311203073254026360 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: ScmFile.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ScmFile implements Comparable, Serializable { private static final long serialVersionUID = -9133015730693522690L; private String path; private ScmFileStatus status; /** * @param path The file path * @param status The file status */ public ScmFile( String path, ScmFileStatus status ) { this.path = path; this.status = status; } /** * @return the file path */ public String getPath() { return path; } /** * @return The file status */ public ScmFileStatus getStatus() { return status; } // ---------------------------------------------------------------------- // Comparable Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public int compareTo( Object other ) { return ( (ScmFile) other ).getPath().compareTo( path ); } // ---------------------------------------------------------------------- // Object overrides // ---------------------------------------------------------------------- /** {@inheritDoc} */ public boolean equals( Object other ) { if ( !( other instanceof ScmFile ) ) { return false; } return ( (ScmFile) other ).getPath().equals( path ); } /** {@inheritDoc} */ public int hashCode() { return path.hashCode(); } /** {@inheritDoc} */ public String toString() { return "[" + path + ":" + status + "]"; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranchParameters.java0000644000175000017500000000373211313217053030722 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author olamy * @since 1.2 */ public class ScmBranchParameters implements Serializable { private static final long serialVersionUID = 7241536408630608707L; private String message; private boolean remoteBranching = false; private String scmRevision; public ScmBranchParameters() { this.remoteBranching = false; } public ScmBranchParameters( String message ) { this.message = message; } public String getMessage() { return message; } public void setMessage( String message ) { this.message = message; } public String getScmRevision() { return scmRevision; } public void setScmRevision( String scmRevision ) { this.scmRevision = scmRevision; } public boolean isRemoteBranching() { return remoteBranching; } public void setRemoteBranching( boolean remoteBranching ) { this.remoteBranching = remoteBranching; } public String toString() { return "[" + scmRevision + "] " + message; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/0000755000175000017500000000000011345536673026426 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepository.java0000644000175000017500000000355111050560477032107 0ustar twernertwernerpackage org.apache.maven.scm.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepository; /** * @author Emmanuel Venisse * @version $Id: ScmRepository.java 685539 2008-08-13 13:27:27Z vsiveton $ * @todo clarify need - should be able to merge with ScmProviderRepository? */ public class ScmRepository { /** */ private String provider; /** */ private ScmProviderRepository providerRepository; public ScmRepository( String provider, ScmProviderRepository providerRepository ) { this.provider = provider; this.providerRepository = providerRepository; } /** * @return Returns the provider. */ public String getProvider() { return provider; } /** * @return Returns the provider repository. */ public ScmProviderRepository getProviderRepository() { return providerRepository; } /** {@inheritDoc} */ public String toString() { return provider.toString() + ":" + providerRepository.toString(); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepositoryException.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepositoryException.jav0000644000175000017500000000331711050560477033625 0ustar twernertwernerpackage org.apache.maven.scm.repository; /* * 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. */ import org.apache.maven.scm.ScmException; import java.util.Collections; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: ScmRepositoryException.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class ScmRepositoryException extends ScmException { static final long serialVersionUID = -2191549774722212492L; private List validationMessages = Collections.EMPTY_LIST; public ScmRepositoryException( String msg ) { super( msg ); } public ScmRepositoryException( String msg, Throwable cause ) { super( msg, cause ); } public ScmRepositoryException( String msg, List validationMessages ) { super( msg ); this.validationMessages = validationMessages; } public List getValidationMessages() { return validationMessages; } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/UnknownRepositoryStructure.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/repository/UnknownRepositoryStructure0000644000175000017500000000217511203073254034016 0ustar twernertwernerpackage org.apache.maven.scm.repository; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: UnknownRepositoryStructure.java 774900 2009-05-14 19:53:16Z olamy $ */ public class UnknownRepositoryStructure extends Exception { private static final long serialVersionUID = -7767277520687595055L; } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java0000644000175000017500000002703311313217053030440 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import java.io.File; import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; /** * @author Trygve Laugstøl * @version $Id: CommandParameters.java 892494 2009-12-19 18:40:43Z olamy $ */ public class CommandParameters implements Serializable { private static final long serialVersionUID = -7346070735958137283L; private Map parameters = new HashMap(); // ---------------------------------------------------------------------- // String // ---------------------------------------------------------------------- /** * Return the parameter value as String. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public String getString( CommandParameter parameter ) throws ScmException { Object object = getObject( String.class, parameter ); if ( object == null ) { throw new ScmException( "Missing parameter: '" + parameter.getName() + "'." ); } return object.toString(); } /** * Return the parameter value or the default value if it doesn't exist. * * @param parameter The parameter * @param defaultValue The default value * @return The parameter value as a String * @throws ScmException if the value is in the wrong type */ public String getString( CommandParameter parameter, String defaultValue ) throws ScmException { Object object = getObject( String.class, parameter, null ); if ( object == null ) { return defaultValue; } return object.toString(); } /** * Set a parameter value. * * @param parameter The parameter name * @param value The value of the parameter * @throws ScmException if the parameter already exist */ public void setString( CommandParameter parameter, String value ) throws ScmException { setObject( parameter, value ); } // ---------------------------------------------------------------------- // Int // ---------------------------------------------------------------------- /** * Return the parameter value as int. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public int getInt( CommandParameter parameter ) throws ScmException { return ( (Integer) getObject( Integer.class, parameter ) ).intValue(); } /** * Return the parameter value as int or the default value if it doesn't exist. * * @param parameter The parameter * @return The parameter value as a int * @param defaultValue The defaultValue * @throws ScmException if the value is in the wrong type */ public int getInt( CommandParameter parameter, int defaultValue ) throws ScmException { Integer value = ( (Integer) getObject( Integer.class, parameter, null ) ); if ( value == null ) { return defaultValue; } return value.intValue(); } /** * Set a parameter value. * * @param parameter The parameter name * @param value The value of the parameter * @throws ScmException if the parameter already exist */ public void setInt( CommandParameter parameter, int value ) throws ScmException { setObject( parameter, new Integer( value ) ); } // ---------------------------------------------------------------------- // Date // ---------------------------------------------------------------------- /** * Return the parameter value as Date. * * @param parameter The parameter * @return The parameter value as a Date * @throws ScmException if the parameter doesn't exist */ public Date getDate( CommandParameter parameter ) throws ScmException { return (Date) getObject( Date.class, parameter ); } /** * Return the parameter value as String or the default value if it doesn't exist. * * @param parameter The parameter * @param defaultValue The defaultValue * @return The parameter value as a Date * @throws ScmException if the value is in the wrong type */ public Date getDate( CommandParameter parameter, Date defaultValue ) throws ScmException { return (Date) getObject( Date.class, parameter, defaultValue ); } /** * Set a parameter value. * * @param parameter The parameter name * @param date The value of the parameter * @throws ScmException if the parameter already exist */ public void setDate( CommandParameter parameter, Date date ) throws ScmException { setObject( parameter, date ); } // ---------------------------------------------------------------------- // Boolean // ---------------------------------------------------------------------- /** * Return the parameter value as boolean. * * @param parameter The parameter * @return The parameter value as a String * @throws ScmException if the parameter doesn't exist */ public boolean getBoolean( CommandParameter parameter ) throws ScmException { return Boolean.valueOf( getString( parameter ) ).booleanValue(); } // ---------------------------------------------------------------------- // ScmVersion // ---------------------------------------------------------------------- /** * Return the parameter value as ScmVersion. * * @param parameter The parameter * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter ); } /** * Return the parameter value as ScmVersion or the default value. * * @param parameter The parameter * @param defaultValue The default value * @return The parameter value as a ScmVersion * @throws ScmException if the parameter doesn't exist */ public ScmVersion getScmVersion( CommandParameter parameter, ScmVersion defaultValue ) throws ScmException { return (ScmVersion) getObject( ScmVersion.class, parameter, defaultValue ); } /** * Set a parameter value. * * @param parameter The parameter name * @param scmVersion The tbranch/tag/revision * @throws ScmException if the parameter already exist */ public void setScmVersion( CommandParameter parameter, ScmVersion scmVersion ) throws ScmException { setObject( parameter, scmVersion ); } // ---------------------------------------------------------------------- // File[] // ---------------------------------------------------------------------- /** * @param parameter not null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter ) throws ScmException { return (File[]) getObject( File[].class, parameter ); } /** * * @param parameter not null * @param defaultValue could be null * @return an array of files * @throws ScmException if any */ public File[] getFileArray( CommandParameter parameter, File[] defaultValue ) throws ScmException { return (File[]) getObject( File[].class, parameter, defaultValue ); } public ScmTagParameters getScmTagParameters( CommandParameter parameter ) throws ScmException { return (ScmTagParameters) getObject( ScmTagParameters.class, parameter, new ScmTagParameters() ); } public void setScmTagParameters( CommandParameter parameter, ScmTagParameters scmTagParameters ) throws ScmException { setObject( parameter, scmTagParameters ); } public void setScmBranchParameters( CommandParameter parameter, ScmBranchParameters scmBranchParameters ) throws ScmException { setObject( parameter, scmBranchParameters ); } public ScmBranchParameters getScmBranchParameters( CommandParameter parameter ) throws ScmException { return (ScmBranchParameters) getObject( ScmBranchParameters.class, parameter, new ScmBranchParameters() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Return the value object. * * @param clazz The type of the parameter value * @param parameter The parameter * @return The parameter value * @throws ScmException if the parameter doesn't exist */ private Object getObject( Class clazz, CommandParameter parameter ) throws ScmException { Object object = getObject( clazz, parameter, null ); if ( object == null ) { throw new ScmException( "Missing parameter: '" + parameter.getName() + "'." ); } return object; } /** * Return the value object or the default value if it doesn't exist. * * @param clazz The type of the parameter value * @param parameter The parameter * @param defaultValue The defaultValue * @return The parameter value * @throws ScmException if the defaultValue is in the wrong type */ private Object getObject( Class clazz, CommandParameter parameter, Object defaultValue ) throws ScmException { Object object = parameters.get( parameter.getName() ); if ( object == null ) { return defaultValue; } if ( clazz != null && !clazz.isAssignableFrom( object.getClass() ) ) { throw new ScmException( "Wrong parameter type for '" + parameter.getName() + ". " + "Expected: " + clazz.getName() + ", got: " + object.getClass().getName() ); } return object; } /** * Set the parameter value. * * @param parameter The parameter * @param value The parameter value * @throws ScmException if the parameter already exist */ private void setObject( CommandParameter parameter, Object value ) throws ScmException { Object object = getObject( null, parameter, null ); if ( object != null ) { throw new ScmException( "The parameter is already set: " + parameter.getName() ); } parameters.put( parameter.getName(), value ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmVersion.java0000644000175000017500000000236511203073254027130 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmVersion.java 774900 2009-05-14 19:53:16Z olamy $ */ public interface ScmVersion { /** * @return the Version type like branch */ String getType(); /** * @return the Version name */ String getName(); /** * @param name new Version name could be null */ void setName( String name ); } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java0000644000175000017500000003715211304317642026707 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import java.io.Serializable; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.util.FilenameUtils; import org.apache.maven.scm.util.ThreadSafeDateFormat; import org.codehaus.plexus.util.StringUtils; /** * @author Emmanuel Venisse * @version $Id: ChangeSet.java 885155 2009-11-28 22:09:38Z olamy $ */ public class ChangeSet implements Serializable { /** * */ private static final long serialVersionUID = 7097705862222539801L; /** * Escaped < entity */ public static final String LESS_THAN_ENTITY = "<"; /** * Escaped > entity */ public static final String GREATER_THAN_ENTITY = ">"; /** * Escaped & entity */ public static final String AMPERSAND_ENTITY = "&"; /** * Escaped ' entity */ public static final String APOSTROPHE_ENTITY = "'"; /** * Escaped " entity */ public static final String QUOTE_ENTITY = """; private static final String DATE_PATTERN = "yyyy-MM-dd"; /** * Formatter used by the getDateFormatted method. */ private static final ThreadSafeDateFormat DATE_FORMAT = new ThreadSafeDateFormat( DATE_PATTERN ); private static final String TIME_PATTERN = "HH:mm:ss"; /** * Formatter used by the getTimeFormatted method. */ private static final ThreadSafeDateFormat TIME_FORMAT = new ThreadSafeDateFormat( TIME_PATTERN ); /** * Formatter used to parse date/timestamp. */ private static final ThreadSafeDateFormat TIMESTAMP_FORMAT_1 = new ThreadSafeDateFormat( "yyyy/MM/dd HH:mm:ss" ); private static final ThreadSafeDateFormat TIMESTAMP_FORMAT_2 = new ThreadSafeDateFormat( "yyyy-MM-dd HH:mm:ss" ); private static final ThreadSafeDateFormat TIMESTAMP_FORMAT_3 = new ThreadSafeDateFormat( "yyyy/MM/dd HH:mm:ss z" ); private static final ThreadSafeDateFormat TIMESTAMP_FORMAT_4 = new ThreadSafeDateFormat( "yyyy-MM-dd HH:mm:ss z" ); /** * Date the changes were committed */ private Date date; /** * User who made changes */ private String author; /** * comment provided at commit time */ private String comment = ""; /** * List of ChangeFile */ private List/**/ files; /** * The SCM revision id for this changeset. * @since 1.3 */ private String revision; /** * @param strDate Date the changes were committed * @param userDatePattern pattern of date * @param comment comment provided at commit time * @param author User who made changes * @param files The ChangeFile list */ public ChangeSet( String strDate, String userDatePattern, String comment, String author, List/**/ files ) { this( null, comment, author, files ); setDate( strDate, userDatePattern ); } /** * @param date Date the changes were committed * @param comment comment provided at commit time * @param author User who made changes * @param files The ChangeFile list */ public ChangeSet( Date date, String comment, String author, List/**/ files ) { setDate( date ); setAuthor( author ); setComment( comment ); this.files = files; } /** * Constructor used when attributes aren't available until later */ public ChangeSet() { } /** * Getter for ChangeFile list. * * @return List of ChangeFile. */ public List/**/ getFiles() { if ( files == null ) { return new ArrayList(); } return files; } /** * Setter for ChangeFile list. * * @param files List of ChangeFiles. */ public void setFiles( List/**/ files ) { this.files = files; } public void addFile( ChangeFile file ) { if ( files == null ) { files = new ArrayList(); } files.add( file ); } /** * @deprecated Use method {@link #containsFilename(String)} * @param filename * @param repository NOT USED * @return */ public boolean containsFilename( String filename, ScmProviderRepository repository ) { return containsFilename( filename ); } public boolean containsFilename( String filename ) { if ( files != null ) { for ( Iterator i = files.iterator(); i.hasNext(); ) { ChangeFile file = (ChangeFile) i.next(); String f1 = FilenameUtils.normalizeFilename( file.getName() ); String f2 = FilenameUtils.normalizeFilename( filename ); if ( f1.indexOf( f2 ) >= 0 ) { return true; } } } return false; } /** * Getter for property author. * * @return Value of property author. */ public String getAuthor() { return author; } /** * Setter for property author. * * @param author New value of property author. */ public void setAuthor( String author ) { this.author = author; } /** * Getter for property comment. * * @return Value of property comment. */ public String getComment() { return comment; } /** * Setter for property comment. * * @param comment New value of property comment. */ public void setComment( String comment ) { this.comment = comment; } /** * Getter for property date. * * @return Value of property date. */ public Date getDate() { if ( date != null ) { return (Date) date.clone(); } return null; } /** * Setter for property date. * * @param date New value of property date. */ public void setDate( Date date ) { if ( date != null ) { this.date = new Date( date.getTime() ); } } /** * Setter for property date that takes a string and parses it * * @param date - a string in yyyy/MM/dd HH:mm:ss format */ public void setDate( String date ) { setDate( date, null ); } /** * Setter for property date that takes a string and parses it * * @param date - a string in yyyy/MM/dd HH:mm:ss format * @param userDatePattern - pattern of date */ public void setDate( String date, String userDatePattern ) { try { if ( !StringUtils.isEmpty( userDatePattern ) ) { SimpleDateFormat format = new SimpleDateFormat( userDatePattern ); this.date = format.parse( date ); } else { this.date = TIMESTAMP_FORMAT_3.parse( date ); } } catch ( ParseException e ) { if ( !StringUtils.isEmpty( userDatePattern ) ) { try { this.date = TIMESTAMP_FORMAT_3.parse( date ); } catch ( ParseException pe ) { try { this.date = TIMESTAMP_FORMAT_4.parse( date ); } catch ( ParseException pe1 ) { try { this.date = TIMESTAMP_FORMAT_1.parse( date ); } catch ( ParseException pe2 ) { try { this.date = TIMESTAMP_FORMAT_2.parse( date ); } catch ( ParseException pe3 ) { throw new IllegalArgumentException( "Unable to parse date: " + date ); } } } } } else { try { this.date = TIMESTAMP_FORMAT_4.parse( date ); } catch ( ParseException pe1 ) { try { this.date = TIMESTAMP_FORMAT_1.parse( date ); } catch ( ParseException pe2 ) { try { this.date = TIMESTAMP_FORMAT_2.parse( date ); } catch ( ParseException pe3 ) { throw new IllegalArgumentException( "Unable to parse date: " + date ); } } } } } } /** * @return date in yyyy-mm-dd format */ public String getDateFormatted() { return DATE_FORMAT.format( getDate() ); } /** * @return time in HH:mm:ss format */ public String getTimeFormatted() { return TIME_FORMAT.format( getDate() ); } /** * @return * @since 1.3 */ public String getRevision() { return revision; } /** * @param revision * @since 1.3 */ public void setRevision( String revision ) { this.revision = revision; } /** {@inheritDoc} */ public String toString() { StringBuffer result = new StringBuffer( author == null ? " null " : author ); result.append( "\n" ).append( date == null ? "null " : date.toString() ).append( "\n" ); if ( files != null ) { for ( Iterator i = files.iterator(); i.hasNext(); ) { ChangeFile file = (ChangeFile) i.next(); result.append( file == null ? " null " : file.toString() ).append( "\n" ); } } result.append( comment == null ? " null " : comment ); return result.toString(); } /** * Provide the changelog entry as an XML snippet. * * @return a changelog-entry in xml format * @task make sure comment doesn't contain CDATA tags - MAVEN114 */ public String toXML() { StringBuffer buffer = new StringBuffer(); buffer.append( "\t\n" ); if ( getDate() != null ) { buffer.append( "\t\t" ) .append( getDateFormatted() ) .append( "\n" ) .append( "\t\t\n" ); } buffer.append( "\t\t\n" ); if ( files != null ) { for ( Iterator i = files.iterator(); i.hasNext(); ) { ChangeFile file = (ChangeFile) i.next(); buffer.append( "\t\t\n" ).append( "\t\t\t" ).append( escapeValue( file.getName() ) ) .append( "\n" ).append( "\t\t\t" ).append( file.getRevision() ) .append( "\n" ); buffer.append( "\t\t\n" ); } } buffer.append( "\t\t\n" ); buffer.append( "\t\n" ); return buffer.toString(); } /** {@inheritDoc} */ public boolean equals( Object obj ) { if ( obj instanceof ChangeSet ) { ChangeSet changeSet = (ChangeSet) obj; if ( toString().equals( changeSet.toString() ) ) { return true; } } return false; } /** {@inheritDoc} */ public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( author == null ) ? 0 : author.hashCode() ); result = prime * result + ( ( comment == null ) ? 0 : comment.hashCode() ); result = prime * result + ( ( date == null ) ? 0 : date.hashCode() ); result = prime * result + ( ( files == null ) ? 0 : files.hashCode() ); return result; } /** * remove a ]]> from comments (replace it with ] ] >). * * @param message The message to modify * @return a clean string */ private String removeCDataEnd( String message ) { // check for invalid sequence ]]> int endCdata; while ( message != null && ( endCdata = message.indexOf( "]]>" ) ) > -1 ) { message = message.substring( 0, endCdata ) + "] ] >" + message.substring( endCdata + 3, message.length() ); } return message; } /** *

Escape the toString of the given object. * For use in an attribute value.

*

* swiped from jakarta-commons/betwixt -- XMLUtils.java * * @param value escape value.toString() * @return text with characters restricted (for use in attributes) escaped */ public static String escapeValue( Object value ) { StringBuffer buffer = new StringBuffer( value.toString() ); for ( int i = 0, size = buffer.length(); i < size; i++ ) { switch ( buffer.charAt( i ) ) { case'<': buffer.replace( i, i + 1, LESS_THAN_ENTITY ); size += 3; i += 3; break; case'>': buffer.replace( i, i + 1, GREATER_THAN_ENTITY ); size += 3; i += 3; break; case'&': buffer.replace( i, i + 1, AMPERSAND_ENTITY ); size += 4; i += 4; break; case'\'': buffer.replace( i, i + 1, APOSTROPHE_ENTITY ); size += 5; i += 5; break; case'\"': buffer.replace( i, i + 1, QUOTE_ENTITY ); size += 5; i += 5; break; } } return buffer.toString(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmBranch.java0000644000175000017500000000245611203073254026701 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmBranch.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ScmBranch extends AbstractScmVersion { private static final long serialVersionUID = 6305050785257168739L; /** {@inheritDoc} */ public String getType() { return "Branch"; } /** * @param name the branch name */ public ScmBranch( String name ) { super( name ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmException.java0000644000175000017500000000265711050560477027455 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmException.java 685539 2008-08-13 13:27:27Z vsiveton $ */ public class ScmException extends Exception { static final long serialVersionUID = 5041965569154385323L; /** * @param message the message could be null */ public ScmException( String message ) { super( message ); } /** * @param message the message could be null * @param cause the cause could be null */ public ScmException( String message, Throwable cause ) { super( message, cause ); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/ScmResult.java0000644000175000017500000000612411203073254026756 0ustar twernertwernerpackage org.apache.maven.scm; import java.io.Serializable; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: ScmResult.java 774900 2009-05-14 19:53:16Z olamy $ */ public class ScmResult implements Serializable { private static final long serialVersionUID = 7037918334820621525L; private final boolean success; private final String providerMessage; private final String commandOutput; private final String commandLine; /** * Copy constructor. *

* Typically used from derived classes when wrapping a ScmResult * into a specific type eg. AddScmResult * * @param scmResult not null */ public ScmResult( ScmResult scmResult ) { this.commandLine = scmResult.commandLine; this.providerMessage = scmResult.providerMessage; this.commandOutput = scmResult.commandOutput; this.success = scmResult.success; } /** * ScmResult contructor. * * @param commandLine The provider specific command line used * @param providerMessage The provider message * @param commandOutput The command output of the scm tool * @param success True if the command is in success */ public ScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { this.commandLine = commandLine; this.providerMessage = providerMessage; this.commandOutput = commandOutput; this.success = success; } /** * @return True if the command was in success */ public boolean isSuccess() { return success; } /** * @return A message from the provider. On success this would typically be null or * an empty string. On failure it would be the error message from the provider */ public String getProviderMessage() { return providerMessage; } /** * @return Output from Std.Out from the provider during execution * of the command that resulted in this */ public String getCommandOutput() { return commandOutput; } /** * @return The actual provider specific command that resulted in this */ public String getCommandLine() { return commandLine; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536673026041 5ustar twernertwernermaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java0000644000175000017500000007445311313217053032621 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.NoSuchCommandScmException; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.log.ScmLogDispatcher; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @version $Id: AbstractScmProvider.java 892494 2009-12-19 18:40:43Z olamy $ */ public abstract class AbstractScmProvider implements ScmProvider { private ScmLogDispatcher logDispatcher = new ScmLogDispatcher(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** {@inheritDoc} */ public String getScmSpecificFilename() { return null; } /** {@inheritDoc} */ public String sanitizeTagName( String tag ) { /* by default, we assume all tags are valid. */ return tag; } /** {@inheritDoc} */ public boolean validateTagName( String tag ) { /* by default, we assume all tags are valid. */ return true; } /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { List messages = new ArrayList(); try { makeProviderScmRepository( scmSpecificUrl, delimiter ); } catch ( ScmRepositoryException e ) { messages.add( e.getMessage() ); } return messages; } /** {@inheritDoc} */ public boolean requiresEditMode() { return false; } // ---------------------------------------------------------------------- // Scm Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return add( repository, fileSet, (String) null ); } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message ); // TODO: binary may be dependant on particular files though // TODO: set boolean? parameters.setString( CommandParameter.BINARY, "false" ); return add( repository.getProviderRepository(), fileSet, parameters ); } protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "add" ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException { return branch( repository, fileSet, branchName, new ScmBranchParameters() ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException { ScmBranchParameters scmBranchParameters = new ScmBranchParameters(); if ( StringUtils.isNotEmpty( message ) ) { scmBranchParameters.setMessage( message ); } return branch( repository, fileSet, branchName, scmBranchParameters ); } public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, ScmBranchParameters scmBranchParameters ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.BRANCH_NAME, branchName ); parameters.setScmBranchParameters( CommandParameter.SCM_BRANCH_PARAMETERS, scmBranchParameters ); return branch( repository.getProviderRepository(), fileSet, parameters ); } protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "branch" ); } /** {@inheritDoc} * @deprecated */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch ) throws ScmException { return changeLog( repository, fileSet, startDate, endDate, numDays, branch, null ); } /** * {@inheritDoc} * @deprecated */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch, String datePattern ) throws ScmException { ScmBranch scmBranch = null; if ( StringUtils.isNotEmpty( branch ) ) { scmBranch = new ScmBranch( branch ); } return changeLog( repository, fileSet, startDate, endDate, numDays, scmBranch, null ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException { return changeLog( repository, fileSet, startDate, endDate, numDays, branch, null ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setDate( CommandParameter.START_DATE, startDate ); parameters.setDate( CommandParameter.END_DATE, endDate ); parameters.setInt( CommandParameter.NUM_DAYS, numDays ); parameters.setScmVersion( CommandParameter.BRANCH, branch ); parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern ); return changelog( repository.getProviderRepository(), fileSet, parameters ); } /** {@inheritDoc} * @deprecated */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag ) throws ScmException { return changeLog( repository, fileSet, startTag, endTag, null ); } /** {@inheritDoc} * @deprecated */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag, String datePattern ) throws ScmException { ScmVersion startRevision = null; ScmVersion endRevision = null; if ( StringUtils.isNotEmpty( startTag ) ) { startRevision = new ScmRevision( startTag ); } if ( StringUtils.isNotEmpty( endTag ) ) { endRevision = new ScmRevision( endTag ); } return changeLog( repository, fileSet, startRevision, endRevision, null ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return changeLog( repository, fileSet, startVersion, endVersion, null ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.START_SCM_VERSION, startVersion ); parameters.setScmVersion( CommandParameter.END_SCM_VERSION, endVersion ); parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern ); return changelog( repository.getProviderRepository(), fileSet, parameters ); } protected ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "changelog" ); } /** {@inheritDoc} * @deprecated */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message ) throws ScmException { ScmVersion scmVersion = null; if ( StringUtils.isNotEmpty( tag ) ) { scmVersion = new ScmBranch( tag ); } return checkIn( repository, fileSet, scmVersion, message ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return checkIn( repository, fileSet, (ScmVersion) null, message ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, String message ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); parameters.setString( CommandParameter.MESSAGE, message ); return checkin( repository.getProviderRepository(), fileSet, parameters ); } protected CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "checkin" ); } /** {@inheritDoc} * @deprecated */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return checkOut( repository, fileSet, tag, true ); } /** {@inheritDoc} * @deprecated */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag, boolean recursive ) throws ScmException { ScmVersion scmVersion = null; if ( StringUtils.isNotEmpty( tag ) ) { scmVersion = new ScmBranch( tag ); } return checkOut( repository, fileSet, scmVersion, recursive ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return checkOut( repository, fileSet, (ScmVersion) null, true ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException { return checkOut( repository, fileSet, scmVersion, true ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, boolean recursive ) throws ScmException { return checkOut( repository, fileSet, (ScmVersion) null, recursive ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, boolean recursive ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); parameters.setString( CommandParameter.RECURSIVE, recursive + "" ); return checkout( repository.getProviderRepository(), fileSet, parameters ); } protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "checkout" ); } /** {@inheritDoc} * @deprecated */ public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision, String endRevision ) throws ScmException { ScmVersion startVersion = null; ScmVersion endVersion = null; if ( StringUtils.isNotEmpty( startRevision ) ) { startVersion = new ScmRevision( startRevision ); } if ( StringUtils.isNotEmpty( endRevision ) ) { endVersion = new ScmRevision( endRevision ); } return diff( repository, fileSet, startVersion, endVersion ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.START_SCM_VERSION, startVersion ); parameters.setScmVersion( CommandParameter.END_SCM_VERSION, endVersion ); return diff( repository.getProviderRepository(), fileSet, parameters ); } protected DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "diff" ); } /** {@inheritDoc} */ public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); return edit( repository.getProviderRepository(), fileSet, parameters ); } protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Provider " + this.getScmType() + " does not support edit operation." ); } return new EditScmResult( "", null, null, true ); } /** {@inheritDoc} * @deprecated */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return export( repository, fileSet, tag, null ); } /** {@inheritDoc} * @deprecated */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory ) throws ScmException { ScmVersion scmVersion = null; if ( StringUtils.isNotEmpty( tag ) ) { scmVersion = new ScmRevision( tag ); } return export( repository, fileSet, scmVersion, outputDirectory ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return export( repository, fileSet, (ScmVersion) null, null ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException { return export( repository, fileSet, scmVersion, null ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, String outputDirectory ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); parameters.setString( CommandParameter.OUTPUT_DIRECTORY, outputDirectory ); return export( repository.getProviderRepository(), fileSet, parameters ); } protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "export" ); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag ) throws ScmException { ScmVersion scmVersion = null; if ( StringUtils.isNotEmpty( tag ) ) { scmVersion = new ScmRevision( tag ); } return list( repository, fileSet, recursive, scmVersion ); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion scmVersion ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.RECURSIVE, Boolean.toString( recursive ) ); if ( scmVersion != null ) { parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); } return list( repository.getProviderRepository(), fileSet, parameters ); } /** * List each element (files and directories) of fileSet as they exist in the repository. * * @param repository the source control system * @param fileSet the files to list * @param parameters * @return The list of files in the repository * @throws NoSuchCommandScmException unless overriden by subclass * @throws ScmException if any */ protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "list" ); } private void login( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { LoginScmResult result = login( repository.getProviderRepository(), fileSet, new CommandParameters() ); if ( !result.isSuccess() ) { throw new ScmException( "Can't login.\n" + result.getCommandOutput() ); } } protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return new LoginScmResult( null, null, null, true ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.MESSAGE, message == null ? "" : message ); return remove( repository.getProviderRepository(), fileSet, parameters ); } protected RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "remove" ); } /** {@inheritDoc} */ public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); return status( repository.getProviderRepository(), fileSet, parameters ); } protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "status" ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) throws ScmException { return tag( repository, fileSet, tagName, new ScmTagParameters() ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.TAG_NAME, tagName ); if ( StringUtils.isNotEmpty( message ) ) { parameters.setString( CommandParameter.MESSAGE, message ); } ScmTagParameters scmTagParameters = new ScmTagParameters(message); parameters.setScmTagParameters( CommandParameter.SCM_TAG_PARAMETERS, scmTagParameters ); return tag( repository.getProviderRepository(), fileSet, parameters); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setString( CommandParameter.TAG_NAME, tagName ); parameters.setScmTagParameters( CommandParameter.SCM_TAG_PARAMETERS, scmTagParameters ); return tag( repository.getProviderRepository(), fileSet, parameters ); } protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "tag" ); } /** {@inheritDoc} */ public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); return unedit( repository.getProviderRepository(), fileSet, parameters ); } protected UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Provider " + this.getScmType() + " does not support unedit operation." ); } return new UnEditScmResult( "", null, null, true ); } /** {@inheritDoc} * @deprecated */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return update( repository, fileSet, tag, true ); } /** {@inheritDoc} * @deprecated */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog ) throws ScmException { return update( repository, fileSet, tag, "", runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return update( repository, fileSet, (ScmVersion) null, true ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException { return update( repository, fileSet, scmVersion, true ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException { return update( repository, fileSet, (ScmVersion) null, "", runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, boolean runChangelog ) throws ScmException { return update( repository, fileSet, scmVersion, "", runChangelog ); } /** {@inheritDoc} * @deprecated */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern ) throws ScmException { return update( repository, fileSet, tag, datePattern, true ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, String datePattern ) throws ScmException { return update( repository, fileSet, scmVersion, datePattern, true ); } /** * @deprecated */ private UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern, boolean runChangelog ) throws ScmException { ScmBranch scmBranch = null; if ( StringUtils.isNotEmpty( tag ) ) { scmBranch = new ScmBranch( tag ); } return update( repository, fileSet, scmBranch, datePattern, runChangelog ); } private UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, String datePattern, boolean runChangelog ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern ); parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, String.valueOf( runChangelog ) ); return update( repository.getProviderRepository(), fileSet, parameters ); } /** {@inheritDoc} * @deprecated */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate ) throws ScmException { return update( repository, fileSet, tag, lastUpdate, null ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, Date lastUpdate ) throws ScmException { return update( repository, fileSet, scmVersion, lastUpdate, null ); } /** {@inheritDoc} * @deprecated */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, String datePattern ) throws ScmException { ScmBranch scmBranch = null; if ( StringUtils.isNotEmpty( tag ) ) { scmBranch = new ScmBranch( tag ); } return update( repository, fileSet, scmBranch, lastUpdate, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion scmVersion, Date lastUpdate, String datePattern ) throws ScmException { login( repository, fileSet ); CommandParameters parameters = new CommandParameters(); parameters.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); if ( lastUpdate != null ) { parameters.setDate( CommandParameter.START_DATE, lastUpdate ); } parameters.setString( CommandParameter.CHANGELOG_DATE_PATTERN, datePattern ); parameters.setString( CommandParameter.RUN_CHANGELOG_WITH_UPDATE, "true" ); return update( repository.getProviderRepository(), fileSet, parameters ); } protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { throw new NoSuchCommandScmException( "update" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void addListener( ScmLogger logger ) { logDispatcher.addListener( logger ); } public ScmLogger getLogger() { return logDispatcher; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { throw new UnknownRepositoryStructure(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepository.java0000644000175000017500000000720410535556312033234 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @version $Id: ScmProviderRepository.java 483105 2006-12-06 15:07:54Z evenisse $ */ public abstract class ScmProviderRepository { private String user; private String password; private boolean persistCheckout = false; /** * @return The user. */ public String getUser() { return user; } /** * Set the user. * * @param user The user */ public void setUser( String user ) { this.user = user; } /** * @return The password. */ public String getPassword() { return password; } /** * Set the password. * * @param password The user password */ public void setPassword( String password ) { this.password = password; } /** * Will checkouts using this repository be persisted so they can * be refreshed in the future? This property is of concern to SCMs * like Perforce and Clearcase where the server must track where a * user checks out to. If false, the server entry (clientspec in Perforce * terminology) will be deleted after the checkout is complete so the * files will not be able to be updated. *

* This setting can be overriden by using the system property * "maven.scm.persistcheckout" to true. *

* The default is false. See SCM-113 for more detail. */ public boolean isPersistCheckout() { String persist = System.getProperty( "maven.scm.persistcheckout" ); if ( persist != null ) { return Boolean.valueOf( persist ).booleanValue(); } return persistCheckout; } public void setPersistCheckout( boolean persistCheckout ) { this.persistCheckout = persistCheckout; } /** * Get a {@link ScmProviderRepository} that represents the parent folder in the repository. * Useful when the repository does not exist yet and we need to create it from the parent. * * @return the parent repository * @throws UnsupportedOperationException unless overridden by subclass */ public ScmProviderRepository getParent() { throw new UnsupportedOperationException(); } /** * Get the relative path between the repository provided as argument and the current repository. * * @param ancestor another repository that should be ancestor of this one * @return the relative path or null if it can't be resolved * @throws UnsupportedOperationException unless overridden by subclass */ public String getRelativePath( ScmProviderRepository ancestor ) { throw new UnsupportedOperationException(); } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmUrlUtils.java0000644000175000017500000001117411051271351031115 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ import java.util.ArrayList; import java.util.List; /** * A utility class that validates and parses scm url:s. The code here is * not scm provider specific. *

* If you need methods that work for a specific scm provider, please create a * similar class for that provider. E.g. create the class CvsScmUrlUtils if * you need cvs specific checking/parsing. *

* * @author Dennis Lundberg * @version $Id: ScmUrlUtils.java 686197 2008-08-15 12:13:29Z vsiveton $ */ public abstract class ScmUrlUtils { private static final String ILLEGAL_SCM_URL = "The scm url must be on the form 'scm:' " + "where can be either ':' or '|'."; /** * Get the delimiter used in the scm url. * * @param scmUrl A valid scm url to parse * @return The delimiter used in the scm url */ public static String getDelimiter( String scmUrl ) { scmUrl = scmUrl.substring( 4 ); int index = scmUrl.indexOf( '|' ); if ( index == -1 ) { index = scmUrl.indexOf( ':' ); if ( index == -1 ) { throw new IllegalArgumentException( "The scm url does not contain a valid delimiter." ); } } return scmUrl.substring( index, index + 1 ); } /** * Get the scm provider from the scm url. * * @param scmUrl A valid scm url to parse * @return The scm provider from the scm url */ public static String getProvider( String scmUrl ) { String delimiter = getDelimiter( scmUrl ); scmUrl = scmUrl.substring( 4 ); int firstDelimiterIndex = scmUrl.indexOf( delimiter ); return scmUrl.substring( 0, firstDelimiterIndex ); } /** * Get the provider specific part of the scm url. * * @param scmUrl A valid scm url to parse * @return The provider specific part of the scm url */ public static String getProviderSpecificPart( String scmUrl ) { String delimiter = getDelimiter( scmUrl ); scmUrl = scmUrl.substring( 4 ); int firstDelimiterIndex = scmUrl.indexOf( delimiter ); return scmUrl.substring( firstDelimiterIndex + 1 ); } /** * Validate that the scm url is in the correct format. *

* Note: does not validate scm provider specific format. *

* * @param scmUrl The scm url to validate * @return true if the scm url is in the correct format, * otherwise false */ public static boolean isValid( String scmUrl ) { List messages = validate( scmUrl ); return messages.isEmpty(); } /** * Validate that the scm url is in the correct format. *

* Note: does not validate scm provider specific format. *

* * @param scmUrl The scm url to validate * @return A List that contains the errors that occured */ public static List validate( String scmUrl ) { List messages = new ArrayList(); if ( scmUrl == null ) { messages.add( "The scm url cannot be null." ); return messages; } if ( !scmUrl.startsWith( "scm:" ) ) { messages.add( "The scm url must start with 'scm:'." ); return messages; } if ( scmUrl.length() < 6 ) { messages.add( ILLEGAL_SCM_URL ); return messages; } try { String delimiter = getDelimiter( scmUrl ); } catch ( IllegalArgumentException e ) { messages.add( e.getMessage() ); } return messages; } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepositoryWithHost.javamaven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepositoryWithHos0000644000175000017500000000346011157300235033612 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ /** * @author Emmanuel Venisse * @version $Id: ScmProviderRepositoryWithHost.java 754778 2009-03-15 22:26:37Z olamy $ */ public abstract class ScmProviderRepositoryWithHost extends ScmProviderRepository { private String host; private int port; private String privateKey; private String passphrase; public String getHost() { return host; } public void setHost( String host ) { this.host = host; } public int getPort() { return port; } public void setPort( int port ) { this.port = port; } public String getPrivateKey() { return privateKey; } public void setPrivateKey( String privateKey ) { this.privateKey = privateKey; } public String getPassphrase() { return passphrase; } public void setPassphrase( String passphrase ) { this.passphrase = passphrase; } } maven-scm-1.3/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java0000644000175000017500000011255211313217053031126 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.Date; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: ScmProvider.java 892494 2009-12-19 18:40:43Z olamy $ */ public interface ScmProvider { String ROLE = ScmProvider.class.getName(); String getScmType(); /** * Add a logger listener. * * @param logger The logger */ void addListener( ScmLogger logger ); boolean requiresEditMode(); ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException; ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure; /** * Validate the scm url. * * @param scmSpecificUrl The SCM url * @param delimiter The delimiter used in the SCM url * @return Returns a list of messages if the validation failed */ List validateScmUrl( String scmSpecificUrl, char delimiter ); /** * Returns the scm reserved file name where the SCM stores information like 'CVS', '.svn'. * * @return the scm reserved file name */ String getScmSpecificFilename(); /** * Check if this tag is valid for this SCM provider. * * @param tag tag name to check * @return true if tag is valid */ boolean validateTagName( String tag ); /** * Given a tag name, make it suitable for this SCM provider. For example, CVS converts "." into "_" * * @param tag input tag name * @return sanitized tag name */ String sanitizeTagName( String tag ); /** * Adds the given files to the source control system * * @param repository the source control system * @param fileSet the files to be added * @return an {@link AddScmResult} that contains the files that have been added * @throws ScmException if any */ AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Adds the given files to the source control system * * @param repository the source control system * @param fileSet the files to be added * @param message a string that is a comment on the new added file * @return an {@link AddScmResult} that contains the files that have been added * @throws ScmException if any */ AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Branch (or label in some systems) will create a branch of the source file with a certain branch name * * @param repository the source control system * @param fileSet the files to branch. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param branchName the branch name to apply to the files * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)} * @return * @throws ScmException if any */ BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException; /** * Branch (or label in some systems) will create a branch of the source file with a certain branch name * * @param repository the source control system * @param fileSet the files to branch. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param branchName the branch name to apply to the files * @param message the commit message used for the tag creation * @deprecated use {@link #branch(ScmRepository, ScmFileSet, String, String, ScmBranchParameters)} * @return * @throws ScmException if any */ BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException; /** * Branch (or label in some systems) will create a branch of the source file with a certain * branch name * * @param repository the source control system * @param fileSet the files to branch. Implementations can also give the changes from the * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param branchName the branch name to apply to the files * @param message the commit message used for the tag creation * @since 1.3 * @return * @throws ScmException if any */ BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, ScmBranchParameters scmBranchParameters ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag name * @return The SCM result of the changelog command * @throws ScmException if any * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,org.apache.maven.scm.ScmBranch)} */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag name * @param datePattern the date pattern use in changelog output returned by scm tool * @return The SCM result of the changelog command * @throws ScmException if any * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,java.util.Date,java.util.Date,int,org.apache.maven.scm.ScmBranch,String)} */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch, String datePattern ) throws ScmException; /** * Returns the changes that have happend in the source control system in a certain period of time. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startDate the start date of the period * @param endDate the end date of the period * @param numDays the number days before the current time if startdate and enddate are null * @param branch the branch/tag * @param datePattern the date pattern use in changelog output returned by scm tool * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startTag the start tag * @param endTag the end tag * @return The SCM result of the changelog command * @throws ScmException if any * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,org.apache.maven.scm.ScmVersion)} */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startVersion the start branch/tag/revision * @param endVersion the end branch/tag/revision * @return The SCM result of the changelog command * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startTag the start tag * @param endTag the end tag * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#changeLog(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,org.apache.maven.scm.ScmVersion,String)} */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag, String datePattern ) throws ScmException; /** * Returns the changes that have happend in the source control system between two tags. * This can be adding, removing, updating, ... of files * * @param repository the source control system * @param fileSet the files to know the changes about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param startRevision the start revision * @param endRevision the end revision * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern ) throws ScmException; /** * Save the changes you have done into the repository. This will create a new version of the file or * directory in the repository. *

* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet * are committed. * * @param repository the source control system * @param fileSet the files to check in (sometimes called commit) * @param tag tag or revision * @param message a string that is a comment on the changes that where done * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#checkIn(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,String)} */ CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message ) throws ScmException; /** * Save the changes you have done into the repository. This will create a new version of the file or * directory in the repository. *

* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet * are committed. * * @param repository the source control system * @param fileSet the files to check in (sometimes called commit) * @param message a string that is a comment on the changes that where done * @return * @throws ScmException if any */ CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Save the changes you have done into the repository. This will create a new version of the file or * directory in the repository. *

* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. * When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet * are committed. * * @param repository the source control system * @param fileSet the files to check in (sometimes called commit) * @param revision branch/tag/revision * @param message a string that is a comment on the changes that where done * @return * @throws ScmException if any */ CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) throws ScmException; /** * Create a copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param tag get the version defined by the tag * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion)} */ CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException; /** * Create a copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Create a copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the revision, branch or tag * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Create a copy of the repository on your local machine. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param tag tag or revision * @param recursive whether to check out recursively * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#checkOut(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,boolean)} */ CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, String tag, boolean recursive ) throws ScmException; /** * Create a copy of the repository on your local machine. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param recursive whether to check out recursively * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, boolean recursive ) throws ScmException; /** * Create a copy of the repository on your local machine. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the revision, branch or tag * @param recursive whether to check out recursively * @return * @throws ScmException if any */ CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version, boolean recursive ) throws ScmException; /** * Create a diff between two branch/tag/revision. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param startRevision the start revision * @param endRevision the end revision * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#diff(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,org.apache.maven.scm.ScmVersion)} */ DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, String startRevision, String endRevision ) throws ScmException; /** * Create a diff between two branch/tag/revision. * * @param scmRepository the source control system * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param startVersion the start branch/tag/revision * @param endVersion the end branch/tag/revision * @return * @throws ScmException if any */ DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param tag get the version defined by the tag * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion)} */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the branch/tag/revision * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param tag get the version defined by the tag * @param outputDirectory the directory where the export will be stored * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#export(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,String)} */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory ) throws ScmException; /** * Create an exported copy of the repository on your local machine * * @param repository the source control system * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location * @param version get the version defined by the branch/tag/revision * @param outputDirectory the directory where the export will be stored * @return * @throws ScmException if any */ ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException; /** * Removes the given files from the source control system * * @param repository the source control system * @param fileSet the files to be removed * @param message * @return * @throws ScmException if any */ RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException; /** * Returns the status of the files in the source control system. The state of each file can be one * of the {@link org.apache.maven.scm.ScmFileStatus} flags. * * @param repository the source control system * @param fileSet the files to know the status about. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @return * @throws ScmException if any */ StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Tag (or label in some systems) will tag the source file with a certain tag * * @param repository the source control system * @param fileSet the files to tag. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param tagName the tag name to apply to the files * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} * @return * @throws ScmException if any */ TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) throws ScmException; /** * Tag (or label in some systems) will tag the source file with a certain tag * * @param repository the source control system * @param fileSet the files to tag. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param tagName the tag name to apply to the files * @param message the commit message used for the tag creation * @deprecated use {@link #tag(ScmRepository, ScmFileSet, String, ScmTagParameters)} * @return * @throws ScmException if any */ TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException; /** * Tag (or label in some systems) will tag the source file with a certain tag * * @param repository the source control system * @param fileSet the files to tag. Implementations can also give the changes * from the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards. * @param tagName the tag name to apply to the files * @param scmTagParameters bean to pass some paramters for tagging {@link ScmTagParameters} * @return * @since 1.2 * @throws ScmException if any */ TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param tag use the version defined by the tag * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion)} */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param tag use the version defined by the tag * @param runChangelog Run the changelog command after the update * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,boolean)} */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param runChangelog Run the changelog command after the update * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param runChangelog Run the changelog command after the update * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param tag use the version defined by the tag * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,String)} */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param tag use the version defined by the tag * @param lastUpdate * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,java.util.Date)} */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param lastUpdate * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param tag use the version defined by the tag * @param lastUpdate Date of last update * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any * @deprecated you must use {@link ScmProvider#update(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,org.apache.maven.scm.ScmVersion,java.util.Date,String)} */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, String datePattern ) throws ScmException; /** * Updates the copy on the local machine with the changes in the repository * * @param repository the source control system * @param fileSet location of your local copy * @param version use the version defined by the branch/tag/revision * @param lastUpdate Date of last update * @param datePattern the date pattern use in changelog output returned by scm tool * @return * @throws ScmException if any */ UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern ) throws ScmException; /** * Make a file editable. This is used in source control systems where you look at read-only files * and you need to make them not read-only anymore before you can edit them. This can also mean * that no other user in the system can make the file not read-only anymore. * * @param repository the source control system * @param fileSet the files to make editable * @return * @throws ScmException if any */ EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * Make a file no longer editable. This is the conterpart of {@link #edit( * org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)}. * It makes the file read-only again. * * @param repository the source control system * @param fileSet the files to make uneditable * @return * @throws ScmException if any */ UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException; /** * List each element (files and directories) of fileSet as they exist in the repository. * * @param repository the source control system * @param fileSet the files to list * @param recursive descend recursively * @param tag use the version defined by the tag * @return the list of files in the repository * @deprecated you must use {@link ScmProvider#list(org.apache.maven.scm.repository.ScmRepository, * org.apache.maven.scm.ScmFileSet,boolean,org.apache.maven.scm.ScmVersion)} */ ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag ) throws ScmException; /** * List each element (files and directories) of fileSet as they exist in the repository. * * @param repository the source control system * @param fileSet the files to list * @param recursive descend recursively * @param version use the version defined by the branch/tag/revision * @return the list of files in the repository * @throws ScmException if any */ ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException; } maven-scm-1.3/maven-scm-api/pom.xml0000644000175000017500000000305111322611461017147 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm 1.3 maven-scm-api Maven SCM API The SCM API provides mechanisms to manage all SCM tools. junit junit test maven-scm-1.3/maven-scm-providers/0000755000175000017500000000000011345536671017115 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-standard/0000755000175000017500000000000011345536667024621 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-standard/pom.xml0000644000175000017500000000702711322611461026121 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-providers-standard pom Maven SCM Standard Providers org.apache.maven.scm maven-scm-provider-accurev runtime org.apache.maven.scm maven-scm-provider-bazaar runtime org.apache.maven.scm maven-scm-provider-clearcase runtime org.apache.maven.scm maven-scm-provider-cvsexe runtime org.apache.maven.scm maven-scm-provider-cvsjava runtime org.apache.maven.scm maven-scm-provider-gitexe runtime org.apache.maven.scm maven-scm-provider-hg runtime org.apache.maven.scm maven-scm-provider-perforce runtime org.apache.maven.scm maven-scm-provider-starteam runtime org.apache.maven.scm maven-scm-provider-svnexe runtime org.apache.maven.scm maven-scm-provider-synergy runtime org.apache.maven.scm maven-scm-provider-vss runtime org.apache.maven.scm maven-scm-provider-tfs runtime maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/0000755000175000017500000000000011345536666023613 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/0000755000175000017500000000000011345536666030764 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/0000755000175000017500000000000011345536666031553 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/site/0000755000175000017500000000000011345536666032517 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/site/site.x0000644000175000017500000000211711051127665033642 0ustar twernertwerner

maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/0000755000175000017500000000000011345536666032532 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/0000755000175000017500000000000011345536666033453 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227110606723477033633 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.branch; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.branch.CvsBranchCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaBranchCommandTckTest.java 527150 2007-04-10 15:03:27Z evenisse $ */ public class CvsJavaBranchCommandTckTest extends CvsBranchCommandTckTest { } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/update/CvsJavaUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227110576061775033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.update; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaUpdateCommandTckTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaUpdateCommandTckTest extends CvsUpdateCommandTckTest { } ././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/update/CvsJavaUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000225510576061775033637 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.update; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaUpdateCommandTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaUpdateCommandTest extends CvsUpdateCommandTest { } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkout/CvsJavaCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000230510576061775033633 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckOutCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaCheckOutCommandTckTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaCheckOutCommandTckTest extends CvsCheckOutCommandTckTest { } ././@LongLink0000000000000000000000000000030100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkout/CvsJavaCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227110576061775033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaCheckOutCommandTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaCheckOutCommandTest extends CvsCheckoutCommandTest { } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/status/CvsJavaStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227110576061775033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.status; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.status.CvsStatusCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaStatusCommandTckTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaStatusCommandTckTest extends CvsStatusCommandTckTest { } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/tag/CvsJavaTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000224710576061775033640 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.tag; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.tag.CvsTagCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaTagCommandTckTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaTagCommandTckTest extends CvsTagCommandTckTest { } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkin/CvsJavaCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227710576045515033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkin.CvsCheckInCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaCheckInCommandTckTest.java 518273 2007-03-14 19:21:49Z evenisse $ */ public class CvsJavaCheckInCommandTckTest extends CvsCheckInCommandTckTest { } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000755000175000017500000000000011345536666033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/changelog/CvsJavaChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/java/o0000644000175000017500000000227710576061775033643 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.changelog; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.changelog.CvsChangeLogCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsJavaChangeLogCommandTest.java 518326 2007-03-14 21:07:09Z evenisse $ */ public class CvsJavaChangeLogCommandTest extends CvsChangeLogCommandTest { } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/update/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000043310401330340033723 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/update/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000055510401330340033730 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2004.10.18.13.23.14; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @o Initial commit. @ text @/* $Log: Foo.java,v,v $ Revision 1.1.1.1 2004/10/20 18:03:42 trygvis o Reimport of a maven-scm. $Id: Foo.java,v,v 1.1.1.1 2004/10/20 18:03:42 trygvis Exp $ */ public class Foo { } @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000064021110401330340033727 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000046310401330340033726 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/checkout/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000040010401330340033715 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @public class Foo { } @ ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/test-repo/changelog/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000064021110401330340033727 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000755000175000017500000000000011345536666033754 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000115510401330340033725 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000251610401330340033727 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000327610401330340033733 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. #UseNewInfoFmtStrings=yes././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000255210401330340033727 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/val-tagsmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000001510401330340033717 0ustar twernertwernerMAVEN_1_0 y ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000140110401330340033717 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000413010401330340033721 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000133610401330340033726 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000002310401330340033716 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000365510401330340033734 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. UseNewInfoFmtStrings=yes @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000311410401330340033722 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000151710401330340033727 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000335410401330340033730 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000447210401330340033732 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000215410401330340033725 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000174310401330340033730 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" @ ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000077410401330340033733 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000601210401330340033722 0ustar twernertwernerΚW&<îÿ(¹ï$Ÿ-ûRc“†Àîÿ(¹Ÿ-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹!Ù-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹éØ !îÿ(¹ÑØ$Ÿ D:\apache\maven\trunks\scm\maven-scm-providers\maven-scm-provider-cvs\src\test\repository/test-repo/checkout/src/java/org/apache/maven/.svn/wcprops/MavenUtils.java,v.svn-work© ! ! !¹× ÿ$ÿ-ûRc“†Àîÿ(¹ï © ! ! !ïש ! ! !¹Öö ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?›õ MAVE ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿMAVEN_1_0y././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000157010401330340033726 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000257310401330340033732 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000371610401330340033732 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000122610401330340033724 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/reposi0000644000175000017500000000223110401330340033721 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/test/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/test/java/Test.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000060610401330340033611 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/test/java/Test.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/main/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/src/main/java/Application.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000061510401330340033611 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/main/java/Application.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/pom.xml,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000056610401330340033616 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/pom.xml@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/test-repo/module/readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000057110401330340033612 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/readme.txt@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000755000175000017500000000000011345536666033640 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000113210401330340033604 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000170110401330340033606 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000173710401330340033617 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000200210401330340033601 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/editinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000231210401330340033605 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000106410401330340033610 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/editinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000200110401330340033600 0ustar twernertwerner# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000155710401330340033617 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000127010401330340033607 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000002310401330340033602 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000225010401330340033606 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always @ ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000231310401330340033606 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000144310401330340033611 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000216510401330340033613 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/historymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000000010401330340033575 0ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000207010401330340033606 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000137010401330340033610 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000137510401330340033615 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s @ ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000075710401330340033620 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000000010401330340033575 0ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/modules.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000600010401330340033603 0ustar twernertwernerΚW&<Íy—[Úêí*¼ d$ŸÍy—[Úêí*¼ î$ŸÍy—[Úêí*¼ ‰ñ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000152210401330340033607 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000251010401330340033605 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000247610401330340033620 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000121110401330340033602 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/test/tck-re0000644000175000017500000000217710401330340033616 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/0000755000175000017500000000000011345536666032477 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/0000755000175000017500000000000011345536666033420 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/login/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/login/CvsJavaLoginCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000246511050561465033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.login; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.provider.cvslib.command.login.CvsLoginCommand; /** * @author Emmanuel Venisse * @version $Id: CvsJavaLoginCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaLoginCommand extends CvsLoginCommand { /** {@inheritDoc} */ public boolean isCvsNT() throws ScmException { return false; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/branch/CvsJavaBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000613311050561465033570 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.branch; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.cvslib.command.branch.AbstractCvsBranchCommand; import org.apache.maven.scm.provider.cvslib.command.branch.CvsBranchConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaBranchCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaBranchCommand extends AbstractCvsBranchCommand { /** {@inheritDoc} */ protected BranchScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsBranchConsumer consumer = new CvsBranchConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new BranchScmResult( cl.toString(), "The cvs branch command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new BranchScmResult( cl.toString(), "The cvs branch command failed.", logListener.getStderr().toString(), false ); } return new BranchScmResult( cl.toString(), consumer.getTaggedFiles() ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/update/CvsJavaUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000667411050561465033602 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateCommand; import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.command.changelog.CvsJavaChangeLogCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaUpdateCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaUpdateCommand extends AbstractCvsUpdateCommand { /** {@inheritDoc} */ protected UpdateScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsUpdateConsumer consumer = new CvsUpdateConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new UpdateScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new UpdateScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() ); } protected ChangeLogCommand getChangeLogCommand() { CvsJavaChangeLogCommand command = new CvsJavaChangeLogCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkout/CvsJavaCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000616511050561465033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.cvslib.command.checkout.AbstractCvsCheckOutCommand; import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckOutConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaCheckOutCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaCheckOutCommand extends AbstractCvsCheckOutCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsCheckOutConsumer consumer = new CvsCheckOutConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new CheckOutScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new CheckOutScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles() ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/status/CvsJavaStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000615011050561465033567 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.cvslib.command.status.AbstractCvsStatusCommand; import org.apache.maven.scm.provider.cvslib.command.status.CvsStatusConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaStatusCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaStatusCommand extends AbstractCvsStatusCommand { /** {@inheritDoc} */ protected StatusScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsStatusConsumer consumer = new CvsStatusConsumer( getLogger(), cl.getWorkingDirectory() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new StatusScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new StatusScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/export/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/export/CvsJavaExportCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000611611050561465033571 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.export; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.provider.cvslib.command.export.AbstractCvsExportCommand; import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaExportCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaExportCommand extends AbstractCvsExportCommand { /** {@inheritDoc} */ protected ExportScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsUpdateConsumer consumer = new CvsUpdateConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new ExportScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new ExportScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } return new ExportScmResult( cl.toString(), consumer.getUpdatedFiles() ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/remove/CvsJavaRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000605411057610744033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.cvslib.command.remove.AbstractCvsRemoveCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: CvsJavaRemoveCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class CvsJavaRemoveCommand extends AbstractCvsRemoveCommand { /** {@inheritDoc} */ protected RemoveScmResult executeCvsCommand( Commandline cl, List removedFiles ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new RemoveScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); if ( getLogger().isDebugEnabled() ) { String line; while ( ( line = stream.readLine() ) != null ) { getLogger().debug( line ); } } } catch ( Exception e ) { e.printStackTrace(); return new RemoveScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } return new RemoveScmResult( cl.toString(), removedFiles ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/tag/CvsJavaTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000603711050561465033573 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.cvslib.command.tag.AbstractCvsTagCommand; import org.apache.maven.scm.provider.cvslib.command.tag.CvsTagConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaTagCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaTagCommand extends AbstractCvsTagCommand { /** {@inheritDoc} */ protected TagScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsTagConsumer consumer = new CvsTagConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new TagScmResult( cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new TagScmResult( cl.toString(), "The cvs tag command failed.", logListener.getStderr().toString(), false ); } return new TagScmResult( cl.toString(), consumer.getTaggedFiles() ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027300000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/checkin/CvsJavaCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000716111050561465033572 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.cvslib.command.checkin.AbstractCvsCheckInCommand; import org.apache.maven.scm.provider.cvslib.command.checkin.CvsCheckInConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaCheckInCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaCheckInCommand extends AbstractCvsCheckInCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCvsCommand( Commandline cl, CvsScmProviderRepository repository, File messageFile ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsCheckInConsumer consumer = new CvsCheckInConsumer( repository.getPath(), getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new CheckInScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new CheckInScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/list/CvsJavaListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000604511052530244033563 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.list; /* * 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. */ import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.cvslib.command.list.AbstractCvsListCommand; import org.apache.maven.scm.provider.cvslib.command.list.CvsListConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsJavaListCommand.java 687023 2008-08-19 11:38:12Z vsiveton $ */ public class CvsJavaListCommand extends AbstractCvsListCommand { /** {@inheritDoc} */ protected ListScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsListConsumer consumer = new CvsListConsumer( getLogger() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new ListScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new ListScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } return new ListScmResult( cl.toString(), consumer.getEntries() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/diff/CvsJavaDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000635311050561465033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.cvslib.command.diff.AbstractCvsDiffCommand; import org.apache.maven.scm.provider.cvslib.command.diff.CvsDiffConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: CvsJavaDiffCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaDiffCommand extends AbstractCvsDiffCommand { /** {@inheritDoc} */ protected DiffScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsDiffConsumer consumer = new CvsDiffConsumer( getLogger(), cl.getWorkingDirectory() ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new DiffScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new DiffScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch() ); } protected boolean isSupportNewFileParameter() { return false; } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027700000000000011573 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/changelog/CvsJavaChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000735611057005130033565 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.cvslib.command.changelog.AbstractCvsChangeLogCommand; import org.apache.maven.scm.provider.cvslib.command.changelog.CvsChangeLogConsumer; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.util.Date; /** * @author Emmanuel Venisse * @version $Id: CvsJavaChangeLogCommand.java 690997 2008-09-01 15:29:28Z vsiveton $ */ public class CvsJavaChangeLogCommand extends AbstractCvsChangeLogCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeCvsCommand( Commandline cl, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); CvsChangeLogConsumer consumer = new CvsChangeLogConsumer( getLogger(), datePattern ); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); if ( !isSuccess ) { return new ChangeLogScmResult( cl.toString(), "The cvs command failed.", logListener.getStderr().toString(), false ); } BufferedReader stream = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( logListener.getStdout().toString().getBytes() ) ) ); String line; while ( ( line = stream.readLine() ) != null ) { consumer.consumeLine( line ); } } catch ( Exception e ) { e.printStackTrace(); return new ChangeLogScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate ); changeLogSet.setStartVersion( startVersion ); changeLogSet.setEndVersion( endVersion ); return new ChangeLogScmResult( cl.toString(), changeLogSet ); } protected void addDateRangeParameter( Commandline cl, String dateRange ) { cl.createArg().setValue( dateRange ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/command/add/CvsJavaAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000515311050561465033571 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.cvslib.command.add.AbstractCvsAddCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection; import org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener; import org.codehaus.plexus.util.cli.Commandline; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: CvsJavaAddCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsJavaAddCommand extends AbstractCvsAddCommand { /** {@inheritDoc} */ protected AddScmResult executeCvsCommand( Commandline cl, List addedFiles ) throws ScmException { CvsLogListener logListener = new CvsLogListener(); try { boolean isSuccess = CvsConnection.processCommand( cl.getArguments(), cl.getWorkingDirectory().getAbsolutePath(), logListener, getLogger() ); // TODO: actually it may have partially succeeded - should we cvs update the files and parse "A " responses? if ( !isSuccess ) { return new AddScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } return new AddScmResult( cl.toString(), addedFiles ); } catch ( Exception e ) { e.printStackTrace(); return new AddScmResult( cl.toString(), "The cvs command failed.", logListener.getStdout().toString(), false ); } } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/util/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000755000175000017500000000000011345536666033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/util/CvsLogListener.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000507211053104703033560 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.util; /* * 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. */ import org.netbeans.lib.cvsclient.event.CVSAdapter; import org.netbeans.lib.cvsclient.event.MessageEvent; /** * A basic implementation of a CVS listener. It merely saves up * into StringBuffers the stdout and stderr printstreams. * * @author Eric Pugh * @version $Id: CvsLogListener.java 687470 2008-08-20 21:16:51Z olamy $ */ public class CvsLogListener extends CVSAdapter { private final StringBuffer taggedLine = new StringBuffer(); private StringBuffer stdout = new StringBuffer(); private StringBuffer stderr = new StringBuffer(); /** * Called when the server wants to send a message to be displayed to the * user. The message is only for information purposes and clients can * choose to ignore these messages if they wish. * * {@inheritDoc} */ public void messageSent( MessageEvent e ) { String line = e.getMessage(); StringBuffer stream = e.isError() ? stderr : stdout; if ( e.isTagged() ) { String message = MessageEvent.parseTaggedMessage( taggedLine, e.getMessage() ); if ( message != null ) { //stream.println(message); stream.append( message ).append( "\n" ); } } else { //stream.println(line); stream.append( line ).append( "\n" ); } } /** * @return Returns the standard output from cvs as a StringBuffer.. */ public StringBuffer getStdout() { return stdout; } /** * @return Returns the standard error from cvs as a StringBuffer.. */ public StringBuffer getStderr() { return stderr; } }././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/util/ExtConnection.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000002041411050561465033566 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.util; /* * 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. */ import ch.ethz.ssh2.Connection; import ch.ethz.ssh2.Session; import ch.ethz.ssh2.StreamGobbler; import org.netbeans.lib.cvsclient.CVSRoot; import org.netbeans.lib.cvsclient.command.CommandAbortedException; import org.netbeans.lib.cvsclient.connection.AbstractConnection; import org.netbeans.lib.cvsclient.connection.AuthenticationException; import org.netbeans.lib.cvsclient.connection.ConnectionModifier; import org.netbeans.lib.cvsclient.util.LoggedDataInputStream; import org.netbeans.lib.cvsclient.util.LoggedDataOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: ExtConnection.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class ExtConnection extends AbstractConnection { private String host; private int port; private String userName; private String password; private Connection connection; private Session session; private BufferedReader stderrReader; public ExtConnection( CVSRoot cvsRoot ) { this( cvsRoot.getHostName(), cvsRoot.getPort(), cvsRoot.getUserName(), cvsRoot.getPassword(), cvsRoot.getRepository() ); } public ExtConnection( String host, int port, String username, String password, String repository ) { this.userName = username; if ( this.userName == null ) { this.userName = System.getProperty( "user.name" ); } this.password = password; this.host = host; setRepository( repository ); this.port = port; if ( this.port == 0 ) { this.port = 22; } } /** {@inheritDoc} */ public void open() throws AuthenticationException, CommandAbortedException { connection = new Connection( host, port ); /* TODO: add proxy support ProxyData proxy = new HTTPProxyData( proxyHost, proxyPort, proxyUserName, proxyPassword ); connection.setProxyData( proxy ); */ try { // TODO: connection timeout? connection.connect(); } catch ( IOException e ) { String message = "Cannot connect. Reason: " + e.getMessage(); throw new AuthenticationException( message, e, message ); } File privateKey = getPrivateKey(); try { boolean authenticated; if ( privateKey != null && privateKey.exists() ) { authenticated = connection.authenticateWithPublicKey( userName, privateKey, getPassphrase() ); } else { authenticated = connection.authenticateWithPassword( userName, password ); } if ( !authenticated ) { String message = "Authentication failed."; throw new AuthenticationException( message, message ); } } catch ( IOException e ) { closeConnection(); String message = "Cannot authenticate. Reason: " + e.getMessage(); throw new AuthenticationException( message, e, message ); } try { session = connection.openSession(); } catch ( IOException e ) { String message = "Cannot open session. Reason: " + e.getMessage(); throw new CommandAbortedException( message, message ); } String command = "cvs server"; try { session.execCommand( command ); } catch ( IOException e ) { String message = "Cannot execute remote command: " + command; throw new CommandAbortedException( message, message ); } InputStream stdout = new StreamGobbler( session.getStdout() ); InputStream stderr = new StreamGobbler( session.getStderr() ); stderrReader = new BufferedReader( new InputStreamReader( stderr ) ); setInputStream( new LoggedDataInputStream( stdout ) ); setOutputStream( new LoggedDataOutputStream( session.getStdin() ) ); } /** {@inheritDoc} */ public void verify() throws AuthenticationException { try { open(); verifyProtocol(); close(); } catch ( Exception e ) { String message = "Failed to verify the connection: " + e.getMessage(); throw new AuthenticationException( message, e, message ); } } private void closeConnection() { try { if ( stderrReader != null ) { while ( true ) { String line = stderrReader.readLine(); if ( line == null ) { break; } System.err.println( line ); } } } catch ( IOException e ) { //nothing to do } if ( session != null ) { System.out.println( "Exit code:" + session.getExitStatus().intValue() ); session.close(); } if ( connection != null ) { connection.close(); } reset(); } private void reset() { connection = null; session = null; stderrReader = null; setInputStream( null ); setOutputStream( null ); } /** {@inheritDoc} */ public void close() throws IOException { closeConnection(); } /** {@inheritDoc} */ public boolean isOpen() { return connection != null; } /** {@inheritDoc} */ public int getPort() { return port; } /** {@inheritDoc} */ public void modifyInputStream( ConnectionModifier modifier ) throws IOException { modifier.modifyInputStream( getInputStream() ); } /** {@inheritDoc} */ public void modifyOutputStream( ConnectionModifier modifier ) throws IOException { modifier.modifyOutputStream( getOutputStream() ); } private File getPrivateKey() { // If user don't define a password, he want to use a private key File privateKey = null; if ( password == null ) { String pk = System.getProperty( "maven.scm.cvs.java.ssh.privateKey" ); if ( pk != null ) { privateKey = new File( pk ); } else { privateKey = findPrivateKey(); } } return privateKey; } private String getPassphrase() { String passphrase = System.getProperty( "maven.scm.cvs.java.ssh.passphrase" ); if ( passphrase == null ) { passphrase = ""; } return passphrase; } private File findPrivateKey() { String privateKeyDirectory = System.getProperty( "maven.scm.ssh.privateKeyDirectory" ); if ( privateKeyDirectory == null ) { privateKeyDirectory = System.getProperty( "user.home" ); } File privateKey = new File( privateKeyDirectory, ".ssh/id_dsa" ); if ( !privateKey.exists() ) { privateKey = new File( privateKeyDirectory, ".ssh/id_rsa" ); } return privateKey; } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/util/CvsConnection.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000003754611057621704033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava.util; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.netbeans.lib.cvsclient.CVSRoot; import org.netbeans.lib.cvsclient.Client; import org.netbeans.lib.cvsclient.admin.StandardAdminHandler; import org.netbeans.lib.cvsclient.command.Command; import org.netbeans.lib.cvsclient.command.CommandAbortedException; import org.netbeans.lib.cvsclient.command.CommandException; import org.netbeans.lib.cvsclient.command.GlobalOptions; import org.netbeans.lib.cvsclient.commandLine.CommandFactory; import org.netbeans.lib.cvsclient.commandLine.GetOpt; import org.netbeans.lib.cvsclient.connection.AbstractConnection; import org.netbeans.lib.cvsclient.connection.AuthenticationException; import org.netbeans.lib.cvsclient.connection.Connection; import org.netbeans.lib.cvsclient.connection.ConnectionFactory; import org.netbeans.lib.cvsclient.connection.PServerConnection; import org.netbeans.lib.cvsclient.connection.StandardScrambler; import org.netbeans.lib.cvsclient.event.CVSListener; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; /** * A Cvs connection that simulates a command line interface. * * @author Eric Pugh * @version $Id: CvsConnection.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsConnection { /** * The path to the repository on the server */ private String repository; /** * The local path to use to perform operations (the top level) */ private String localPath; /** * The connection to the server */ private Connection connection; /** * The client that manages interactions with the server */ private Client client; /** * The global options being used. GlobalOptions are only global for a * particular command. */ private GlobalOptions globalOptions; private CvsConnection() { } /** * Execute a configured CVS command * * @param command the command to execute * @throws CommandException if there is an error running the command */ public boolean executeCommand( Command command ) throws CommandException, AuthenticationException { return client.executeCommand( command, globalOptions ); } public void setRepository( String repository ) { this.repository = repository; } public void setLocalPath( String localPath ) { this.localPath = localPath; } public void setGlobalOptions( GlobalOptions globalOptions ) { this.globalOptions = globalOptions; } /** * Creates the connection and the client and connects. */ private void connect( CVSRoot root, String password ) throws AuthenticationException, CommandAbortedException { if ( CVSRoot.METHOD_EXT.equals( root.getMethod() ) ) { String cvsRsh = System.getProperty( "maven.scm.cvs.java.cvs_rsh" ); if ( cvsRsh == null ) { try { cvsRsh = CommandLineUtils.getSystemEnvVars().getProperty( "CVS_RSH" ); } catch ( IOException e ) { // we assume searching env var can't fail } } if ( cvsRsh != null ) { if ( cvsRsh.indexOf( ' ' ) < 0 ) { //cvs_rsh should be 'rsh' or 'ssh' //Complete the command to use String username = root.getUserName(); if ( username == null ) { username = System.getProperty( "user.name" ); } cvsRsh += " " + username + "@" + root.getHostName() + " cvs server"; } AbstractConnection conn = new org.netbeans.lib.cvsclient.connection.ExtConnection( cvsRsh ); conn.setRepository( root.getRepository() ); connection = conn; } else { connection = new ExtConnection( root ); } } else { connection = ConnectionFactory.getConnection( root ); if ( CVSRoot.METHOD_PSERVER.equals( root.getMethod() ) ) { ( (PServerConnection) connection ).setEncodedPassword( password ); } } connection.open(); client = new Client( connection, new StandardAdminHandler() ); client.setLocalPath( localPath ); } private void disconnect() { if ( connection != null && connection.isOpen() ) { try { connection.close(); } catch ( IOException e ) { //ignore } } } private void addListener( CVSListener listener ) { if ( client != null ) { // add a listener to the client client.getEventManager().addCVSListener( listener ); } } /** * Obtain the CVS root, either from the -D option cvs.root or from the CVS * directory * * @return the CVSRoot string */ private static String getCVSRoot( String workingDir ) { String root = null; BufferedReader r = null; if ( workingDir == null ) { workingDir = System.getProperty( "user.dir" ); } try { File f = new File( workingDir ); File rootFile = new File( f, "CVS/Root" ); if ( rootFile.exists() ) { r = new BufferedReader( new FileReader( rootFile ) ); root = r.readLine(); } } catch ( IOException e ) { // ignore } finally { try { if ( r != null ) { r.close(); } } catch ( IOException e ) { System.err.println( "Warning: could not close CVS/Root file!" ); } } if ( root == null ) { root = System.getProperty( "cvs.root" ); } return root; } /** * Process global options passed into the application * * @param args the argument list, complete * @param globalOptions the global options structure that will be passed to * the command */ private static int processGlobalOptions( String[] args, GlobalOptions globalOptions ) { final String getOptString = globalOptions.getOptString(); GetOpt go = new GetOpt( args, getOptString ); int ch; while ( ( ch = go.getopt() ) != GetOpt.optEOF ) { //System.out.println("Global option '"+((char) ch)+"', // '"+go.optArgGet()+"'"); String arg = go.optArgGet(); boolean success = globalOptions.setCVSCommand( (char) ch, arg ); if ( !success ) { throw new IllegalArgumentException( "Failed to set CVS Command: -" + ch + " = " + arg ); } } return go.optIndexGet(); } /** * Lookup the password in the .cvspass file. This file is looked for in the * user.home directory if the option cvs.passfile is not set * * @param cvsRoot the CVS root for which the password is being searched * @return the password, scrambled */ private static String lookupPassword( String cvsRoot, ScmLogger logger ) { File passFile = new File( System.getProperty( "cygwin.user.home", System.getProperty( "user.home" ) ) + File .separatorChar + ".cvspass" ); BufferedReader reader = null; String password = null; try { reader = new BufferedReader( new FileReader( passFile ) ); password = processCvspass( cvsRoot, reader ); } catch ( IOException e ) { if ( logger.isWarnEnabled() ) { logger.warn( "Could not read password for '" + cvsRoot + "' from '" + passFile + "'", e ); } return null; } finally { if ( reader != null ) { try { reader.close(); } catch ( IOException e ) { if ( logger.isErrorEnabled() ) { logger.error( "Warning: could not close password file." ); } } } } if ( password == null ) { if ( logger.isErrorEnabled() ) { logger.error( "Didn't find password for CVSROOT '" + cvsRoot + "'." ); } } return password; } /** * Read in a list of return delimited lines from .cvspass and retreive * the password. Return null if the cvsRoot can't be found. * * @param cvsRoot the CVS root for which the password is being searched * @param reader A buffered reader of lines of cvspass information * @return The password, or null if it can't be found. * @throws IOException */ static String processCvspass( String cvsRoot, BufferedReader reader ) throws IOException { String line; String password = null; while ( ( line = reader.readLine() ) != null ) { if ( line.startsWith( "/" ) ) { String[] cvspass = StringUtils.split( line, " " ); String cvspassRoot = cvspass[1]; if ( compareCvsRoot( cvsRoot, cvspassRoot ) ) { int index = line.indexOf( cvspassRoot ) + cvspassRoot.length() + 1; password = line.substring( index ); break; } } else if ( line.startsWith( cvsRoot ) ) { password = line.substring( cvsRoot.length() + 1 ); break; } } return password; } static boolean compareCvsRoot( String cvsRoot, String target ) { String s1 = completeCvsRootPort( cvsRoot ); String s2 = completeCvsRootPort( target ); return s1 != null && s1.equals( s2 ); } private static String completeCvsRootPort( String cvsRoot ) { String result = cvsRoot; int idx = cvsRoot.indexOf( ':' ); for ( int i = 0; i < 2 && idx != -1; i++ ) { idx = cvsRoot.indexOf( ':', idx + 1 ); } if ( idx != -1 && cvsRoot.charAt( idx + 1 ) == '/' ) { StringBuffer sb = new StringBuffer(); sb.append( cvsRoot.substring( 0, idx + 1 ) ); sb.append( "2401" ); sb.append( cvsRoot.substring( idx + 1 ) ); result = sb.toString(); } return result; } /** * Process the CVS command passed in args[] array with all necessary * options. The only difference from main() method is, that this method * does not exit the JVM and provides command output. * * @param args The command with options */ public static boolean processCommand( String[] args, String localPath, CVSListener listener, ScmLogger logger ) throws Exception { // Set up the CVSRoot. Note that it might still be null after this // call if the user has decided to set it with the -d command line // global option GlobalOptions globalOptions = new GlobalOptions(); globalOptions.setCVSRoot( getCVSRoot( localPath ) ); // Set up any global options specified. These occur before the // name of the command to run int commandIndex; try { commandIndex = processGlobalOptions( args, globalOptions ); } catch ( IllegalArgumentException e ) { if ( logger.isErrorEnabled() ) { logger.error( "Invalid argument: " + e ); } return false; } // if we don't have a CVS root by now, the user has messed up if ( globalOptions.getCVSRoot() == null ) { if ( logger.isErrorEnabled() ) { logger.error( "No CVS root is set. Check your information in the POM." ); } return false; } // parse the CVS root into its constituent parts CVSRoot root; final String cvsRoot = globalOptions.getCVSRoot(); try { root = CVSRoot.parse( cvsRoot ); } catch ( IllegalArgumentException e ) { if ( logger.isErrorEnabled() ) { logger.error( "Incorrect format for CVSRoot: " + cvsRoot + "\nThe correct format is: " + "[:method:][[user][:password]@][hostname:[port]]/path/to/repository" + "\nwhere \"method\" is pserver." ); } return false; } final String command = args[commandIndex]; // this is not login, but a 'real' cvs command, so construct it, // set the options, and then connect to the server and execute it Command c; try { c = CommandFactory.getDefault().createCommand( command, args, ++commandIndex, globalOptions, localPath ); } catch ( IllegalArgumentException e ) { if ( logger.isErrorEnabled() ) { logger.error( "Illegal argument: " + e.getMessage() ); } return false; } String password = null; if ( CVSRoot.METHOD_PSERVER.equals( root.getMethod() ) ) { password = root.getPassword(); if ( password != null ) { password = StandardScrambler.getInstance().scramble( password ); } else { password = lookupPassword( cvsRoot, logger ); if ( password == null ) { password = StandardScrambler.getInstance().scramble( "" ); // an empty password } } } CvsConnection cvsCommand = new CvsConnection(); cvsCommand.setGlobalOptions( globalOptions ); cvsCommand.setRepository( root.getRepository() ); // the local path is just the path where we executed the // command. This is the case for command-line CVS but not // usually for GUI front-ends cvsCommand.setLocalPath( localPath ); cvsCommand.connect( root, password ); cvsCommand.addListener( listener ); if ( logger.isDebugEnabled() ) { logger.debug( "Executing CVS command: " + c.getCVSCommand() ); } boolean result = cvsCommand.executeCommand( c ); cvsCommand.disconnect(); return result; } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/org/apache/maven/scm/provider/cvslib/cvsjava/CvsJavaScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/src/main/java/o0000644000175000017500000000765411050561465033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsjava; /* * 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. */ import org.apache.maven.scm.command.Command; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider; import org.apache.maven.scm.provider.cvslib.cvsjava.command.add.CvsJavaAddCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.branch.CvsJavaBranchCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.changelog.CvsJavaChangeLogCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.checkin.CvsJavaCheckInCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.checkout.CvsJavaCheckOutCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.diff.CvsJavaDiffCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.export.CvsJavaExportCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.list.CvsJavaListCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.login.CvsJavaLoginCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.remove.CvsJavaRemoveCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.status.CvsJavaStatusCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.tag.CvsJavaTagCommand; import org.apache.maven.scm.provider.cvslib.cvsjava.command.update.CvsJavaUpdateCommand; /** * @author Emmanuel Venisse * @version $Id: CvsJavaScmProvider.java 685548 2008-08-13 13:35:49Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="cvs" */ public class CvsJavaScmProvider extends AbstractCvsScmProvider { /** {@inheritDoc} */ protected Command getAddCommand() { return new CvsJavaAddCommand(); } /** {@inheritDoc} */ protected Command getBranchCommand() { return new CvsJavaBranchCommand(); } /** {@inheritDoc} */ protected Command getChangeLogCommand() { return new CvsJavaChangeLogCommand(); } /** {@inheritDoc} */ protected Command getCheckInCommand() { return new CvsJavaCheckInCommand(); } /** {@inheritDoc} */ protected Command getCheckOutCommand() { return new CvsJavaCheckOutCommand(); } /** {@inheritDoc} */ protected Command getDiffCommand() { return new CvsJavaDiffCommand(); } /** {@inheritDoc} */ protected Command getExportCommand() { return new CvsJavaExportCommand(); } /** {@inheritDoc} */ protected Command getListCommand() { return new CvsJavaListCommand(); } /** {@inheritDoc} */ protected Command getLoginCommand() { return new CvsJavaLoginCommand(); } /** {@inheritDoc} */ protected Command getRemoveCommand() { return new CvsJavaRemoveCommand(); } /** {@inheritDoc} */ protected Command getStatusCommand() { return new CvsJavaStatusCommand(); } /** {@inheritDoc} */ protected Command getTagCommand() { return new CvsJavaTagCommand(); } /** {@inheritDoc} */ protected Command getUpdateCommand() { return new CvsJavaUpdateCommand(); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsjava/pom.xml0000644000175000017500000000470111322611461032261 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-cvs 1.3 maven-scm-provider-cvsjava Maven SCM CVS Provider - CVS Java Impl. Java implementation for SCM CVS Provider. org.apache.maven.scm maven-scm-provider-cvs-commons org.netbeans.lib cvsclient 20060125 ch.ethz.ganymed ganymed-ssh2 build210 org.apache.maven.scm maven-scm-provider-cvstest 1.3 test org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/0000755000175000017500000000000011345536665031572 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/0000755000175000017500000000000011345536665032361 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/site/0000755000175000017500000000000011345536665033325 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/site/si0000644000175000017500000000212211051127665033646 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/0000755000175000017500000000000011345536665033340 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Rootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000010510401301162033633 0ustar twernertwerner:ext:evenisse@cvs.surefire.codehaus.org:/home/projects/surefire/scm ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Entries.Extramaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000024710401301162033642 0ustar twernertwernerD/surefire/// D/surefire-beanshell/// D/surefire-booter/// D/surefire-jython/// D/surefire-web/// D/surefire-xmlrpc/// D/xdocs/// /project.xml/// /pom.xml/// ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Templatemaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000000010401301162033625 0ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Repositorymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000001210401301162033630 0ustar twernertwernersurefire ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Entries.Extra.Oldmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000026010401301162033635 0ustar twernertwernerD/surefire//// D/surefire-beanshell//// D/surefire-booter//// D/surefire-jython//// D/surefire-web//// D/surefire-xmlrpc//// D/xdocs//// /project.xml//// /pom.xml//// ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Entriesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000005210401301162033634 0ustar twernertwerner/pom.xml/1.10/Sat Jul 2 13:13:10 2005// ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/CVS/Entries.Oldmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000034610401301162033642 0ustar twernertwernerD/surefire//// D/surefire-beanshell//// D/surefire-booter//// D/surefire-jython//// D/surefire-web//// D/surefire-xmlrpc//// D/xdocs//// /project.xml/1.2/Fri Oct 8 21:29:26 2004// /pom.xml/1.6/Wed Mar 23 20:50:26 2005// ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/checkoutdir/pom.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000725010535556312033664 0ustar twernertwerner 4.0.0 surefire surefire-root pom SureFire Parent 1.1-SNAPSHOT Surefire is a test framework project. http://surefire.codehaus.org/ jira http://jira.codehaus.org/browse/SUREFIRE continuum email
dev@surefire.codehaus.org
2004 Surefire User List user-subscribe@surefire.codehaus.org user-unsubscribe@surefire.codehaus.org http://archive.surefire.codehaus.org/user/ Surefire Developer List dev-subscribe@surefire.codehaus.org dev-unsubscribe@surefire.codehaus.org http://archive.surefire.codehaus.org/dev/ jvanzyl Jason van Zyl jason@zenplex.com Zenplex Developer evenisse Emmanuel Venisse evenisse@codehaus.org Codehaus Developer scm:cvs:pserver:anoncvs@cvs.surefire.codehaus.org:/scm/surefire:surefire scm:cvs:ext:${maven.username}@cvs.surefire.codehaus.org:/scm/surefire:surefire http://cvs.surefire.codehaus.org/surefire/ Codehaus http://www.codehaus.org/ repo1 Maven Central Repository scp://repo1.maven.org/home/projects/maven/repository-staging/to-ibiblio/maven2 surefire Surefire Site at Codehaus scp://beaver.codehaus.org//home/projects/surefire/public_html surefire surefire-booter src/main src/test
././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/META-INF/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/META-INF/plexus/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/META-INF/plexus/components.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000214410535556312033661 0ustar twernertwerner org.apache.maven.scm.provider.ScmProvider cvs org.apache.maven.scm.provider.cvslib.repository.TestCvsScmProvider ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/cvslib/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000755000175000017500000000000011345536665033667 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/resources/cvslib/changelog/cvslog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/re0000644000175000017500000000277410401301162033651 0ustar twernertwerner RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cvslib/ChangeLogEntry.java,v Working file: ChangeLogEntry.java head: 1.9 branch: locks: strict access list: symbolic names: MAVEN_1_0_B3: 1.8 keyword substitution: kv total revisions: 9; selected revisions: 1 description: ============================================================================= RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cvslib/ChangeLogFile.java,v Working file: ChangeLogFile.java head: 1.7 branch: locks: strict access list: symbolic names: MAVEN_1_0_B3: 1.5 keyword substitution: kv total revisions: 7; selected revisions: 2 description: ---------------------------- revision 1.7 date: 2002/04/14 22:16:13; author: dion; state: Exp; lines: +1 -10 Removed getPreviousRev method ---------------------------- revision 1.6 date: 2002/04/14 15:04:51; author: dion; state: Exp; lines: +20 -1 - added to String for debugging ============================================================================= RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/cvslib/ChangeLogParser.java,v Working file: ChangeLogParser.java head: 1.11 branch: locks: strict access list: symbolic names: MAVEN_1_0_B3: 1.9 keyword substitution: kv total revisions: 11; selected revisions: 2 description: ---------------------------- revision 1.11 date: 2002/04/15 02:14:37; author: dion; state: Exp; lines: +2 -2 Fixed javadoc comment ============================================================================= ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000644000175000017500000000550411015073323033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.Collection; import java.util.Iterator; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsChangeLogConsumerTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class CvsChangeLogConsumerTest extends AbstractCvsScmTest { /** * file with test results to check against */ private File testFile; /** * Initialize per test data * * @throws Exception when there is an unexpected problem */ public void setUp() throws Exception { super.setUp(); testFile = getTestFile( "/src/test/resources/cvslib/changelog/cvslog.txt" ); } /** * Test of parse method * * @throws Exception when there is an unexpected problem */ public void testParse() throws Exception { CvsChangeLogConsumer command = new CvsChangeLogConsumer( new DefaultLog(), null ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { command.consumeLine( s ); s = in.readLine(); } Collection entries = command.getModifications(); assertEquals( "Wrong number of entries returned", 3, entries.size() ); ChangeSet entry = null; for ( Iterator i = entries.iterator(); i.hasNext(); ) { entry = (ChangeSet) i.next(); assertTrue( "ChangeLogEntry erroneously picked up", entry.toString().indexOf( "ChangeLogEntry.java" ) == -1 ); } } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/CvsScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000644000175000017500000000545510535556312033655 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.provider.cvslib.repository.TestCvsScmProvider; /** * @author Richard van der Hoff * @version $Id: CvsScmProviderTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsScmProviderTest extends TestCase { ScmProvider cvsProvider; public void setUp() { cvsProvider = new TestCvsScmProvider(); } public void testGetScmSpecificFilename() { assertEquals( "CVS", cvsProvider.getScmSpecificFilename() ); } /** * Tests for validateTagName() and sanitizeTagName() */ public void testTagValidation() { /* check the two corner-cases fail */ testTag( "HEAD", false ); testTag( "BASE", false ); /* check things which start with non-alphanumerics */ testTag( "-abcd", false ); testTag( "1234abcd", false ); testTag( "", false ); /* check a selection of correctable tags */ testCorrectableTag( "abc-1.0.2", "abc-1_0_2" ); testCorrectableTag( "abc\0def ghi\u00ff", "abc_def_ghi_" ); /* check a selection of valid tags */ testTag( "ABCD", true ); testTag( "a", true ); testTag( "abc-1_0_2", true ); } /** * test a tag verifies correctly * * @param tag tag to check * @param valid true if this tag should be valid */ protected void testTag( String tag, boolean valid ) { assertEquals( "Check tag '" + tag + "'", valid, cvsProvider.validateTagName( tag ) ); } /** * test a tag which is invalid but can be corrected * * @param badtag tag to test * @param goodtag what tag should be corrected to */ protected void testCorrectableTag( String badtag, String goodtag ) { testTag( badtag, false ); assertEquals( goodtag, cvsProvider.sanitizeTagName( badtag ) ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000755000175000017500000000000011345536665033653 5ustar twernertwerner././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/TestCvsScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000644000175000017500000000420010606723477033647 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.repository; /* * 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. */ import org.apache.maven.scm.command.Command; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider; /** * @author Emmanuel Venisse * @version $Id: TestCvsScmProvider.java 527150 2007-04-10 15:03:27Z evenisse $ */ public class TestCvsScmProvider extends AbstractCvsScmProvider { protected Command getAddCommand() { return null; } protected Command getBranchCommand() { return null; } protected Command getChangeLogCommand() { return null; } protected Command getCheckInCommand() { return null; } protected Command getCheckOutCommand() { return null; } protected Command getDiffCommand() { return null; } protected Command getExportCommand() { return null; } protected Command getListCommand() { return null; } protected Command getLoginCommand() { return null; } protected Command getRemoveCommand() { return null; } protected Command getStatusCommand() { return null; } protected Command getTagCommand() { return null; } protected Command getUpdateCommand() { return null; } } ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/test/ja0000644000175000017500000002572111057624045033652 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.repository; /* * 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. */ import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsScmProviderRepositoryTest.java 691838 2008-09-04 00:13:25Z vsiveton $ */ public class CvsScmProviderRepositoryTest extends AbstractCvsScmTest { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testParseConnectionFromPath() throws Exception { TestCvsScmProvider provider = new TestCvsScmProvider(); CvsScmProviderRepository repo = (CvsScmProviderRepository) provider .makeProviderScmRepository( getTestFile( "src/test/resources/checkoutdir" ) ); assertEquals( "ext", repo.getTransport() ); assertEquals( "evenisse", repo.getUser() ); assertEquals( "cvs.surefire.codehaus.org", repo.getHost() ); assertEquals( "/home/projects/surefire/scm", repo.getPath() ); assertEquals( "surefire", repo.getModule() ); } public void testParseRemotePserverConnection() throws Exception { String url = "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithUsernameDefinedInScmRepository() throws Exception { String url = "pserver:cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":cvs", "@cvs" ) ); repo.setUser( "myusername" ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "myusername", repo.getUser() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":pserver:myusername@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:myusername@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithoutUsername() throws Exception { String url = "pserver:cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":cvs", "@cvs" ) ); try { repo.getCvsRoot(); fail( "username isn't defined." ); } catch ( Exception e ) { } } public void testParseRemotePserverConnection2() throws Exception { String url = "pserver:anoncvs:@cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":@", "@" ) ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithPort() throws Exception { String url = "pserver:anoncvs:@cvs.apache.org:2401:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":2401", "" ).replaceFirst( ":@", "@" ) ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "", repo.getPassword() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( 2401, repo.getPort() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithPassword() throws Exception { String url = "pserver:anoncvs:mypassword@cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":mypassword", "" ) ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "mypassword", repo.getPassword() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithPortAndPassword() throws Exception { String url = "pserver:anoncvs:mypassword@cvs.apache.org:2402:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url.replaceFirst( ":mypassword", "" ).replaceFirst( ":2402:", ":2402" ) ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "mypassword", repo.getPassword() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( 2402, repo.getPort() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2402/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2402/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testParseRemotePserverConnectionWithBarsAsDelimiter() throws Exception { String url = "pserver|anoncvs@cvs.apache.org|/home/cvspublic|maven"; String urlResult = "pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, urlResult, '|' ); assertEquals( "pserver", repo.getTransport() ); assertEquals( "anoncvs", repo.getUser() ); assertEquals( "cvs.apache.org", repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:/home/cvspublic", repo.getCvsRoot() ); assertEquals( ":pserver:anoncvs@cvs.apache.org:2401/home/cvspublic", repo.getCvsRootForCvsPass() ); } public void testIllegalRepository() throws Exception { testIllegalUrl( "pserver:cvs.apache.org:/home/cvspublic:maven" ); } public void testParseLocalConnection() throws Exception { String url = "local:/home/cvspublic:maven"; CvsScmProviderRepository repo = testUrl( url, url ); assertEquals( "local", repo.getTransport() ); assertNull( repo.getUser() ); assertNull( repo.getHost() ); assertEquals( "/home/cvspublic", repo.getPath() ); assertEquals( ":local:/home/cvspublic", repo.getCvsRoot() ); } /** * Test SCM-387 * * @throws Exception */ public void testGetCvsRootForCvsPass() throws Exception { String url = "scm:cvs|local|c:/cvsroot|test"; ScmRepository repository = scmManager.makeScmRepository( url ); CvsScmProviderRepository repo = (CvsScmProviderRepository) repository.getProviderRepository(); assertEquals( ":local:c:/cvsroot", repo.getCvsRootForCvsPass() ); } /** * Test SCM-376 * * @throws Exception */ public void testSCM376() throws Exception { String url = "scm:cvs:pserver:continuum@gnllx002.ebit.be:2401:/data01/cvsroot_bkh:VCG_BKH/uBaseBkh"; ScmRepository repository = scmManager.makeScmRepository( url ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * @param expectedUrl url that should be printed in the toString method */ private CvsScmProviderRepository testUrl( String url, String expectedUrl, char delimiter, int nbErrorMessages ) throws Exception { assertEquals( nbErrorMessages, scmManager.validateScmRepository( "scm:cvs" + delimiter + url ).size() ); ScmRepository repository = scmManager.makeScmRepository( "scm:cvs" + delimiter + url ); assertNotNull( "ScmManager.makeScmRepository() returned null", repository ); assertNotNull( "The provider repository was null.", repository.getProviderRepository() ); assertTrue( "The SCM Repository isn't a " + CvsScmProviderRepository.class.getName() + ".", repository .getProviderRepository() instanceof CvsScmProviderRepository ); assertEquals( "cvs:" + expectedUrl, repository.toString() ); return (CvsScmProviderRepository) repository.getProviderRepository(); } private CvsScmProviderRepository testUrl( String url, String urlResult ) throws Exception { return testUrl( url, urlResult, ':', 0 ); } private CvsScmProviderRepository testUrl( String url, String urlResult, char delimiter ) throws Exception { return testUrl( url, urlResult, delimiter, 0 ); } private void testIllegalUrl( String url ) throws Exception { try { testUrl( "scm:cvs:" + url, null, ':', 1 ); fail( "Expected a ScmRepositoryException while testing the url '" + url + "'." ); } catch ( ScmRepositoryException e ) { // expected } } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/0000755000175000017500000000000011345536665033305 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/mdo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/md0000755000175000017500000000000011345536665033626 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/mdo/cvs-settings.mdomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/md0000644000175000017500000000766611315117331033625 0ustar twernertwerner cvs Cvs CVS Provider Model. package org.apache.maven.scm.providers.cvslib.settings Settings 1.0.0+ changeLogCommandDateFormat 1.0.0+ String yyyy-MM-dd HH:mm:ssZ useCvsrc 1.0.0+ boolean false compressionLevel 1.0.0+ int 3 traceCvsCommand 1.0.0+ boolean false temporaryFilesDirectory 1.0.0+ String cvsVariables 1.0.0+ Properties String * useForceTag 1.0.0+ boolean true ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsPass.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000001536711057621704033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.login; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; /** * Adds an new entry to a CVS password file. * * @version $Id: CvsPass.java 691832 2008-09-03 23:54:44Z vsiveton $ * @todo Update this class for support password storage in cvsnt. CVSNT use the windows registry, so, we need a jni * tool for access to the windows registry */ public class CvsPass { /** * CVS Root */ private String cvsRoot = null; /** * Password file to add password to */ private File passFile = null; /** * Password to add to file */ private String password = null; private ScmLogger logger; /** * Array contain char conversion data */ private final char[] shifts = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 114, 120, 53, 79, 96, 109, 72, 108, 70, 64, 76, 67, 116, 74, 68, 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65, 112, 86, 118, 110, 122, 105, 41, 57, 83, 43, 46, 102, 40, 89, 38, 103, 45, 50, 42, 123, 91, 35, 125, 55, 54, 66, 124, 126, 59, 47, 92, 71, 115, 78, 88, 107, 106, 56, 36, 121, 117, 104, 101, 100, 69, 73, 99, 63, 94, 93, 39, 37, 61, 48, 58, 113, 32, 90, 44, 98, 60, 51, 33, 97, 62, 77, 84, 80, 85, 223, 225, 216, 187, 166, 229, 189, 222, 188, 141, 249, 148, 200, 184, 136, 248, 190, 199, 170, 181, 204, 138, 232, 218, 183, 255, 234, 220, 247, 213, 203, 226, 193, 174, 172, 228, 252, 217, 201, 131, 230, 197, 211, 145, 238, 161, 179, 160, 212, 207, 221, 254, 173, 202, 146, 224, 151, 140, 196, 205, 130, 135, 133, 143, 246, 192, 159, 244, 239, 185, 168, 215, 144, 139, 165, 180, 157, 147, 186, 214, 176, 227, 231, 219, 169, 175, 156, 206, 198, 129, 164, 150, 210, 154, 177, 134, 127, 182, 128, 158, 208, 162, 132, 167, 209, 149, 241, 153, 251, 237, 236, 171, 195, 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152}; /** * Create a CVS task using the default cvspass file location. */ public CvsPass( ScmLogger logger ) { passFile = new File( System.getProperty( "cygwin.user.home", System.getProperty( "user.home" ) ) + File .separatorChar + ".cvspass" ); this.logger = logger; } /** * Does the work. * * @throws ScmException if something is missing * @throws IOException if something goes wrong */ public final void execute() throws ScmException, IOException { if ( cvsRoot == null ) { throw new ScmException( "cvsroot is required" ); } if ( logger.isDebugEnabled() ) { logger.debug( "cvsRoot: " + cvsRoot ); logger.debug( "passFile: " + passFile ); } BufferedReader reader = null; PrintWriter writer = null; try { StringBuffer buf = new StringBuffer(); if ( passFile.exists() ) { reader = new BufferedReader( new FileReader( passFile ) ); String line = null; while ( ( line = reader.readLine() ) != null ) { if ( !line.startsWith( cvsRoot ) && !line.startsWith( "/1 " + cvsRoot ) ) { buf.append( line ).append( "\n" ); } else { if ( logger.isDebugEnabled() ) { logger.debug( "cvsroot " + cvsRoot + " already exist in " + passFile.getAbsolutePath() + ". SKIPPED." ); } return; } } } else { passFile.getParentFile().mkdirs(); } if ( password == null ) { throw new ScmException( "password is required. You must run a 'cvs -d " + cvsRoot + " login' first or provide it in the connection url." ); } //logger.debug( "password: " + password ); String pwdfile = buf.toString() + "/1 " + cvsRoot + " A" + mangle( password ); if ( logger.isDebugEnabled() ) { logger.debug( "Writing -> " + pwdfile + " in " + passFile.getAbsolutePath() ); } writer = new PrintWriter( new FileWriter( passFile ) ); writer.println( pwdfile ); } finally { if ( reader != null ) { try { reader.close(); } catch ( IOException e ) { // ignore } } if ( writer != null ) { writer.close(); } } } private String mangle( String password ) { StringBuffer buf = new StringBuffer(); for ( int i = 0; i < password.length(); i++ ) { buf.append( shifts[password.charAt( i )] ); } return buf.toString(); } /** * The CVS repository to add an entry for. * * @param cvsRoot the CVS repository */ public void setCvsroot( String cvsRoot ) { this.cvsRoot = cvsRoot; } /** * Password file to add the entry to. * * @param passFile the password file. */ public void setPassfile( File passFile ) { this.passFile = passFile; } /** * Password to be added to the password file. * * @param password the password. */ public void setPassword( String password ) { this.password = password; } } ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000551011050561465033610 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.login; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.login.AbstractLoginCommand; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import java.io.IOException; /** * @author Emmanuel Venisse * @version $Id: CvsLoginCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsLoginCommand extends AbstractLoginCommand { /** {@inheritDoc} */ public LoginScmResult executeLoginCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { CvsScmProviderRepository repo = (CvsScmProviderRepository) repository; if ( !"pserver".equals( repo.getTransport() ) ) { return new LoginScmResult( null, "The cvs login ignored for " + repo.getTransport() + ".", "", true ); } else if ( isCvsNT() ) { //We don't continue becauseCVSNT doesn't use .cvspass return new LoginScmResult( null, "The cvs login ignored for CVSNT.", "", true ); } CvsPass passGenerator = new CvsPass( getLogger() ); passGenerator.setCvsroot( repo.getCvsRootForCvsPass() ); passGenerator.setPassword( repo.getPassword() ); try { passGenerator.execute(); } catch ( IOException e ) { throw new ScmException( "Error while executing cvs login command.", e ); } return new LoginScmResult( null, "The cvs command succeed.", "", true ); } public boolean isCvsNT() throws ScmException { return CvsCommandUtils.isCvsNT(); } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommandUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000001216211057005130033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.apache.maven.scm.provider.cvslib.util.CvsUtil; import org.apache.maven.scm.providers.cvslib.settings.Settings; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Enumeration; /** * @author Emmanuel Venisse * @version $Id: CvsCommandUtils.java 690997 2008-09-01 15:29:28Z vsiveton $ */ public class CvsCommandUtils { private CvsCommandUtils() { } public static boolean isCvsNT() throws ScmException { Commandline cl = new Commandline(); cl.setExecutable( "cvs" ); cl.createArg().setValue( "-v" ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); try { CommandLineUtils.executeCommandLine( cl, stdout, stderr ); } catch ( CommandLineException e ) { throw new ScmException( "Error while executing command.", e ); } return stdout.getOutput().indexOf( "CVSNT" ) >= 0; } public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository repo, ScmFileSet fileSet ) { return getBaseCommand( commandName, repo, fileSet, null, true ); } public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository repo, ScmFileSet fileSet, boolean addCvsRoot ) { return getBaseCommand( commandName, repo, fileSet, null, addCvsRoot ); } public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository repo, ScmFileSet fileSet, String options ) { return getBaseCommand( commandName, repo, fileSet, options, true ); } public static Commandline getBaseCommand( String commandName, CvsScmProviderRepository repo, ScmFileSet fileSet, String options, boolean addCvsRoot ) { Settings settings = CvsUtil.getSettings(); Commandline cl = new Commandline(); cl.setExecutable( "cvs" ); cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); if ( Boolean.getBoolean( "maven.scm.cvs.use_compression" ) ) { cl.createArg().setValue( "-z" + System.getProperty( "maven.scm.cvs.compression_level", "3" ) ); } else if ( settings.getCompressionLevel() > 0 ) { cl.createArg().setValue( "-z" + settings.getCompressionLevel() ); } if ( !settings.isUseCvsrc() ) { cl.createArg().setValue( "-f" ); // don't use ~/.cvsrc } if ( settings.isTraceCvsCommand() ) { cl.createArg().setValue( "-t" ); } if ( !StringUtils.isEmpty( settings.getTemporaryFilesDirectory() ) ) { File tempDir = new File( settings.getTemporaryFilesDirectory() ); if ( !tempDir.exists() ) { tempDir.mkdirs(); } cl.createArg().setValue( "-T" ); cl.createArg().setValue( tempDir.getAbsolutePath() ); } if ( settings.getCvsVariables().size() > 0 ) { for ( Enumeration e = settings.getCvsVariables().propertyNames(); e.hasMoreElements(); ) { String key = (String) e.nextElement(); String value = settings.getCvsVariables().getProperty( key ); cl.createArg().setValue( "-s" ); cl.createArg().setValue( key + "=" + value ); } } if ( addCvsRoot ) { cl.createArg().setValue( "-d" ); cl.createArg().setValue( repo.getCvsRoot() ); } cl.createArg().setLine( options ); cl.createArg().setValue( "-q" ); cl.createArg().setValue( commandName ); return cl; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/branch/CvsBranchConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000241110606723477033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.branch; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.cvslib.command.tag.CvsTagConsumer; /** * @author Emmanuel Venisse * @version $Id: CvsBranchConsumer.java 527150 2007-04-10 15:03:27Z evenisse $ */ public class CvsBranchConsumer extends CvsTagConsumer { public CvsBranchConsumer( ScmLogger logger ) { super( logger ); } } ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/branch/AbstractCvsBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000514711057610744033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.branch; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.branch.AbstractBranchCommand; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: AbstractCvsBranchCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsBranchCommand extends AbstractBranchCommand implements CvsCommand { /** {@inheritDoc} */ protected ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet, String branchName, String message ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "tag", repository, fileSet, false ); cl.createArg().setValue( "-b" ); cl.createArg().setValue( "-F" ); cl.createArg().setValue( "-c" ); cl.createArg().setValue( branchName ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract BranchScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000623511057621704033615 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.update; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import org.codehaus.plexus.util.StringUtils; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: CvsUpdateConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsUpdateConsumer implements StreamConsumer { private ScmLogger logger; private List files = new ArrayList(); public CvsUpdateConsumer( ScmLogger logger ) { this.logger = logger; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.length() < 3 ) { if ( StringUtils.isNotEmpty( line ) ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unable to parse output from command: line length must be bigger than 3. (" + line + ")." ); } } return; } String status = line.substring( 0, 2 ); String file = line.substring( 2 ); if ( status.equals( "U " ) ) { files.add( new ScmFile( file, ScmFileStatus.UPDATED ) ); } else if ( status.equals( "P " ) ) { files.add( new ScmFile( file, ScmFileStatus.PATCHED ) ); } else if ( status.equals( "A " ) ) { files.add( new ScmFile( file, ScmFileStatus.ADDED ) ); } else if ( status.equals( "C " ) ) { files.add( new ScmFile( file, ScmFileStatus.CONFLICT ) ); } else if ( status.equals( "M " ) ) { files.add( new ScmFile( file, ScmFileStatus.MODIFIED ) ); } else if ( status.equals( "? " ) ) { files.add( new ScmFile( file, ScmFileStatus.UNKNOWN ) ); } else { if ( logger.isDebugEnabled() ) { logger.warn( "Unknown status: '" + status + "' for file '" + file + "'." ); } } } public List getUpdatedFiles() { return files; } } ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/AbstractCvsUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000611311161262615033606 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.update; /* * 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. */ import java.io.File; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsUpdateCommand.java 757034 2009-03-21 22:09:17Z olamy $ */ public abstract class AbstractCvsUpdateCommand extends AbstractUpdateCommand implements CvsCommand { /** {@inheritDoc} */ public UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "update", repository, fileSet, false ); cl.createArg().setValue( "-d" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" + version.getName() ); } List files = fileSet.getFileList(); if ( !files.isEmpty() ) { Iterator fileIterator = files.iterator(); while ( fileIterator.hasNext() ) { cl.createArg().setValue( ( (File) fileIterator.next() ).getPath() ); } } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract UpdateScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000547611057621704033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: CvsCheckOutConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsCheckOutConsumer implements StreamConsumer { private ScmLogger logger; private List files = new ArrayList(); public CvsCheckOutConsumer( ScmLogger logger ) { this.logger = logger; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.length() < 3 ) { if ( StringUtils.isNotEmpty( line ) ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unable to parse output from command: line length must be bigger than 3. (" + line + ")." ); } } return; } String status = line.substring( 0, 2 ); String file = line.substring( 2 ); file = file.substring( file.indexOf( '/' ) ); if ( status.equals( "U " ) ) { files.add( new ScmFile( file, ScmFileStatus.UPDATED ) ); } else if ( status.equals( "P " ) ) { files.add( new ScmFile( file, ScmFileStatus.PATCHED ) ); } else if ( status.equals( "C " ) ) { files.add( new ScmFile( file, ScmFileStatus.CONFLICT ) ); } else { if ( logger.isWarnEnabled() ) { logger.warn( "Unknown status: '" + status + "'." ); } } } public List getCheckedOutFiles() { return files; } } ././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/AbstractCvsCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000703411057610744033615 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.IOException; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsCheckOutCommand extends AbstractCheckOutCommand implements CvsCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { if ( fileSet.getBasedir().exists() ) { try { FileUtils.deleteDirectory( fileSet.getBasedir() ); } catch ( IOException e ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Can't delete " + fileSet.getBasedir().getAbsolutePath(), e ); } } } CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "checkout", repository, fileSet ); cl.setWorkingDirectory( fileSet.getBasedir().getParentFile().getAbsolutePath() ); if ( version != null && !StringUtils.isEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } cl.createArg().setValue( "-d" ); cl.createArg().setValue( fileSet.getBasedir().getName() ); cl.createArg().setValue( repository.getModule() ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract CheckOutScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/AbstractCvsStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000455611057610744033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: AbstractCvsStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsStatusCommand extends AbstractStatusCommand implements CvsCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "update", repository, fileSet, "-n" ); cl.createArg().setValue( "-d" ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract StatusScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000754411057621704033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: CvsStatusConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsStatusConsumer implements StreamConsumer { private ScmLogger logger; private File workingDirectory; private List changedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public CvsStatusConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.length() < 3 ) { if ( StringUtils.isNotEmpty( line ) ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unable to parse output from command: line length must be bigger than 3. (" + line + ")." ); } } return; } String statusString = line.substring( 0, 1 ); String file = line.substring( 2 ); ScmFileStatus status; if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else if ( statusString.equals( "M" ) ) { status = ScmFileStatus.MODIFIED; } else if ( statusString.equals( "D" ) ) { status = ScmFileStatus.DELETED; } else if ( statusString.equals( "C" ) ) { status = ScmFileStatus.CONFLICT; } else if ( statusString.equals( "?" ) ) { status = ScmFileStatus.UNKNOWN; } else if ( statusString.equals( "U" ) || statusString.equals( "P" ) ) { // skip remote changes return; } else { if ( logger.isInfoEnabled() ) { logger.info( "Unknown file status: '" + statusString + "'." ); } return; } // If the file isn't a file; don't add it. if ( !status.equals( ScmFileStatus.DELETED ) && !new File( workingDirectory, file ).isFile() ) { return; } changedFiles.add( new ScmFile( file, status ) ); } public List getChangedFiles() { return changedFiles; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/export/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/export/AbstractCvsExportCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000560611057610744033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.export; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.export.AbstractExportCommand; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: AbstractCvsExportCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsExportCommand extends AbstractExportCommand { /** {@inheritDoc} */ protected ExportScmResult executeExportCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "export", repository, fileSet ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" + version.getName() ); } else { cl.createArg().setValue( "-rHEAD" ); } if ( StringUtils.isNotEmpty( outputDirectory ) ) { cl.createArg().setValue( "-d" ); cl.createArg().setValue( outputDirectory ); } cl.createArg().setValue( repository.getModule() ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract ExportScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/AbstractCvsRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000611311057610744033612 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: AbstractCvsRemoveCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ * @todo separate the CVSlib stuff from the cvs command line so it is clear what needs to be updated eventually */ public abstract class AbstractCvsRemoveCommand extends AbstractRemoveCommand implements CvsCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "remove", repository, fileSet ); cl.createArg().setValue( "-f" ); cl.createArg().setValue( "-l" ); File[] files = fileSet.getFiles(); List removedFiles = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { String path = files[i].getPath().replace( '\\', '/' ); cl.createArg().setValue( path ); removedFiles.add( new ScmFile( path, ScmFileStatus.DELETED ) ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl, removedFiles ); } protected abstract RemoveScmResult executeCvsCommand( Commandline cl, List removedFiles ) throws ScmException; } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/CvsCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000213010535556312033605 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command; /* * 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. */ import org.apache.maven.scm.command.Command; /** * @author Trygve Laugstøl * @version $Id: CvsCommand.java 483105 2006-12-06 15:07:54Z evenisse $ */ public interface CvsCommand extends Command { } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000676111157300235033613 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.tag; /* * 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. */ import java.io.File; import java.util.Iterator; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.apache.maven.scm.provider.cvslib.util.CvsUtil; import org.apache.maven.scm.providers.cvslib.settings.Settings; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsTagCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public abstract class AbstractCvsTagCommand extends AbstractTagCommand implements CvsCommand { public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, String message ) throws ScmException { return executeTagCommand( repo, fileSet, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "tag", repository, fileSet, false ); Settings settings = CvsUtil.getSettings(); if ( settings.isUseForceTag() ) { cl.createArg().setValue( "-F" ); } cl.createArg().setValue( "-c" ); cl.createArg().setValue( tag ); if ( fileSet.getFileList() != null && !fileSet.getFileList().isEmpty() ) { for ( Iterator it = fileSet.getFileList().iterator(); it.hasNext(); ) { File fileName = (File) it.next(); cl.createArg().setValue( fileName.toString() ); } } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract TagScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000473511057621704033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import org.codehaus.plexus.util.StringUtils; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: CvsTagConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsTagConsumer implements StreamConsumer { private ScmLogger logger; private List files = new ArrayList(); public CvsTagConsumer( ScmLogger logger ) { this.logger = logger; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.length() < 3 ) { if ( StringUtils.isNotEmpty( line ) ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unable to parse output from command: line length must be bigger than 3. (" + line + ")." ); } } return; } String status = line.substring( 0, 2 ); String file = line.substring( 2 ); if ( status.equals( "T " ) ) { files.add( new ScmFile( file, ScmFileStatus.TAGGED ) ); } else { if ( logger.isWarnEnabled() ) { logger.warn( "Unknown status: '" + status + "'." ); } } } public List getTaggedFiles() { return files; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000027300000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/AbstractCvsCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000754411057610744033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsCheckInCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsCheckInCommand extends AbstractCheckInCommand implements CvsCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "commit", repository, fileSet, false ); if ( version != null && !StringUtils.isEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" + version.getName() ); } cl.createArg().setValue( "-R" ); cl.createArg().setValue( "-F" ); File messageFile; try { messageFile = File.createTempFile( "scm-commit-message", ".txt" ); FileUtils.fileWrite( messageFile.getAbsolutePath(), message ); } catch ( IOException ex ) { throw new ScmException( "Error while making a temporary commit message file." ); } cl.createArg().setValue( messageFile.getAbsolutePath() ); File[] files = fileSet.getFiles(); for ( int i = 0; i < files.length; i++ ) { cl.createArg().setValue( files[i].getPath().replace( '\\', '/' ) ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } CheckInScmResult result = executeCvsCommand( cl, repository, messageFile ); try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } return result; } protected abstract CheckInScmResult executeCvsCommand( Commandline cl, CvsScmProviderRepository repository, File messageFile ) throws ScmException; } ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000523211057621704033611 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: CvsCheckInConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsCheckInConsumer implements StreamConsumer { private List checkedInFiles = new ArrayList(); private String remotePath; private ScmLogger logger; public CvsCheckInConsumer( String remotePath, ScmLogger logger ) { this.remotePath = remotePath; this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { /* * The output from "cvs commit" contains lines like this: * * /path/rot/repo/test-repo/check-in/foo/bar,v <-- bar * * so this code assumes that it contains ",v <-- " * it's a committed file. */ if ( logger.isDebugEnabled() ) { logger.debug( line ); } int end = line.indexOf( ",v <-- " ); if ( end == -1 ) { return; } String fileName = line.substring( 0, end ); if ( !fileName.startsWith( remotePath ) ) { return; } fileName = fileName.substring( remotePath.length() ); checkedInFiles.add( new ScmFile( fileName, ScmFileStatus.CHECKED_IN ) ); } public List getCheckedInFiles() { return checkedInFiles; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/AbstractCvsListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000642011057610744033613 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.list; /* * 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. */ import java.io.File; import java.util.Iterator; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.list.AbstractListCommand; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Kenney Westerhof * @version $Id: AbstractCvsListCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsListCommand extends AbstractListCommand implements CvsCommand { /** {@inheritDoc} */ protected ListScmResult executeListCommand( ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "rls", repository, fileSet, "-n" ); if ( version != null && !StringUtils.isEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } cl.createArg().setValue( "-d" ); cl.createArg().setValue( "-e" ); // szakusov: to fix "Unknown file status" problem if ( recursive ) { cl.createArg().setValue( "-R" ); } for ( Iterator it = fileSet.getFileList().iterator(); it.hasNext(); ) { File target = (File) it.next(); String path = target.getPath(); if ( path.startsWith( "\\" ) ) { path = path.substring( 1 ); } cl.createArg().setValue( path ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract ListScmResult executeCvsCommand( Commandline cl ) throws ScmException; } ././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/list/CvsListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000514411057621704033613 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.list; /* * 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. */ import java.util.LinkedList; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; /** * Parses CVS/Entries format, for example, like * *
 * /checkoutlist/1.9/Wed Jan 26 19:08:06 2005/-kkv/
 * /commitinfo/1.10/Tue Jan 11 01:25:34 2005/-kkv/
 * /config/1.15/Sun Jan 23 02:15:57 2005/-kkv/
 * D/directory1////
 * D/directory2////
 * 
* * @author Sergey Zakusov: implemented to fix "Unknown file status" problem * @version $Id: CvsListConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class CvsListConsumer implements StreamConsumer { private ScmLogger logger; private List entries; /** * @param logger is a logger */ public CvsListConsumer( ScmLogger logger ) { this.logger = logger; this.entries = new LinkedList(); } /** {@inheritDoc} */ public void consumeLine( String i_line ) { if ( logger.isDebugEnabled() ) { logger.debug( i_line ); } String[] params = i_line.split( "/" ); if ( params.length < 2 ) { if ( StringUtils.isNotEmpty( i_line ) ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unable to parse it as CVS/Entries format: " + i_line + "." ); } } } else { entries.add( new ScmFile( params[1], ScmFileStatus.UNKNOWN ) ); } } /** * @return Parse result */ public List getEntries() { return entries; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000001373611057621704033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Brett Porter * @version $Id: CvsDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ * @todo share with SVN (3 extra lines can be ignored) */ public class CvsDiffConsumer implements StreamConsumer { // // Index: plugin.jelly // =================================================================== // RCS file: /home/cvs/maven-scm/maven-scm-providers/maven-scm-provider-cvs/ // src/main/resources/META-INF/plexus/components.xml,v // retrieving revision 1.2 // diff -u -r1.2 components.xml // --- plugin.jelly (revision 124799) // +++ plugin.jelly (working copy) // private static final String RCS_TOKEN = "RCS file: "; private static final String RETRIEVING_TOKEN = "retrieving revision "; private static final String DIFF_TOKEN = "diff "; private static final String INDEX_TOKEN = "Index: "; private static final String FILE_SEPARATOR_TOKEN = "==="; private static final String START_REVISION_TOKEN = "---"; private static final String END_REVISION_TOKEN = "+++"; private static final String ADDED_LINE_TOKEN = "+"; private static final String REMOVED_LINE_TOKEN = "-"; private static final String UNCHANGED_LINE_TOKEN = " "; private static final String CHANGE_SEPARATOR_TOKEN = "@@"; private static final String NO_NEWLINE_TOKEN = "\\ No newline at end of file"; private ScmLogger logger; private String currentFile; private StringBuffer currentDifference; private List changedFiles = new ArrayList(); private Map differences = new HashMap(); private StringBuffer patch = new StringBuffer(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public CvsDiffConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.startsWith( INDEX_TOKEN ) ) { // start a new file currentFile = line.substring( INDEX_TOKEN.length() ); changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) ); currentDifference = new StringBuffer(); differences.put( currentFile, currentDifference ); patch.append( line ).append( "\n" ); return; } if ( currentFile == null ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); return; } if ( line.startsWith( FILE_SEPARATOR_TOKEN ) ) { // skip patch.append( line ).append( "\n" ); } else if ( line.startsWith( START_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, start revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( END_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, end revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( RCS_TOKEN ) ) { // skip, though could parse to verify filename } else if ( line.startsWith( RETRIEVING_TOKEN ) ) { // skip, though could parse to verify version } else if ( line.startsWith( DIFF_TOKEN ) ) { // skip, though could parse to verify command } else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) || line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) || line.equals( NO_NEWLINE_TOKEN ) ) { // add to buffer currentDifference.append( line ).append( "\n" ); patch.append( line ).append( "\n" ); } else { if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); // skip to next file currentFile = null; currentDifference = null; } } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch.toString(); } } ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/AbstractCvsDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000617211057610744033617 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: AbstractCvsDiffCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsDiffCommand extends AbstractDiffCommand implements CvsCommand { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "diff", repository, fileSet ); cl.createArg().setValue( "-u" ); if ( isSupportNewFileParameter() ) { cl.createArg().setValue( "-N" ); } if ( startRevision != null && StringUtils.isNotEmpty( startRevision.getName() ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( startRevision.getName() ); } if ( endRevision != null && StringUtils.isNotEmpty( endRevision.getName() ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( endRevision.getName() ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl ); } protected abstract DiffScmResult executeCvsCommand( Commandline cl ) throws ScmException; protected boolean isSupportNewFileParameter() { return true; } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000002475511057610744033626 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsChangeLogConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class CvsChangeLogConsumer extends AbstractConsumer { private List entries = new ArrayList(); // state machine constants for reading cvs output /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting date */ private static final int GET_DATE = 2; /** * expecting comments */ private static final int GET_COMMENT = 3; /** * expecting revision */ private static final int GET_REVISION = 4; /** * Marks start of file data */ private static final String START_FILE = "Working file: "; /** * Marks end of file */ private static final String END_FILE = "===================================" + "=========================================="; /** * Marks start of revision */ private static final String START_REVISION = "----------------------------"; /** * Marks revision data */ private static final String REVISION_TAG = "revision "; /** * Marks date data */ private static final String DATE_TAG = "date: "; /** * current status of the parser */ private int status = GET_FILE; /** * the current log entry being processed by the parser */ private ChangeSet currentChange = null; /** * the current file being processed by the parser */ private ChangeFile currentFile = null; private String userDatePattern; public CvsChangeLogConsumer( ScmLogger logger, String userDatePattern ) { super( logger ); this.userDatePattern = userDatePattern; } public List getModifications() { Collections.sort( entries, new Comparator() { public int compare( Object entry1, Object entry2 ) { ChangeSet set1 = (ChangeSet) entry1; ChangeSet set2 = (ChangeSet) entry2; return set1.getDate().compareTo( set2.getDate() ); } } ); List fixedModifications = new ArrayList(); ChangeSet currentEntry = null; for ( Iterator entryIterator = entries.iterator(); entryIterator.hasNext(); ) { ChangeSet entry = (ChangeSet) entryIterator.next(); if ( currentEntry == null ) { currentEntry = entry; } else if ( areEqual( currentEntry, entry ) ) { currentEntry.addFile( (ChangeFile) entry.getFiles().get( 0 ) ); } else { fixedModifications.add( currentEntry ); currentEntry = entry; } } if ( currentEntry != null ) { fixedModifications.add( currentEntry ); } return fixedModifications; } private boolean areEqual( ChangeSet set1, ChangeSet set2 ) { if ( set1.getAuthor().equals( set2.getAuthor() ) && set1.getComment().equals( set2.getComment() ) && set1.getDate().equals( set2.getDate() ) ) { return true; } return false; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } try { switch ( getStatus() ) { case GET_FILE: processGetFile( line ); break; case GET_REVISION: processGetRevision( line ); break; case GET_DATE: processGetDate( line ); break; case GET_COMMENT: processGetComment( line ); break; default: throw new IllegalStateException( "Unknown state: " + status ); } } catch ( Throwable ex ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Exception in the cvs changelog consumer.", ex ); } } } /** * Add a change log entry to the list (if it's not already there) with the * given file. * * @param entry a {@link ChangeSet}to be added to the list if another * with the same key doesn't exist already. If the entry's author * is null, the entry wont be added * @param file a {@link ChangeFile}to be added to the entry */ private void addEntry( ChangeSet entry, ChangeFile file ) { // do not add if entry is not populated if ( entry.getAuthor() == null ) { return; } entry.addFile( file ); entries.add( entry ); } /** * Process the current input line in the Get File state. * * @param line a line of text from the cvs log output */ private void processGetFile( String line ) { if ( line.startsWith( START_FILE ) ) { setCurrentChange( new ChangeSet() ); setCurrentFile( new ChangeFile( line.substring( START_FILE.length(), line.length() ) ) ); setStatus( GET_REVISION ); } } /** * Process the current input line in the Get Revision state. * * @param line a line of text from the cvs log output */ private void processGetRevision( String line ) { if ( line.startsWith( REVISION_TAG ) ) { getCurrentFile().setRevision( line.substring( REVISION_TAG.length() ) ); setStatus( GET_DATE ); } else if ( line.startsWith( END_FILE ) ) { // If we encounter an end of file line, it means there // are no more revisions for the current file. // there could also be a file still being processed. setStatus( GET_FILE ); addEntry( getCurrentChange(), getCurrentFile() ); } } /** * Process the current input line in the Get Date state. * * @param line a line of text from the cvs log output */ private void processGetDate( String line ) { if ( line.startsWith( DATE_TAG ) ) { StringTokenizer tokenizer = new StringTokenizer( line, ";" ); // date: YYYY/mm/dd HH:mm:ss [Z]; author: name;... String datePart = tokenizer.nextToken().trim(); String dateTime = datePart.substring( "date: ".length() ); StringTokenizer dateTokenizer = new StringTokenizer( dateTime, " " ); if ( dateTokenizer.countTokens() == 2 ) { dateTime += " UTC"; } getCurrentChange().setDate( dateTime, userDatePattern ); String authorPart = tokenizer.nextToken().trim(); String author = authorPart.substring( "author: ".length() ); getCurrentChange().setAuthor( author ); setStatus( GET_COMMENT ); } } /** * Process the current input line in the Get Comment state. * * @param line a line of text from the cvs log output */ private void processGetComment( String line ) { if ( line.startsWith( START_REVISION ) ) { // add entry, and set state to get revision addEntry( getCurrentChange(), getCurrentFile() ); // new change log entry setCurrentChange( new ChangeSet() ); // same file name, but different rev setCurrentFile( new ChangeFile( getCurrentFile().getName() ) ); setStatus( GET_REVISION ); } else if ( line.startsWith( END_FILE ) ) { addEntry( getCurrentChange(), getCurrentFile() ); setStatus( GET_FILE ); } else { // keep gathering comments getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" ); } } /** * Getter for property currentFile. * * @return Value of property currentFile. */ private ChangeFile getCurrentFile() { return currentFile; } /** * Setter for property currentFile. * * @param currentFile New value of property currentFile. */ private void setCurrentFile( ChangeFile currentFile ) { this.currentFile = currentFile; } /** * Getter for property currentChange. * * @return Value of property currentChange. */ private ChangeSet getCurrentChange() { return currentChange; } /** * Setter for property currentChange. * * @param currentChange New value of property currentChange. */ private void setCurrentChange( ChangeSet currentChange ) { this.currentChange = currentChange; } /** * Getter for property status. * * @return Value of property status. */ private int getStatus() { return status; } /** * Setter for property status. * * @param status New value of property status. */ private void setStatus( int status ) { this.status = status; } } ././@LongLink0000000000000000000000000000027700000000000011573 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/AbstractCvsChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000001355311057610744033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.apache.maven.scm.provider.cvslib.util.CvsUtil; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; import java.text.SimpleDateFormat; import java.util.Date; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsChangeLogCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public abstract class AbstractCvsChangeLogCommand extends AbstractChangeLogCommand implements CvsCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, null, null, null, startVersion, endVersion, datePattern ); } /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, startDate, endDate, branch, null, null, datePattern ); } private ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "log", repository, fileSet ); if ( startDate != null ) { SimpleDateFormat outputDate = new SimpleDateFormat( getDateFormat() ); String dateRange; if ( endDate == null ) { dateRange = ">" + outputDate.format( startDate ); } else { dateRange = outputDate.format( startDate ) + "<" + outputDate.format( endDate ); } cl.createArg().setValue( "-d" ); addDateRangeParameter( cl, dateRange ); } if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) ) { cl.createArg().setValue( "-r" + branch.getName() ); } if ( startVersion != null || endVersion != null ) { StringBuffer sb = new StringBuffer(); sb.append( "-r" ); if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) ) { sb.append( startVersion.getName() ); } sb.append( "::" ); if ( endVersion != null && StringUtils.isNotEmpty( endVersion.getName() ) ) { sb.append( endVersion.getName() ); } cl.createArg().setValue( sb.toString() ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl, startDate, endDate, startVersion, endVersion, datePattern ); } protected abstract ChangeLogScmResult executeCvsCommand( Commandline cl, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException; protected String getDateFormat() { return CvsUtil.getSettings().getChangeLogCommandDateFormat(); } protected void addDateRangeParameter( Commandline cl, String dateRange ) { // There's a difference between UNIX-like OS and Windows // See http://jira.codehaus.org/browse/SCM-187 if ( Os.isFamily( "windows" ) ) { cl.createArg().setValue( "\"" + dateRange + "\"" ); } else { cl.createArg().setValue( dateRange ); } } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/AbstractCvsAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000644511057610744033622 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.command.CvsCommand; import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: AbstractCvsAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ * @todo separate the CVSlib stuff from the cvs command line so it is clear what needs to be updated eventually */ public abstract class AbstractCvsAddCommand extends AbstractAddCommand implements CvsCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; Commandline cl = CvsCommandUtils.getBaseCommand( "add", repository, fileSet ); if ( binary ) { cl.createArg().setValue( "-kb" ); } if ( message != null && message.length() > 0 ) { cl.createArg().setValue( "-m" ); cl.createArg().setValue( "\"" + message + "\"" ); } File[] files = fileSet.getFiles(); List addedFiles = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { String path = files[i].getPath().replace( '\\', '/' ); cl.createArg().setValue( path ); addedFiles.add( new ScmFile( path, ScmFileStatus.ADDED ) ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } return executeCvsCommand( cl, addedFiles ); } protected abstract AddScmResult executeCvsCommand( Commandline cl, List/**/ addedFiles ) throws ScmException; } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/util/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/util/CvsUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000000515211320726466033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.util; /* * 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. */ import org.apache.maven.scm.providers.cvslib.settings.Settings; import org.apache.maven.scm.providers.cvslib.settings.io.xpp3.CvsXpp3Reader; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; /** * @author Emmanuel Venisse * @version $Id: CvsUtil.java 896222 2010-01-05 21:20:54Z olamy $ */ public class CvsUtil { protected static final String CVS_SETTINGS_FILENAME = "cvs-settings.xml"; public static final File DEFAULT_SETTINGS_DIRECTORY = new File( System.getProperty( "user.home" ), ".scm" ); private static File settingsDirectory = DEFAULT_SETTINGS_DIRECTORY; private CvsUtil() { } public static Settings getSettings() { File scmUserDir = settingsDirectory; File settingsFile = new File( scmUserDir, CVS_SETTINGS_FILENAME ); if ( settingsFile.exists() ) { CvsXpp3Reader reader = new CvsXpp3Reader(); try { return reader.read( ReaderFactory.newXmlReader( settingsFile ) ); } catch ( FileNotFoundException e ) { // skip error } catch ( IOException e ) { // skip error } catch ( XmlPullParserException e ) { String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage(); System.err.println( message ); } } return new Settings(); } public static void setSettingsDirectory( File directory ) { settingsDirectory = directory; } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000006177611160257765033637 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsScmProvider.java 755730 2009-03-18 20:56:21Z olamy $ */ public abstract class AbstractCvsScmProvider extends AbstractScmProvider { /** ext transport method */ public static final String TRANSPORT_EXT = "ext"; /** local transport method */ public static final String TRANSPORT_LOCAL = "local"; /** lserver transport method */ public static final String TRANSPORT_LSERVER = "lserver"; /** pserver transport method */ public static final String TRANSPORT_PSERVER = "pserver"; /** sspi transport method */ public static final String TRANSPORT_SSPI = "sspi"; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * The current ScmUrlParserResult * * @since 1.1.1 */ public static class ScmUrlParserResult { private List messages; private ScmProviderRepository repository; public ScmUrlParserResult() { messages = new ArrayList(); } /** * @return the messages */ public List getMessages() { return messages; } /** * @param messages the messages to set */ public void setMessages( List messages ) { this.messages = messages; } /** * @return the repository */ public ScmProviderRepository getRepository() { return repository; } /** * @param repository the repository to set */ public void setRepository( ScmProviderRepository repository ) { this.repository = repository; } /** * Reset messages. */ public void resetMessages() { this.messages = new ArrayList(); } } // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public String getScmSpecificFilename() { return "CVS"; } /* From the Cederqvist: * * "Tag names must start with an uppercase or lowercase letter and can * contain uppercase and lowercase letters, digits, `-', and `_'. The * two tag names BASE and HEAD are reserved for use by CVS. It is expected * that future names which are special to CVS will be specially named, * for example by starting with `.', rather than being named analogously * to BASE and HEAD, to avoid conflicts with actual tag names." */ /** {@inheritDoc} */ public String sanitizeTagName( String arg0 ) { if ( validateTagName( arg0 ) ) { return arg0; } if ( arg0.equals( "HEAD" ) || arg0.equals( "BASE" ) || !arg0.matches( "[A-Za-z].*" ) ) /* we don't even bother to sanitize these, they're just silly */ { throw new RuntimeException( "Unable to sanitize tag " + arg0 + ": must begin with a letter" + "and not be HEAD or BASE" ); } /* swap all illegal characters for a _ */ return arg0.replaceAll( "[^A-Za-z0-9_-]", "_" ); } /** {@inheritDoc} */ public boolean validateTagName( String arg0 ) { return ( arg0.matches( "[A-Za-z][A-Za-z0-9_-]*" ) && !arg0.equals( "HEAD" ) && !arg0.equals( "BASE" ) ); } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.getMessages().size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.getMessages() ); } return result.getRepository(); } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null || !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File cvsDirectory = new File( path, "CVS" ); if ( !cvsDirectory.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a cvs checkout directory." ); } File cvsRootFile = new File( cvsDirectory, "Root" ); File moduleFile = new File( cvsDirectory, "Repository" ); String cvsRoot; String module; try { cvsRoot = FileUtils.fileRead( cvsRootFile ).trim().substring( 1 ); } catch ( IOException e ) { throw new ScmRepositoryException( "Can't read " + cvsRootFile.getAbsolutePath() ); } try { module = FileUtils.fileRead( moduleFile ).trim(); } catch ( IOException e ) { throw new ScmRepositoryException( "Can't read " + moduleFile.getAbsolutePath() ); } return makeProviderScmRepository( cvsRoot + ":" + module, ':' ); } /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); return result.getMessages(); } /** {@inheritDoc} */ public String getScmType() { return "cvs"; } /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (AddScmResult) executeCommand( getAddCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (BranchScmResult) executeCommand( getBranchCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ChangeLogScmResult) executeCommand( getChangeLogCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckInScmResult) executeCommand( getCheckInCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckOutScmResult) executeCommand( getCheckOutCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (DiffScmResult) executeCommand( getDiffCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ExportScmResult) executeCommand( getExportCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (LoginScmResult) executeCommand( getLoginCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (RemoveScmResult) executeCommand( getRemoveCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) executeCommand( getStatusCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (TagScmResult) executeCommand( getTagCommand(), repository, fileSet, parameters ); } protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters, ScmTagParameters scmParameters ) throws ScmException { return (TagScmResult) getTagCommand().execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet, parameters ); } /** {@inheritDoc} */ protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ListScmResult) executeCommand( getListCommand(), repository, fileSet, parameters ); } /** * @param basedir not null * @param f not null * @return the relative path * @throws ScmException if any * @throws IOException if any */ public static String getRelativePath( File basedir, File f ) throws ScmException, IOException { File fileOrDir = getAbsoluteFilePath( f ); if ( !fileOrDir.getPath().startsWith( basedir.getPath() ) ) { throw new ScmException( fileOrDir.getPath() + " was not contained in " + basedir.getPath() ); } return fileOrDir.getPath().substring( basedir.getPath().length() + 1, fileOrDir.getPath().length() ); } // ---------------------------------------------------------------------- // Protected methods // ---------------------------------------------------------------------- protected ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter ) { ScmUrlParserResult result = new ScmUrlParserResult(); String[] tokens = StringUtils.split( scmSpecificUrl, Character.toString( delimiter ) ); if ( tokens.length < 3 ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } String cvsroot; String transport = tokens[0]; if ( transport.equalsIgnoreCase( TRANSPORT_LOCAL ) ) { // use the local repository directory eg. '/home/cvspublic' cvsroot = tokens[1]; } else if ( transport.equalsIgnoreCase( TRANSPORT_PSERVER ) || transport.equalsIgnoreCase( TRANSPORT_LSERVER ) || transport.equalsIgnoreCase( TRANSPORT_EXT ) || transport.equalsIgnoreCase( TRANSPORT_SSPI ) ) { if ( tokens.length != 4 && transport.equalsIgnoreCase( TRANSPORT_EXT ) ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } else if ( ( tokens.length < 4 || tokens.length > 6 ) && transport.equalsIgnoreCase( TRANSPORT_PSERVER ) ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } else if ( tokens.length < 4 || tokens.length > 5 && !transport.equalsIgnoreCase( TRANSPORT_PSERVER ) ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } else if ( tokens.length < 4 || tokens.length > 5 && transport.equalsIgnoreCase( TRANSPORT_SSPI ) ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } if ( transport.equalsIgnoreCase( TRANSPORT_LSERVER ) ) { //create the cvsroot as the local socket cvsroot cvsroot = tokens[1] + ":" + tokens[2]; } else { //create the cvsroot as the remote cvsroot if ( tokens.length == 4 ) { cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2]; } else { cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2] + ":" + tokens[3]; } } } else { result.getMessages().add( "Unknown transport: " + transport ); return result; } String user = null; String password = null; String host = null; String path = null; String module = null; int port = -1; if ( transport.equalsIgnoreCase( TRANSPORT_PSERVER ) ) { // set default port, it's necessary for checking entries in .cvspass port = 2401; if ( tokens.length == 4 ) { //pserver:[username@]host:path:module String userhost = tokens[1]; int index = userhost.indexOf( "@" ); if ( index == -1 ) { host = userhost; } else { user = userhost.substring( 0, index ); host = userhost.substring( index + 1 ); } path = tokens[2]; module = tokens[3]; } else if ( tokens.length == 6 ) { //pserver:username:password@host:port:path:module user = tokens[1]; String passhost = tokens[2]; int index = passhost.indexOf( "@" ); if ( index == -1 ) { result.getMessages() .add( "The user_password_host part must be on the form: :@." ); return result; } password = passhost.substring( 0, index ); host = passhost.substring( index + 1 ); port = new Integer( tokens[3] ).intValue(); path = tokens[4]; module = tokens[5]; } else { //tokens.length == 5 if ( tokens[1].indexOf( "@" ) > 0 ) { //pserver:username@host:port:path:module String userhost = tokens[1]; int index = userhost.indexOf( "@" ); user = userhost.substring( 0, index ); host = userhost.substring( index + 1 ); port = new Integer( tokens[2] ).intValue(); } else if ( tokens[2].indexOf( "@" ) >= 0 ) { //pserver:username:password@host:path:module //:@ user = tokens[1]; String passhost = tokens[2]; int index = passhost.indexOf( "@" ); password = passhost.substring( 0, index ); host = passhost.substring( index + 1 ); } else { //pserver:host:port:path:module try { port = new Integer( tokens[2] ).intValue(); } catch ( Exception e ) { //incorrect result.getMessages().add( "Your scm url is invalid." ); return result; } host = tokens[1]; } path = tokens[3]; module = tokens[4]; } String userHost = host; if ( user != null ) { userHost = user + "@" + host; } // cvsroot format is :pserver:[user@]host:[port]path cvsroot = ":" + transport + ":" + userHost + ":"; if ( port != -1 ) { cvsroot += port; } cvsroot += path; } else if ( transport.equalsIgnoreCase( TRANSPORT_SSPI ) ) { //sspi:[username@]host:[port]path:module String userhost = tokens[1]; int index = userhost.indexOf( "@" ); if ( index == -1 ) { user = ""; host = userhost; } else { user = userhost.substring( 0, index ); host = userhost.substring( index + 1 ); } // no port specified if ( tokens.length == 4 ) { path = tokens[2]; module = tokens[3]; } else { // getting port try { port = new Integer( tokens[2] ).intValue(); path = tokens[3]; module = tokens[4]; } catch ( Exception e ) { //incorrect result.getMessages().add( "Your scm url is invalid, could not get port value." ); return result; } } // cvsroot format is :sspi:host:path cvsroot = ":" + transport + ":" + host + ":"; if ( port != -1 ) { cvsroot += port; } cvsroot += path; } else { if ( !transport.equalsIgnoreCase( TRANSPORT_LOCAL ) ) { String userhost = tokens[1]; int index = userhost.indexOf( "@" ); if ( index == -1 ) { host = userhost; } else { user = userhost.substring( 0, index ); host = userhost.substring( index + 1 ); } } if ( transport.equals( TRANSPORT_LOCAL ) ) { path = tokens[1]; module = tokens[2]; if ( module != null && module.startsWith( "/" ) ) { module = module.substring( 1 ); } } else { if ( tokens.length == 4 ) { path = tokens[2]; module = tokens[3]; } else { port = new Integer( tokens[2] ).intValue(); path = tokens[3]; module = tokens[4]; } } } if ( port == -1 ) { result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user, password, host, path, module ) ); } else { result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user, password, host, port, path, module ) ); } return result; } protected abstract Command getAddCommand(); protected abstract Command getBranchCommand(); protected abstract Command getChangeLogCommand(); protected abstract Command getCheckInCommand(); protected abstract Command getCheckOutCommand(); protected abstract Command getDiffCommand(); protected abstract Command getExportCommand(); protected abstract Command getListCommand(); protected abstract Command getLoginCommand(); protected abstract Command getRemoveCommand(); protected abstract Command getStatusCommand(); protected abstract Command getTagCommand(); protected abstract Command getUpdateCommand(); // ---------------------------------------------------------------------- // Private methods // ---------------------------------------------------------------------- private ScmResult executeCommand( Command command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet ); command.setLogger( getLogger() ); return command.execute( repository, fileSet, parameters ); } /** * CVS provider requires that all files in ScmFileSet must be relative to basedir * This function ensures and converts all absolute paths to relative paths * * @param currentFileSet * @return * @throws ScmException */ private static ScmFileSet fixUpScmFileSetAbsoluteFilePath( ScmFileSet currentFileSet ) throws ScmException { ScmFileSet newFileSet = null; try { File basedir = getAbsoluteFilePath( currentFileSet.getBasedir() ); File[] files = currentFileSet.getFiles(); for ( int i = 0; i < files.length; ++i ) { if ( files[i].isAbsolute() ) { files[i] = new File( getRelativePath( basedir, files[i] ) ); } } newFileSet = new ScmFileSet( basedir, Arrays.asList( files ) ); } catch ( IOException e ) { throw new ScmException( "Invalid file set.", e ); } return newFileSet; } private static File getAbsoluteFilePath( File fileOrDir ) throws IOException { String javaPathString = fileOrDir.getCanonicalPath().replace( '\\', '/' ); if ( javaPathString.endsWith( "/" ) ) { javaPathString = javaPathString.substring( 0, javaPathString.length() - 1 ); } return new File( javaPathString ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000755000175000017500000000000011345536665033620 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/ja0000644000175000017500000001221411052523014033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsScmProviderRepository.java 687016 2008-08-19 10:53:00Z vsiveton $ */ public class CvsScmProviderRepository extends ScmProviderRepositoryWithHost { /** */ private String cvsroot; /** */ private String transport; /** */ private String path; /** */ private String module; public CvsScmProviderRepository( String cvsroot, String transport, String user, String password, String host, String path, String module ) { this( cvsroot, transport, user, password, host, -1, path, module ); } public CvsScmProviderRepository( String cvsroot, String transport, String user, String password, String host, int port, String path, String module ) { this.cvsroot = cvsroot; this.transport = transport; if ( user == null && AbstractCvsScmProvider.TRANSPORT_EXT.equals( transport ) ) { user = System.getProperty( "user.name" ); } setUser( user ); setPassword( password ); setHost( host ); setPort( port ); this.path = path; this.module = module; } /** * @return The cvs root */ public String getCvsRoot() { String root = getCvsRootForCvsPass(); return removeDefaultPortFromCvsRoot( root ); } private String removeDefaultPortFromCvsRoot( String root ) { if ( root != null && root.indexOf( ":2401" ) > 0 ) { root = root.substring( 0, root.indexOf( ":2401" ) ) + ":" + root.substring( root.indexOf( ":2401" ) + 5 ); } return root; } /** * @return The cvs root stored in .cvspass */ public String getCvsRootForCvsPass() { String result; String transport = getTransport(); if ( AbstractCvsScmProvider.TRANSPORT_LOCAL.equals( transport ) ) { result = ":" + transport + ":" + cvsroot; } else if ( getUser() != null ) { result = getCvsRootWithCorrectUser( getUser() ); } else { throw new IllegalArgumentException( "Username isn't defined." ); } return result; } /** * @return The subtype (like pserver). */ public String getTransport() { return transport; } /** * @return The path. */ public String getPath() { return path; } /** * @return The module name. */ public String getModule() { return module; } private String getCvsRootWithCorrectUser() { return getCvsRootWithCorrectUser( null ); } /** * @param user user name * @return */ private String getCvsRootWithCorrectUser( String user ) { //:transport:rest_of_cvsroot int indexOfUsername = getTransport().length() + 2; int indexOfAt = cvsroot.indexOf( "@" ); String userString = user == null ? "" : ":" + user; if ( indexOfAt > 0 ) { cvsroot = ":" + getTransport() + userString + cvsroot.substring( indexOfAt ); } else { cvsroot = ":" + getTransport() + userString + "@" + cvsroot.substring( indexOfUsername ); } return cvsroot; } /** {@inheritDoc} */ public String toString() { StringBuffer sb = new StringBuffer(); if ( getUser() == null ) { if ( AbstractCvsScmProvider.TRANSPORT_LOCAL.equals( getTransport() ) ) { sb.append( getCvsRoot() ); } else { sb.append( removeDefaultPortFromCvsRoot( getCvsRootWithCorrectUser() ) ); } } else { sb.append( getCvsRoot() ); } sb.append( ":" ); sb.append( getModule() ); /* remove first colon */ if ( sb.charAt( 0 ) == ':' ) { sb.deleteCharAt( 0 ); } return sb.toString(); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/pom.xml0000644000175000017500000000430511322611461033070 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-cvs 1.3 maven-scm-provider-cvs-commons Maven SCM CVS Provider - Common library Common library for SCM CVS Provider. org.apache.maven.scm maven-scm-provider-cvstest test org.codehaus.modello modello-maven-plugin java xpp3-reader xsd 1.0.0 src/main/mdo/cvs-settings.mdo maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/src/0000755000175000017500000000000011345536665024401 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/src/site/0000755000175000017500000000000011345536665025345 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/src/site/site.xml0000644000175000017500000000215711051127665027026 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/0000755000175000017500000000000011345536666030624 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/0000755000175000017500000000000011345536666031413 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/site/0000755000175000017500000000000011345536666032357 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/site/site.xm0000644000175000017500000000212511051127665033656 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/0000755000175000017500000000000011345536666032372 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/0000755000175000017500000000000011345536666033313 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000226610606723477033661 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.branch; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.branch.CvsBranchCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeBranchCommandTckTest.java 527150 2007-04-10 15:03:27Z evenisse $ */ public class CvsExeBranchCommandTckTest extends CvsBranchCommandTckTest { } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/update/CvsExeUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000226610535556312033652 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.update; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeUpdateCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeUpdateCommandTckTest extends CvsUpdateCommandTckTest { } ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/update/CvsExeUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000225210535556312033645 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.update; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeUpdateCommandTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeUpdateCommandTest extends CvsUpdateCommandTest { } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027600000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkout/CvsExeCheckoutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000226610535556312033652 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckoutCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeCheckoutCommandTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeCheckoutCommandTest extends CvsCheckoutCommandTest { } ././@LongLink0000000000000000000000000000030100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkout/CvsExeCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000230210535556312033641 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckOutCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeCheckOutCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeCheckOutCommandTckTest extends CvsCheckOutCommandTckTest { } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027500000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/status/CvsExeStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000226610535556312033652 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.status; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.status.CvsStatusCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeStatusCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeStatusCommandTckTest extends CvsStatusCommandTckTest { } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/tag/CvsExeTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000224410535556312033646 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.tag; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.tag.CvsTagCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeTagCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeTagCommandTckTest extends CvsTagCommandTckTest { } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027700000000000011573 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkin/CvsExeCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000227410535556312033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.checkin.CvsCheckInCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeCheckInCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeCheckInCommandTckTest extends CvsCheckInCommandTckTest { } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/diff/CvsExeDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000225210535556312033645 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.diff; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.diff.CvsDiffCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeDiffCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeDiffCommandTckTest extends CvsDiffCommandTckTest { } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000755000175000017500000000000011345536666033654 5ustar twernertwerner././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/changelog/CvsExeChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000227410535556312033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.changelog; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.changelog.CvsChangeLogCommandTest; /** * @author Emmanuel Venisse * @version $Id: CvsExeChangeLogCommandTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class CvsExeChangeLogCommandTest extends CvsChangeLogCommandTest { } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/or0000644000175000017500000000320711057347502033645 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe; /* * 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. */ import java.util.List; import junit.framework.TestCase; /** * @author Vincent Siveton */ public class CvsExeScmProviderTest extends TestCase { public void testValidateScmUrl() throws Exception { CvsExeScmProvider provider = new CvsExeScmProvider(); List messages = provider.validateScmUrl( "pserver:cvsserver:/bigrepo:myproject", ':' ); assertTrue( messages.toString(), messages.isEmpty() ); messages = provider.validateScmUrl( "sserver:cvsserver:/bigrepo:myproject", ':' ); assertTrue( messages.toString(), messages.isEmpty() ); messages = provider.validateScmUrl( "sserver2:cvsserver:/bigrepo:myproject", ':' ); assertFalse( messages.toString(), messages.isEmpty() ); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/update/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000043310401301162033747 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/update/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000055510401301162033754 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2004.10.18.13.23.14; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @o Initial commit. @ text @/* $Log: Foo.java,v,v $ Revision 1.1.1.1 2004/10/20 18:03:42 trygvis o Reimport of a maven-scm. $Id: Foo.java,v,v 1.1.1.1 2004/10/20 18:03:42 trygvis Exp $ */ public class Foo { } @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000064021110401301162033753 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000046310401301162033752 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/checkout/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000040010401301162033741 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @public class Foo { } @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536666034000 5ustar twernertwerner././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/test-repo/changelog/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000064021110401301162033753 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000755000175000017500000000000011345536665033777 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000115510401301162033751 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000251610401301162033753 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000331410401301162033750 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. #UseNewInfoFmtStrings=yes ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000255210401301162033753 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/val-tagsmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000001510401301162033743 0ustar twernertwernerMAVEN_1_0 y ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000140110401301162033743 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000413010401301162033745 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000133610401301162033752 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000002310401301162033742 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000365510401301162033760 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. UseNewInfoFmtStrings=yes @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000311410401301162033746 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000151710401301162033753 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000335410401301162033754 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000447210401301162033756 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000215410401301162033751 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000174310401301162033754 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" @ ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000077410401301162033757 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000601210401301162033746 0ustar twernertwernerΚW&<îÿ(¹ï$Ÿ-ûRc“†Àîÿ(¹Ÿ-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹!Ù-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹éØ !îÿ(¹ÑØ$Ÿ D:\apache\maven\trunks\scm\maven-scm-providers\maven-scm-provider-cvs\src\test\repository/test-repo/checkout/src/java/org/apache/maven/.svn/wcprops/MavenUtils.java,v.svn-work© ! ! !¹× ÿ$ÿ-ûRc“†Àîÿ(¹ï © ! ! !ïש ! ! !¹Öö ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?›õ MAVE ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿMAVEN_1_0y././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000157010401301162033752 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000257310401301162033756 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000371610401301162033756 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000122610401301162033750 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/reposit0000644000175000017500000000223110401301162033745 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/test/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/test/java/Test.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000060610401301162033631 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/test/java/Test.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/main/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/src/main/java/Application.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000061510401301162033631 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/main/java/Application.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/pom.xml,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000056610401301162033636 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/pom.xml@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/test-repo/module/readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000057110401301162033632 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/readme.txt@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000755000175000017500000000000011345536666033660 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000113210401301162033624 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000170110401301162033626 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000173710401301162033637 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000200210401301162033621 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/editinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000231210401301162033625 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000106410401301162033630 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/editinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000200110401301162033620 0ustar twernertwerner# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000155710401301162033637 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000127010401301162033627 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000002310401301162033622 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000225010401301162033626 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always @ ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000231310401301162033626 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000144310401301162033631 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000216510401301162033633 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/historymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000000010401301162033615 0ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000207010401301162033626 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000137010401301162033630 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000137510401301162033635 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s @ ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000075710401301162033640 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000000010401301162033615 0ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/modules.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000600010401301162033623 0ustar twernertwernerΚW&<Íy—[Úêí*¼ d$ŸÍy—[Úêí*¼ î$ŸÍy—[Úêí*¼ ‰ñ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000152210401301162033627 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000251010401301162033625 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000247610401301162033640 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000121110401301162033622 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/tck-rep0000644000175000017500000000217710401301162033636 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/0000755000175000017500000000000011345536666032337 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/0000755000175000017500000000000011345536666033260 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/branch/CvsExeBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000450211050561465033610 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.branch; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.cvslib.command.branch.AbstractCvsBranchCommand; import org.apache.maven.scm.provider.cvslib.command.branch.CvsBranchConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeBranchCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeBranchCommand extends AbstractCvsBranchCommand { /** {@inheritDoc} */ protected BranchScmResult executeCvsCommand( Commandline cl ) throws ScmException { int exitCode; CvsBranchConsumer consumer = new CvsBranchConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new BranchScmResult( cl.toString(), "The cvs branch command failed.", stderr.getOutput(), false ); } return new BranchScmResult( cl.toString(), consumer.getTaggedFiles() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/update/CvsExeUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000524511050561465033615 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateCommand; import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateConsumer; import org.apache.maven.scm.provider.cvslib.cvsexe.command.changelog.CvsExeChangeLogCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeUpdateCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeUpdateCommand extends AbstractCvsUpdateCommand { /** {@inheritDoc} */ protected UpdateScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsUpdateConsumer consumer = new CvsUpdateConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new UpdateScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() ); } protected ChangeLogCommand getChangeLogCommand() { CvsExeChangeLogCommand command = new CvsExeChangeLogCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkout/CvsExeCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000453511050561465033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.cvslib.command.checkout.AbstractCvsCheckOutCommand; import org.apache.maven.scm.provider.cvslib.command.checkout.CvsCheckOutConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeCheckOutCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeCheckOutCommand extends AbstractCvsCheckOutCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsCheckOutConsumer consumer = new CvsCheckOutConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new CheckOutScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/status/CvsExeStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000452611050561465033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.cvslib.command.status.AbstractCvsStatusCommand; import org.apache.maven.scm.provider.cvslib.command.status.CvsStatusConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeStatusCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeStatusCommand extends AbstractCvsStatusCommand { /** {@inheritDoc} */ protected StatusScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsStatusConsumer consumer = new CvsStatusConsumer( getLogger(), cl.getWorkingDirectory() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/export/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/export/CvsExeExportCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000447311050561465033617 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.export; /* * 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. */ import org.apache.maven.scm.provider.cvslib.command.export.AbstractCvsExportCommand; import org.apache.maven.scm.provider.cvslib.command.update.CvsUpdateConsumer; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.ScmException; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineException; /** * @author Emmanuel Venisse * @version $Id: CvsExeExportCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeExportCommand extends AbstractCvsExportCommand { /** {@inheritDoc} */ protected ExportScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsUpdateConsumer consumer = new CvsUpdateConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new ExportScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new ExportScmResult( cl.toString(), consumer.getUpdatedFiles() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/remove/CvsExeRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000463211050561465033614 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.cvslib.command.remove.AbstractCvsRemoveCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: CvsExeRemoveCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeRemoveCommand extends AbstractCvsRemoveCommand { /** {@inheritDoc} */ protected RemoveScmResult executeCvsCommand( Commandline cl, List removedFiles ) throws ScmException { CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } // TODO: actually it may have partially succeeded - should we cvs update the files and parse "A " responses? if ( exitCode != 0 ) { return new RemoveScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new RemoveScmResult( cl.toString(), removedFiles ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/tag/CvsExeTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000450211050561465033610 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.cvslib.command.tag.AbstractCvsTagCommand; import org.apache.maven.scm.provider.cvslib.command.tag.CvsTagConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeTagCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeTagCommand extends AbstractCvsTagCommand { /** {@inheritDoc} */ protected TagScmResult executeCvsCommand( Commandline cl ) throws ScmException { int exitCode; CvsTagConsumer consumer = new CvsTagConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { // TODO: Improve this error message return new TagScmResult( cl.toString(), "The cvs tag command failed.", stderr.getOutput(), false ); } return new TagScmResult( cl.toString(), consumer.getTaggedFiles() ); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/checkin/CvsExeCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000542711050561465033617 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.cvslib.command.checkin.AbstractCvsCheckInCommand; import org.apache.maven.scm.provider.cvslib.command.checkin.CvsCheckInConsumer; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; /** * @author Emmanuel Venisse * @version $Id: CvsExeCheckInCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeCheckInCommand extends AbstractCvsCheckInCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCvsCommand( Commandline cl, CvsScmProviderRepository repository, File messageFile ) throws ScmException { CvsCheckInConsumer consumer = new CvsCheckInConsumer( repository.getPath(), getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } if ( exitCode != 0 ) { return new CheckInScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles() ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/list/CvsExeListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000447611050561465033622 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.cvslib.command.list.AbstractCvsListCommand; import org.apache.maven.scm.provider.cvslib.command.status.CvsStatusConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Kenney Westerhof * @version $Id: CvsExeListCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeListCommand extends AbstractCvsListCommand { /** {@inheritDoc} */ protected ListScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsStatusConsumer consumer = new CvsStatusConsumer( getLogger(), cl.getWorkingDirectory() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new ListScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new ListScmResult( cl.toString(), consumer.getChangedFiles() ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/diff/CvsExeDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000475311050561465033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.cvslib.command.diff.AbstractCvsDiffCommand; import org.apache.maven.scm.provider.cvslib.command.diff.CvsDiffConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: CvsExeDiffCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeDiffCommand extends AbstractCvsDiffCommand { /** {@inheritDoc} */ protected DiffScmResult executeCvsCommand( Commandline cl ) throws ScmException { CvsDiffConsumer consumer = new CvsDiffConsumer( getLogger(), cl.getWorkingDirectory() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } // TODO: a difference returns a code of "1", as does errors. How to tell the difference? // if ( exitCode != 0 ) // { // return new DiffScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); // } return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch() ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/changelog/CvsExeChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000551711050561465033617 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.cvslib.command.changelog.AbstractCvsChangeLogCommand; import org.apache.maven.scm.provider.cvslib.command.changelog.CvsChangeLogConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.util.Date; /** * @author Emmanuel Venisse * @version $Id: CvsExeChangeLogCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeChangeLogCommand extends AbstractCvsChangeLogCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeCvsCommand( Commandline cl, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { CvsChangeLogConsumer consumer = new CvsChangeLogConsumer( getLogger(), datePattern ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing cvs command.", ex ); } if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate ); changeLogSet.setStartVersion( startVersion ); changeLogSet.setEndVersion( endVersion ); return new ChangeLogScmResult( cl.toString(), changeLogSet ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000755000175000017500000000000011345536666033621 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/command/add/CvsExeAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000000456511050561465033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.cvslib.command.add.AbstractCvsAddCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: CvsExeAddCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsExeAddCommand extends AbstractCvsAddCommand { /** {@inheritDoc} */ protected AddScmResult executeCvsCommand( Commandline cl, List addedFiles ) throws ScmException { CommandLineUtils.StringStreamConsumer consumer = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } // TODO: actually it may have partially succeeded - should we cvs update the files and parse "A " responses? if ( exitCode != 0 ) { return new AddScmResult( cl.toString(), "The cvs command failed.", stderr.getOutput(), false ); } return new AddScmResult( cl.toString(), addedFiles ); } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/or0000644000175000017500000001670711057347502033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.cvsexe; /* * 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. */ import org.apache.maven.scm.command.Command; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider; import org.apache.maven.scm.provider.cvslib.command.login.CvsLoginCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.add.CvsExeAddCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.branch.CvsExeBranchCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.changelog.CvsExeChangeLogCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.checkin.CvsExeCheckInCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.checkout.CvsExeCheckOutCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.diff.CvsExeDiffCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.export.CvsExeExportCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.list.CvsExeListCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.remove.CvsExeRemoveCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.status.CvsExeStatusCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.tag.CvsExeTagCommand; import org.apache.maven.scm.provider.cvslib.cvsexe.command.update.CvsExeUpdateCommand; import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * @author Emmanuel Venisse * @version $Id: CvsExeScmProvider.java 691433 2008-09-02 23:41:54Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="cvs_native" */ public class CvsExeScmProvider extends AbstractCvsScmProvider { /** sserver transport method */ public static final String TRANSPORT_SSERVER = "sserver"; /** {@inheritDoc} */ protected Command getAddCommand() { return new CvsExeAddCommand(); } /** {@inheritDoc} */ protected Command getBranchCommand() { return new CvsExeBranchCommand(); } /** {@inheritDoc} */ protected Command getChangeLogCommand() { return new CvsExeChangeLogCommand(); } /** {@inheritDoc} */ protected Command getCheckInCommand() { return new CvsExeCheckInCommand(); } /** {@inheritDoc} */ protected Command getCheckOutCommand() { return new CvsExeCheckOutCommand(); } /** {@inheritDoc} */ protected Command getDiffCommand() { return new CvsExeDiffCommand(); } /** {@inheritDoc} */ protected Command getExportCommand() { return new CvsExeExportCommand(); } /** {@inheritDoc} */ protected Command getListCommand() { return new CvsExeListCommand(); } /** {@inheritDoc} */ protected Command getLoginCommand() { return new CvsLoginCommand(); } /** {@inheritDoc} */ protected Command getRemoveCommand() { return new CvsExeRemoveCommand(); } /** {@inheritDoc} */ protected Command getStatusCommand() { return new CvsExeStatusCommand(); } /** {@inheritDoc} */ protected Command getTagCommand() { return new CvsExeTagCommand(); } /** {@inheritDoc} */ protected Command getUpdateCommand() { return new CvsExeUpdateCommand(); } /** {@inheritDoc} */ protected ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter ) { ScmUrlParserResult result = super.parseScmUrl( scmSpecificUrl, delimiter ); if ( result.getMessages().isEmpty() ) { return result; } result.resetMessages(); String[] tokens = StringUtils.split( scmSpecificUrl, Character.toString( delimiter ) ); String cvsroot; String transport = tokens[0]; // support sserver if ( transport.equalsIgnoreCase( TRANSPORT_SSERVER ) ) { if ( tokens.length < 4 || tokens.length > 5 && transport.equalsIgnoreCase( TRANSPORT_SSERVER ) ) { result.getMessages().add( "The connection string contains too few tokens." ); return result; } //create the cvsroot as the remote cvsroot if ( tokens.length == 4 ) { cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2]; } else { cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2] + ":" + tokens[3]; } } else { result.getMessages().add( "Unknown transport: " + transport ); return result; } String user = null; String password = null; String host = null; String path = null; String module = null; int port = -1; if ( transport.equalsIgnoreCase( TRANSPORT_SSERVER ) ) { //sspi:[username@]host:[port]path:module String userhost = tokens[1]; int index = userhost.indexOf( "@" ); if ( index == -1 ) { user = ""; host = userhost; } else { user = userhost.substring( 0, index ); host = userhost.substring( index + 1 ); } // no port specified if ( tokens.length == 4 ) { path = tokens[2]; module = tokens[3]; } else { // getting port try { port = new Integer( tokens[2] ).intValue(); path = tokens[3]; module = tokens[4]; } catch ( Exception e ) { //incorrect result.getMessages().add( "Your scm url is invalid, could not get port value." ); return result; } } // cvsroot format is :sspi:host:path cvsroot = ":" + transport + ":" + host + ":"; if ( port != -1 ) { cvsroot += port; } cvsroot += path; } if ( port == -1 ) { result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user, password, host, path, module ) ); } else { result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user, password, host, port, path, module ) ); } return result; } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/pom.xml0000644000175000017500000000501311322611461032116 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-cvs 1.3 maven-scm-provider-cvsexe Maven SCM CVS Provider - CVS Executable Impl. Executable implementation for SCM CVS Provider. org.apache.maven.scm maven-scm-provider-cvs-commons org.apache.maven.scm maven-scm-provider-cvstest test org.codehaus.plexus plexus-maven-plugin descriptor org.apache.maven.plugins maven-surefire-plugin maven.scm.provider.cvs.implementation cvs_native maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/0000755000175000017500000000000011345536665031021 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/0000755000175000017500000000000011345536665031610 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/site/0000755000175000017500000000000011345536665032554 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/site/site.x0000644000175000017500000000211711051127665033700 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/0000755000175000017500000000000011345536665032534 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/update/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000043310401301162033744 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/update/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000055510401301162033751 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2004.10.18.13.23.14; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @o Initial commit. @ text @/* $Log: Foo.java,v,v $ Revision 1.1.1.1 2004/10/20 18:03:42 trygvis o Reimport of a maven-scm. $Id: Foo.java,v,v 1.1.1.1 2004/10/20 18:03:42 trygvis Exp $ */ public class Foo { } @ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000064021110401301162033750 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:52 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/Readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000046310401301162033747 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @This directory is for test the checkout command of generic-scm framework. @ ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/checkout/Foo.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000040010401301162033736 0ustar twernertwernerhead 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2003.11.23.19.51.25; author evenisse; state Exp; branches; next ; desc @@ 1.1 log @Some files for the cvs Checkout test command @ text @public class Foo { } @ ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/test-repo/changelog/src/java/org/apache/maven/MavenUtils.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000064021110401301162033750 0ustar twernertwernerhead 1.111; access; symbols MAVEN_1_0:1.107.4.22 MAVEN_1_0_RC4:1.107.4.21 MAVEN_1_0_RC3:1.107.4.20 MAVEN-1_0-BRANCH-merge-3:1.107.4.20 MAVEN_1_0_RC2:1.107.4.12 MAVEN-1_0-BRANCH-merge-2:1.107.4.8 MAVEN-1_0-BRANCH-merge-1:1.107.4.8 MAVEN-1_0-BRANCH:1.107.0.4 MAVEN_RC2_UNSTABLE-merge-1:1.107 MAVEN_RC2_UNSTABLE:1.107.0.2 MAVEN_1_0_RC1:1.105 MAVEN_RC1_REFACTOR:1.98.0.2 MAVEN_POST_RC1_REFACTOR:1.98 MAVEN_RC1_STABLE:1.94.0.2 BRW_TEST:1.97.0.2 MAVEN_PRE_RC1_REFACTOR:1.94 MAVEN_1_0_B10:1.94 MAVEN_1_0_B9:1.91 MAVEN_1_0_B8:1.88 SAFE_31_DEC_2002:1.79 SAFE_31_OCT_2002:1.49 MAVEN_1_0_B7:1.45 MAVEN_1_0_B6:1.41 MAVEN_1_0_B5:1.37 MAVEN_1_0_B4:1.20 pre_callbacks:1.15 MAVEN_1_0_B3:1.9 MAVEN_1_0_B2:1.6 MAVEN_1_0_B1:1.3; locks; strict; comment @# @; 1.111 date 2004.06.28.15.09.13; author brett; state Exp; branches; next 1.110; 1.110 date 2004.05.05.13.05.52; author brett; state Exp; branches; next 1.109; 1.109 date 2004.03.23.02.18.18; author brett; state Exp; branches; next 1.108; 1.108 date 2004.02.07.22.46.15; author brett; state Exp; branches; next 1.107; 1.107 date 2003.10.17.01.08.02; author dion; state Exp; branches 1.107.2.1 1.107.4.1; next 1.106; 1.106 date 2003.10.16.08.53.42; author dion; state Exp; branches; next 1.105; 1.105 date 2003.09.04.00.36.04; author dion; state Exp; branches; next 1.104; 1.104 date 2003.09.02.12.55.12; author evenisse; state Exp; branches; next 1.103; 1.103 date 2003.09.02.10.28.28; author evenisse; state Exp; branches; next 1.102; 1.102 date 2003.09.01.06.56.58; author dion; state Exp; branches; next 1.101; 1.101 date 2003.09.01.05.34.08; author dion; state Exp; branches; next 1.100; 1.100 date 2003.09.01.00.34.40; author dion; state Exp; branches; next 1.99; 1.99 date 2003.08.19.04.31.38; author dion; state Exp; branches; next 1.98; 1.98 date 2003.08.06.05.05.23; author dion; state Exp; branches; next 1.97; 1.97 date 2003.07.29.01.04.36; author dion; state Exp; branches; next 1.96; 1.96 date 2003.07.29.00.17.50; author dion; state Exp; branches; next 1.95; 1.95 date 2003.07.27.23.33.56; author jvanzyl; state Exp; branches; next 1.94; 1.94 date 2003.06.07.01.27.52; author jvanzyl; state Exp; branches 1.94.2.1; next 1.93; 1.93 date 2003.04.12.00.02.04; author dion; state Exp; branches; next 1.92; 1.92 date 2003.04.11.09.03.09; author abarantsev; state Exp; branches; next 1.91; 1.91 date 2003.03.24.13.55.28; author dion; state Exp; branches; next 1.90; 1.90 date 2003.03.08.02.31.36; author bwalding; state Exp; branches; next 1.89; 1.89 date 2003.02.21.07.03.33; author dion; state Exp; branches; next 1.88; 1.88 date 2003.02.10.13.55.00; author jvanzyl; state Exp; branches; next 1.87; 1.87 date 2003.01.24.05.21.36; author jvanzyl; state Exp; branches; next 1.86; 1.86 date 2003.01.24.03.50.37; author jvanzyl; state Exp; branches; next 1.85; 1.85 date 2003.01.08.20.25.57; author jvanzyl; state Exp; branches; next 1.84; 1.84 date 2003.01.07.03.13.53; author jvanzyl; state Exp; branches; next 1.83; 1.83 date 2003.01.02.10.56.52; author dion; state Exp; branches; next 1.82; 1.82 date 2003.01.02.10.56.02; author dion; state Exp; branches; next 1.81; 1.81 date 2003.01.02.07.25.00; author jvanzyl; state Exp; branches; next 1.80; 1.80 date 2002.12.31.07.01.38; author jvanzyl; state Exp; branches; next 1.79; 1.79 date 2002.12.18.17.13.37; author tcopeland; state Exp; branches; next 1.78; 1.78 date 2002.12.18.17.11.01; author tcopeland; state Exp; branches; next 1.77; 1.77 date 2002.12.12.11.37.11; author jvanzyl; state Exp; branches; next 1.76; 1.76 date 2002.12.11.22.30.07; author jvanzyl; state Exp; branches; next 1.75; 1.75 date 2002.12.10.23.03.04; author jvanzyl; state Exp; branches; next 1.74; 1.74 date 2002.12.10.15.46.51; author jvanzyl; state Exp; branches; next 1.73; 1.73 date 2002.12.03.02.48.36; author jvanzyl; state Exp; branches; next 1.72; 1.72 date 2002.12.02.15.21.44; author jvanzyl; state Exp; branches; next 1.71; 1.71 date 2002.12.01.23.26.10; author dion; state Exp; branches; next 1.70; 1.70 date 2002.11.30.17.18.25; author jvanzyl; state Exp; branches; next 1.69; 1.69 date 2002.11.24.23.41.12; author jvanzyl; state Exp; branches; next 1.68; 1.68 date 2002.11.24.19.19.37; author jvanzyl; state Exp; branches; next 1.67; 1.67 date 2002.11.24.19.12.45; author jvanzyl; state Exp; branches; next 1.66; 1.66 date 2002.11.24.19.00.37; author jvanzyl; state Exp; branches; next 1.65; 1.65 date 2002.11.24.18.45.59; author jvanzyl; state Exp; branches; next 1.64; 1.64 date 2002.11.24.17.58.59; author jvanzyl; state Exp; branches; next 1.63; 1.63 date 2002.11.15.22.14.01; author jvanzyl; state Exp; branches; next 1.62; 1.62 date 2002.11.15.19.47.25; author jvanzyl; state Exp; branches; next 1.61; 1.61 date 2002.11.14.06.39.37; author jvanzyl; state Exp; branches; next 1.60; 1.60 date 2002.11.14.06.33.52; author jvanzyl; state Exp; branches; next 1.59; 1.59 date 2002.11.14.04.12.32; author jvanzyl; state Exp; branches; next 1.58; 1.58 date 2002.11.14.03.25.23; author jvanzyl; state Exp; branches; next 1.57; 1.57 date 2002.11.13.17.47.37; author jvanzyl; state Exp; branches; next 1.56; 1.56 date 2002.11.12.16.41.00; author jvanzyl; state Exp; branches; next 1.55; 1.55 date 2002.11.12.04.04.36; author jvanzyl; state Exp; branches; next 1.54; 1.54 date 2002.11.05.15.37.37; author dion; state Exp; branches; next 1.53; 1.53 date 2002.11.04.14.59.37; author jtaylor; state Exp; branches; next 1.52; 1.52 date 2002.11.01.20.56.56; author smor; state Exp; branches; next 1.51; 1.51 date 2002.11.01.18.49.12; author evenisse; state Exp; branches; next 1.50; 1.50 date 2002.11.01.13.27.56; author smor; state Exp; branches; next 1.49; 1.49 date 2002.10.26.05.18.40; author dion; state Exp; branches; next 1.48; 1.48 date 2002.10.19.01.47.22; author jvanzyl; state Exp; branches; next 1.47; 1.47 date 2002.10.18.15.21.28; author jstrachan; state Exp; branches; next 1.46; 1.46 date 2002.10.14.07.39.23; author dion; state Exp; branches; next 1.45; 1.45 date 2002.08.25.12.38.08; author dion; state Exp; branches; next 1.44; 1.44 date 2002.08.25.12.35.44; author dion; state Exp; branches; next 1.43; 1.43 date 2002.08.23.03.17.20; author jvanzyl; state Exp; branches; next 1.42; 1.42 date 2002.08.22.19.40.43; author smor; state Exp; branches; next 1.41; 1.41 date 2002.08.18.17.46.19; author jvanzyl; state Exp; branches; next 1.40; 1.40 date 2002.08.15.20.28.37; author jvanzyl; state Exp; branches; next 1.39; 1.39 date 2002.08.15.18.13.25; author jvanzyl; state Exp; branches; next 1.38; 1.38 date 2002.08.15.17.42.37; author jvanzyl; state Exp; branches; next 1.37; 1.37 date 2002.07.27.23.11.45; author jvanzyl; state Exp; branches; next 1.36; 1.36 date 2002.07.26.19.50.21; author jvanzyl; state Exp; branches; next 1.35; 1.35 date 2002.07.26.18.16.13; author jvanzyl; state Exp; branches; next 1.34; 1.34 date 2002.07.25.17.54.10; author glennm; state Exp; branches; next 1.33; 1.33 date 2002.07.23.03.21.43; author jvanzyl; state Exp; branches; next 1.32; 1.32 date 2002.07.22.19.17.04; author jvanzyl; state Exp; branches; next 1.31; 1.31 date 2002.07.21.03.55.16; author jvanzyl; state Exp; branches; next 1.30; 1.30 date 2002.07.17.21.32.37; author jvanzyl; state Exp; branches; next 1.29; 1.29 date 2002.07.14.15.51.23; author dion; state Exp; branches; next 1.28; 1.28 date 2002.07.14.15.40.48; author dion; state Exp; branches; next 1.27; 1.27 date 2002.07.03.21.51.29; author jvanzyl; state Exp; branches; next 1.26; 1.26 date 2002.06.17.15.53.58; author dion; state Exp; branches; next 1.25; 1.25 date 2002.06.17.14.29.11; author dion; state Exp; branches; next 1.24; 1.24 date 2002.06.16.17.40.04; author dion; state Exp; branches; next 1.23; 1.23 date 2002.06.16.17.07.46; author dion; state Exp; branches; next 1.22; 1.22 date 2002.06.16.16.50.02; author dion; state Exp; branches; next 1.21; 1.21 date 2002.06.06.16.11.51; author dion; state Exp; branches; next 1.20; 1.20 date 2002.06.02.14.38.42; author vmassol; state Exp; branches; next 1.19; 1.19 date 2002.05.30.12.02.47; author jvanzyl; state Exp; branches; next 1.18; 1.18 date 2002.05.29.13.46.24; author jvanzyl; state Exp; branches; next 1.17; 1.17 date 2002.05.27.12.19.51; author dion; state Exp; branches; next 1.16; 1.16 date 2002.05.27.09.10.33; author dion; state Exp; branches; next 1.15; 1.15 date 2002.05.15.00.37.08; author dion; state Exp; branches; next 1.14; 1.14 date 2002.05.15.00.09.43; author dion; state Exp; branches; next 1.13; 1.13 date 2002.05.15.00.07.45; author dion; state Exp; branches; next 1.12; 1.12 date 2002.04.20.05.19.48; author kaz; state Exp; branches; next 1.11; 1.11 date 2002.04.19.14.50.09; author jvanzyl; state Exp; branches; next 1.10; 1.10 date 2002.04.16.21.15.19; author jvanzyl; state Exp; branches; next 1.9; 1.9 date 2002.04.06.16.05.27; author jvanzyl; state Exp; branches; next 1.8; 1.8 date 2002.04.05.00.10.33; author dlr; state Exp; branches; next 1.7; 1.7 date 2002.04.01.21.46.54; author jvanzyl; state Exp; branches; next 1.6; 1.6 date 2002.03.29.03.36.52; author jvanzyl; state Exp; branches; next 1.5; 1.5 date 2002.03.29.02.05.08; author jvanzyl; state Exp; branches; next 1.4; 1.4 date 2002.03.24.21.09.07; author jvanzyl; state Exp; branches; next 1.3; 1.3 date 2002.03.18.05.16.55; author brekke; state Exp; branches; next 1.2; 1.2 date 2002.03.05.04.12.57; author jvanzyl; state Exp; branches; next 1.1; 1.1 date 2002.02.28.22.41.02; author jvanzyl; state Exp; branches; next ; 1.94.2.1 date 2003.08.07.16.56.39; author dion; state Exp; branches; next 1.94.2.2; 1.94.2.2 date 2003.08.11.06.16.11; author dion; state Exp; branches; next 1.94.2.3; 1.94.2.3 date 2003.08.13.06.37.43; author dion; state Exp; branches; next 1.94.2.4; 1.94.2.4 date 2003.08.18.10.25.10; author brett; state Exp; branches; next ; 1.107.2.1 date 2003.10.30.11.46.30; author brett; state Exp; branches; next ; 1.107.4.1 date 2003.11.26.11.45.16; author brett; state Exp; branches; next 1.107.4.2; 1.107.4.2 date 2003.12.02.04.09.25; author brett; state Exp; branches; next 1.107.4.3; 1.107.4.3 date 2003.12.10.23.08.44; author brett; state Exp; branches; next 1.107.4.4; 1.107.4.4 date 2003.12.31.01.32.36; author brett; state Exp; branches; next 1.107.4.5; 1.107.4.5 date 2004.01.06.08.07.03; author brett; state Exp; branches; next 1.107.4.6; 1.107.4.6 date 2004.01.07.16.28.03; author dion; state Exp; branches; next 1.107.4.7; 1.107.4.7 date 2004.01.26.23.36.08; author brett; state Exp; branches; next 1.107.4.8; 1.107.4.8 date 2004.02.07.21.47.10; author brett; state Exp; branches; next 1.107.4.9; 1.107.4.9 date 2004.02.19.23.28.31; author brett; state Exp; branches; next 1.107.4.10; 1.107.4.10 date 2004.02.26.16.10.27; author brett; state Exp; branches; next 1.107.4.11; 1.107.4.11 date 2004.03.01.22.36.36; author evenisse; state Exp; branches; next 1.107.4.12; 1.107.4.12 date 2004.03.07.00.01.29; author brett; state Exp; branches; next 1.107.4.13; 1.107.4.13 date 2004.03.26.00.18.06; author brett; state Exp; branches; next 1.107.4.14; 1.107.4.14 date 2004.03.27.23.54.39; author brett; state Exp; branches; next 1.107.4.15; 1.107.4.15 date 2004.03.28.21.27.26; author evenisse; state Exp; branches; next 1.107.4.16; 1.107.4.16 date 2004.04.02.23.37.19; author brett; state Exp; branches; next 1.107.4.17; 1.107.4.17 date 2004.04.04.02.48.03; author brett; state Exp; branches; next 1.107.4.18; 1.107.4.18 date 2004.04.10.00.56.43; author brett; state Exp; branches; next 1.107.4.19; 1.107.4.19 date 2004.04.23.03.19.28; author brett; state Exp; branches; next 1.107.4.20; 1.107.4.20 date 2004.04.24.23.11.23; author brett; state Exp; branches; next 1.107.4.21; 1.107.4.21 date 2004.06.26.14.52.05; author dion; state Exp; branches; next 1.107.4.22; 1.107.4.22 date 2004.07.06.12.23.41; author brett; state Exp; branches; next ; desc @@ 1.111 log @merge up to MAVEN_1_0_RC4 @ text @package org.apache.maven; /* ==================================================================== * Copyright 2001-2004 The Apache Software Foundation. * * Licensed 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. * ==================================================================== */ import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import java.beans.IntrospectionException; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; /** * Utilities for reading maven project descriptors, profile descriptors and * workspace descriptors. * * @@author Jason van Zyl * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) */ public class MavenUtils { /** Log. */ private static final Log log = LogFactory.getLog( MavenUtils.class ); /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor ) throws MavenException { return getProject( projectDescriptor, null ); } /** * Create a Project object given a file descriptor, and a parent context * @@param projectDescriptor The file to create the project from * @@param parentContext the parent Maven Jelly Context * @@return a new Project * @@throws MavenException when any error happens. */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) throws MavenException { return getProject( projectDescriptor, parentContext, true ); } /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws MavenException when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException { Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the <extend> tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * @@param projectDescriptor the project file * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the project * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths */ private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws MavenException, IOException { // 1) Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } // 2) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); // 3) String pomToExtend = project.getExtend(); if ( pomToExtend != null && useParentPom ) { // We must look in the element for expressions that may be present as // // ../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); pomToExtend = e.evaluateAsString( context ); pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); project.setExtend( pomToExtend ); File parentPom = new File( pomToExtend ); Project parent = (Project) parentPoms.get( parentPom.getCanonicalPath() ); if ( parent == null ) { parent = getNonJellyProject( parentPom, parentContext, true ); parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); context.setParent( parent.getContext() ); } Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); project.mergeParent( parent ); } // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); return project; } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. */ public static List getProjects( File directory, String includes, String excludes ) throws MavenException { return getProjects( directory, includes, excludes, null ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@param context the parent context * @@return a {link List} of {@@link Project}s * @@throws MavenException when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws MavenException { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { Project p = getProject( new File( files[i] ), context ); projects.add( p ); } return projects; } /** * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { // Keep a copy of the original context MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); JellyUtils.populateVariables( context, originalContext ); // We don't want the context or the parent being written out into the XML which // is the interpolated POM. project.setContext( null ); Project parent = project.getParent(); project.setParent( null ); // Interpolate project = getInterpolatedPOM(project, context); // Restore parent and context project.setParent( parent ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** * Get the POM with all variables resolved. * @@param project the project to resolve * @@param context the context to retrieve variables from * @@return a project with no unresolved elements. * @@throws IOException if there is an error parsing the project * @@throws SAXException if there is a sax error parsing the project * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created */ private static Project getInterpolatedPOM(Project project, JellyContext context) throws IOException, SAXException, IntrospectionException, ParserConfigurationException { String projectString = getProjectString(project); Expression e = JellyUtils.decomposeExpression( projectString, context ); String newProjectString = e.evaluateAsString( context ); project = (Project) getProjectBeanReader().parse( new StringReader( newProjectString ) ); return project; } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws MavenException when reading the project */ public static InputStream getProjectInputStream( Project project ) throws MavenException { try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project", e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } } /** * Create an XML string from a project. * * @@param project MavenSession project to turn into an XML representation. * @@return XML representation of the project * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string */ private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException { ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); return projectStream.toString( System.getProperty( "file.encoding" ) ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@return files */ public static String[] getFiles( File directory, String includes ) { return getFiles( directory, includes, null ); } /** * Get a set of files from a specifed directory with a set of includes. * * @@param directory Directory to scan. * @@param includes Comma separated list of includes. * @@param excludes Comma separated list of excludes. * @@return files */ public static String[] getFiles( File directory, String includes, String excludes ) { String[] includePatterns = null; if ( includes != null ) { includePatterns = StringUtils.split( includes, "," ); } String[] excludePatterns = null; if ( excludes != null ) { excludePatterns = StringUtils.split( excludes, "," ); } DirectoryScanner directoryScanner = new DirectoryScanner(); directoryScanner.setBasedir( directory ); directoryScanner.setIncludes( includePatterns ); directoryScanner.setExcludes( excludePatterns ); directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); for ( int i = 0; i < files.length; i++ ) { files[i] = new File( directory, files[i] ).getAbsolutePath(); } return files; } /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader */ public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException { BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); } /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ private static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created */ public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use */ private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } /** * Take a dominant and recessive Map and merge the key:value * pairs where the recessive Map may add key:value pairs to the dominant * Map but may not override any existing key:value pairs. * * If we have two Maps, a dominant and recessive, and * their respective keys are as follows: * * dominantMapKeys = { a, b, c, d, e, f } * recessiveMapKeys = { a, b, c, x, y, z } * * Then the result should be the following: * * resultantKeys = { a, b, c, d, e, f, x, y, z } * * @@param dominantMap Dominant Map. * @@param recessiveMap Recessive Map. * @@return The result map with combined dominant and recessive values. */ public static Map mergeMaps( Map dominantMap, Map recessiveMap ) { Map result = new HashMap(); if ( dominantMap == null && recessiveMap == null ) { return null; } if ( dominantMap != null && recessiveMap == null ) { return dominantMap; } if ( dominantMap == null ) { return recessiveMap; } // Grab the keys from the dominant and recessive maps. Set dominantMapKeys = dominantMap.keySet(); Set recessiveMapKeys = recessiveMap.keySet(); // Create the set of keys that will be contributed by the // recessive Map by subtracting the intersection of keys // from the recessive Map's keys. Collection contributingRecessiveKeys = CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); result.putAll( dominantMap ); // Now take the keys we just found and extract the values from // the recessiveMap and put the key:value pairs into the dominantMap. for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) { Object key = i.next(); result.put( key, recessiveMap.get( key ) ); } return result; } /** * Take a series of Maps and merge * them where the ordering of the array from 0..n * is the dominant order. * * @@param maps An array of Maps to merge. * @@return Map The result Map produced after the merging process. */ public static Map mergeMaps( Map[] maps ) { Map result; if ( maps.length == 0 ) { result = null; } else if ( maps.length == 1 ) { result = maps[0]; } else { result = mergeMaps( maps[0], maps[1] ); for ( int i = 2; i < maps.length; i++ ) { result = mergeMaps( result, maps[i] ); } } return result; } /** * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@todo should premerge driver, etc if they are being kept * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); Properties driverProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the default.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { value = map.get( key ); try { String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); } context.setVariable( key, value ); } } } /** * Load properties from a File. * * @@param file Propertie file to load. * @@return The loaded Properties. */ private static Properties loadProperties( File file ) { try { if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } } catch ( Exception e ) { // ignore log.debug("Unexpected error loading properties", e); } return null; } /** * Load properties from an InputStream. * * @@param is InputStream from which load properties. * @@return The loaded Properties. */ private static Properties loadProperties( InputStream is ) { try { Properties properties = new Properties(); properties.load( is ); for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } return properties; } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } finally { try { if ( is != null ) { is.close(); } } catch ( IOException e ) { // ignore log.debug("Unexpected exception loading properties", e); } } return null; } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param namespace the namespace * @@param name the tag name * @@param text the body text */ public void body(String namespace, String name, String text) { this.value = text; } /** * Finish off this element. * @@param namespace the namespace of the element * @@param elementName the name of the element */ public void end(String namespace, String elementName) { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } } /** Resource bundle with user messages. */ private static ResourceBundle messages; /** * Load MavenSession user messages from a resource bundle given the * user's locale. * @@todo Move locale tools into their own class. */ private static void loadMessages() { try { // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); } catch ( MissingResourceException e ) { // If we can't find the appropriate message bundle for the locale then // we will fall back to English. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages", Locale.ENGLISH ); } } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@return Message for the user's locale. */ public static String getMessage( String messageId ) { return getMessage( messageId, null ); } /** * Retrieve a user message. * * @@param messageId Id of message type to use. * @@param variable Value to substitute for ${1} in the given message. * @@return Message for the user's locale. */ public static String getMessage( String messageId, Object variable ) { if ( messages == null ) { loadMessages(); } if ( variable == null ) { return messages.getString( messageId ); } else { return StringUtils.replace( messages.getString( messageId ), "${1}", variable.toString() ); } } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails * @@return the canonical path of the directory if not absolute */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { File f = new File( dir ); if ( !(f.isAbsolute()) ) { return new File( basedir, dir ).getCanonicalPath(); } else { return f.getCanonicalPath(); } } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@return the relative path * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.equals(canonicalBasedir) ) { return "."; } if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; } /** * Debugging function. * @@param classLoader the class loader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { System.out.println( "ClassLoader name: " + classLoader.getName() ); URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } } @ 1.110 log @merge changes between MAVEN_1_0_RC2 and MAVEN-1_0-BRANCH-merge-3 @ text @d21 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.109 log @merge changes on MAVEN-1_0-BRANCH between MAVEN-1_0-BRANCH-merge-2 and MAVEN-1_0-RC2 @ text @a35 1 import org.apache.maven.jelly.MavenExpressionFactory; d44 1 d46 2 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a83 3 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; a95 3 /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); d104 1 a104 1 * @@throws Exception when any errors occur d107 1 a107 1 throws Exception d117 1 a117 1 * @@throws Exception when any error happens. FIXME d120 1 a120 1 throws Exception d133 1 a133 1 * @@throws Exception when any errors occur - TODO [RC2] bad d138 1 a138 1 throws Exception d140 6 a145 3 Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d147 19 a165 2 // Fully initialize the project. project.initialize(); d191 2 a192 1 * @@throws Exception when any errors occur - TODO [RC2] bad d197 1 a197 1 throws Exception d200 9 a208 1 Project project = (Project) getProjectBeanReader().parse( projectDescriptor ); d221 1 a221 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); d261 1 a261 1 * @@throws Exception when anything goes wrong. FIXME this is bad d264 1 a264 1 throws Exception d277 1 a277 1 * @@throws Exception when anything goes wrong. FIXME this is bad d283 1 a283 1 throws Exception d303 3 a305 1 * @@throws Exception when anything goes wrong. FIXME this is bad d308 1 a308 1 throws Exception d324 4 a327 1 * @@throws Exception when anything goes wrong. FIXME this is bad d330 1 a330 1 throws Exception d340 1 a340 1 context.setVariables( originalContext.getVariables() ); a363 1 * @@throws Exception when there is an error getting the project as a string d366 2 d370 1 a370 1 throws Exception, IOException, SAXException d373 1 a373 1 Expression e = JellyUtils.decomposeExpression( projectString, mavenExpressionFactory, context ); d382 1 a382 1 * @@throws Exception when anything goes wrong. FIXME this is bad d385 1 a385 1 throws Exception d387 16 a402 1 return new StringInputStream( getProjectString( project ) ); d410 3 a412 1 * @@throws Exception when anything goes wrong. FIXME this is bad d414 1 a414 2 public static String getProjectString( Project project ) throws Exception d423 1 a423 4 // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); d481 3 a483 3 * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad d486 1 a486 1 throws Exception d536 2 a537 1 * @@throws Exception If an error occurs while creating the XMLReader. d539 1 a539 2 public static XMLReader getXMLReader() throws Exception d554 2 a555 1 * @@throws Exception If an error occurs while creating the reader. d557 1 a557 2 private static XMLReader createXMLReader() throws Exception d715 1 a715 1 public static MavenJellyContext createContext( File descriptorDirectory, d787 3 d817 1 a817 1 String literalValue = (String) map.get( key ); d821 1 a831 2 context.setVariable( key, value ); d836 1 a836 1 log.debug("Unexpected error evaluating expression", e); d838 1 d879 7 a938 1 * @@throws Exception when any errors occur a940 1 throws Exception a948 1 * @@throws Exception when any errors occur a950 1 throws Exception d1088 1 a1088 2 * @@param project * @@param classLoader @ 1.108 log @merge in 1.0 branch @ text @d4 1 a4 1 * The Apache Software License, Version 1.1 d6 3 a8 2 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. d10 1 a10 46 * 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 apache@@apache.org. * * 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 * . d12 5 d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 parent = getNonJellyProject( parentPom, null, true ); d806 4 a809 1 return loadProperties( new FileInputStream (file) ); d1043 2 @ 1.107 log @style @ text @d59 1 a63 1 import org.apache.commons.collections.BeanMap; d91 1 d103 1 d110 2 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d114 1 d119 1 a119 1 private static final Log logger = LogFactory.getLog( MavenUtils.class ); d170 26 a195 1 * context. We are doing several things when creating a POM object, the phases d206 1 a206 1 * 3) We check to see if the tag is being employed. If so, the parent d210 1 a210 7 * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} d213 2 a214 2 * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur d216 3 a218 3 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a220 2 //if ( pom.get()) d225 2 a226 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d245 3 a247 1 parent = (Project) getProjectBeanReader().parse( parentPom ); d249 1 a249 4 if ( parent != null ) { parentPoms.put( parentPom.getCanonicalPath(), parent ); } d252 4 a255 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d257 1 a257 3 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); a264 9 // 4) project = getJellyProject( project ); // 5) project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); d272 2 a273 2 * @@param includes the pattern that matches a project * @@param context the parent context d277 1 a277 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d280 1 a280 1 return getProjects( directory, includes, null, context ); d341 1 a341 2 // Save the original context because we null it temporarly // while we funnel it through betwixt. d351 1 a351 1 // We don't want the context being written out into the XML which d354 4 d360 2 a384 16 // Script script = JellyUtils.compileScript( getProjectInputStream(project), // context, // INTERNAL_ENCODING ); // // // Now run the script against the fully populated context so all the // // values are filled in correctly. // ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); // XMLOutput output = XMLOutput.createXMLOutput( writer ); // script.run( context, output ); // writer.close(); // // // Read in the the project.xml contents with the interpolated values and // // put back the original context with all the values that have been populated // // but change the project in the context to the newly interpolated version. // project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); a421 80 * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. logger.debug("No write method for property", e); } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else { // it needs populating if it's null return (o == null); } } /** d594 1 a594 1 if ( dominantMap == null && recessiveMap != null ) d633 1 a633 1 Map result = null; d657 30 d706 1 d720 1 a720 1 logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d723 2 a724 13 // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); d727 1 a727 1 MavenUtils.class.getClassLoader().getResourceAsStream( d731 1 a731 1 MavenUtils.class.getClassLoader().getResourceAsStream( d761 1 a761 1 //add in the driver.properties with defaults, but in inheritance mode. d780 1 a780 1 context.setVariable( "basedir", descriptorDirectory.getPath() ); d829 1 a829 1 logger.debug("Unexpected error evaluating expression", e); d850 1 a850 1 logger.debug("Unexpected error loading properties", e); d873 1 a873 1 logger.debug("Unexpected exception loading properties", e); d887 1 a887 1 logger.debug("Unexpected exception loading properties", e); d1055 39 @ 1.107.4.1 log @migrate "unstable" branch @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.107.4.2 log @formatting, commenting @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d207 1 @ 1.107.4.3 log @Fix bug with werkz, better handling of plugins not being found, fix bug when no project.xml present @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a227 6 // TODO [RC2] - check -vvv- MavenJellyContext pContext = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); parent.setContext(pContext); context.setParent(pContext); // TODO [RC2] - check -^^^- @ 1.107.4.4 log @cleanup project creation, make inheritence work @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private static final Log log = LogFactory.getLog( MavenUtils.class ); d169 1 a169 26 * context. * * @@param projectDescriptor a maven project.xml {@@link File} * @@param parentContext the parent context for the new project * @@param useParentPom whether a parent project should be respected * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur - TODO [RC2] bad */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) throws Exception { Project project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); // Fully initialize the project. project.initialize(); return project; } /** * Get a project, but not a Jelly-ised project. ie Don't evaluate the * variables. We are doing several things when creating a POM object, the phases d180 1 a180 1 * 3) We check to see if the <extend> tag is being employed. If so, the parent d184 5 a188 1 * @@param projectDescriptor the project file d191 2 a192 2 * @@return the project * @@throws Exception when any errors occur - TODO [RC2] bad d194 3 a196 3 private static Project getNonJellyProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d199 2 d205 2 a206 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d225 1 a225 1 parent = getNonJellyProject( parentPom, null, true ); d228 6 a233 2 context.setParent( parent.getContext() ); d249 7 d332 2 a333 1 // Keep a copy of the original context d659 1 a659 1 log.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); d674 1 a674 1 log.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); d712 1 a712 1 log.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); d753 1 a753 1 //add in the default.properties with defaults, but in inheritance mode. d821 1 a821 1 log.debug("Unexpected error evaluating expression", e); d842 1 a842 1 log.debug("Unexpected error loading properties", e); d865 1 a865 1 log.debug("Unexpected exception loading properties", e); d879 1 a879 1 log.debug("Unexpected exception loading properties", e); @ 1.107.4.5 log @PR: MAVEN-1107 Add / to paths, use correct classloader for maven.jar @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d726 1 a726 1 MavenUtils.class.getResourceAsStream( d730 1 a730 1 MavenUtils.class.getResourceAsStream( @ 1.107.4.6 log @Code cleanup @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d169 1 a169 1 * context. d355 1 a355 1 d358 1 a358 1 d780 1 a780 1 d822 1 a822 1 d1064 1 a1064 1 while ( tok.hasMoreTokens() ) @ 1.107.4.7 log @Optimize imports, reformatting by IDEA. @ text @d59 21 a103 20 import javax.xml.parsers.SAXParserFactory; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.8 log @reinstate useful debugging function @ text @a58 1 import com.werken.forehead.ForeheadClassLoader; a89 1 import java.net.URL; d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1068 23 /** * Debugging function. * @@param project * @@param classLoader */ public static void displayClassLoaderContents( ForeheadClassLoader classLoader ) { URL[] urls = classLoader.getURLs(); for ( int i = 0; i < urls.length; i++ ) { System.out.println( "urls[" + i + "] = " + urls[i] ); } ClassLoader parent = classLoader.getParent(); if ( parent != null && parent instanceof ForeheadClassLoader ) { System.out.println( "Displaying Parent classloader: " ); displayClassLoaderContents( ( ForeheadClassLoader ) classLoader.getParent()); } } @ 1.107.4.9 log @improve logging output @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d845 1 a845 4 if ( file.exists() ) { return loadProperties( new FileInputStream (file) ); } @ 1.107.4.10 log @fix possible NPE in reactor @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d245 1 a245 1 parent = getNonJellyProject( parentPom, parentContext, true ); @ 1.107.4.11 log @Update to ASL v.2 @ text @d4 51 a54 1 * Copyright 2001-2004 The Apache Software Foundation. a55 11 * Licensed 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. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.12 log @show classloader name @ text @d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a1042 2 System.out.println( "ClassLoader name: " + classLoader.getName() ); @ 1.107.4.13 log @PR: MAVEN-1193 Submitted by: dion gillard remove "throws Exception" @ text @a44 1 import javax.xml.parsers.ParserConfigurationException; a45 2 import java.beans.IntrospectionException; d72 1 a72 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d108 1 a108 1 * @@throws MavenException when any errors occur d111 1 a111 1 throws MavenException d121 1 a121 1 * @@throws MavenException when any error happens. d124 1 a124 1 throws MavenException d137 1 a137 1 * @@throws MavenException when any errors occur d142 1 a142 1 throws MavenException d144 3 a146 6 Project project = null; try { project = getNonJellyProject( projectDescriptor, parentContext, useParentPom ); project = getJellyProject( project ); project.setFile( projectDescriptor ); d148 2 a149 19 // Fully initialize the project. project.initialize(); } catch (IntrospectionException e) { throw new MavenException("Error creating a string from the project", e); } catch (IOException e) { throw new MavenException("Error reading XML or initializing", e); } catch (ParserConfigurationException e) { throw new MavenException("Error creating a JAXP Parser", e); } catch (SAXException e) { throw new MavenException("Error parsing XML", e); } d175 1 a175 2 * @@throws MavenException when there are errors reading the descriptor * @@throws IOException when resolving file names and paths d179 2 a180 2 boolean useParentPom ) throws MavenException, IOException d183 1 a183 9 Project project = null; try { project = (Project) getProjectBeanReader().parse( projectDescriptor ); } catch (Exception e) { throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); } d236 1 a236 1 * @@throws MavenException when anything goes wrong. d239 1 a239 1 throws MavenException d252 1 a252 1 * @@throws MavenException when anything goes wrong. FIXME this is bad d258 1 a258 1 throws MavenException d278 1 a278 3 * @@throws IntrospectionException when creating a bean reader * @@throws SAXException when an error occurs parsing the XML * @@throws ParserConfigurationException when a JAXP parser can't be created d280 2 a281 1 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d297 1 a297 4 * @@throws IntrospectionException when there are errors creating a string from the project for interpolation * @@throws SAXException when reading the interpolated POM fails * @@throws IOException when there are errors reading * @@throws ParserConfigurationException when a JAXP parser can't be created d299 2 a300 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d334 1 a336 2 * @@throws IntrospectionException when there are errors creating a string from the project * @@throws ParserConfigurationException when a JAXP parser can't be created d339 1 a339 1 throws IOException, SAXException, IntrospectionException, ParserConfigurationException d351 1 a351 3 * @@throws IOException when reading the string fails * @@throws SAXException when parsing the interpolated POM fails * @@throws IntrospectionException when writing the POM to XML d354 1 a354 1 throws MavenException d356 1 a356 16 try { return new StringInputStream( getProjectString( project ) ); } catch (IOException e) { throw new MavenException("Error writing the project",e); } catch (IntrospectionException e) { throw new MavenException("Error introspecting the project", e); } catch (SAXException e) { throw new MavenException("Error parsing the project as XML", e); } d364 1 a364 3 * @@throws IOException writing the project fails * @@throws IntrospectionException when there are problems writing the project bean as a string * @@throws SAXException when there are problems writing the project bean as a string d366 2 a367 1 private static String getProjectString( Project project ) throws IOException, IntrospectionException, SAXException d437 3 a439 3 * @@throws IntrospectionException when there are errors registering the provided class * @@throws SAXException when there are errors getting an XML reader * @@throws ParserConfigurationException when there are errors getting an XML reader d441 2 a442 2 public static BeanReader createBeanReader( Class clazz ) throws IntrospectionException, SAXException, ParserConfigurationException d492 1 a492 2 * @@throws SAXException when the reader can't be created * @@throws ParserConfigurationException when the reader can't be created d494 2 a495 1 public static XMLReader getXMLReader() throws SAXException, ParserConfigurationException d510 1 a510 2 * @@throws SAXException If there are errors creating the reader * @@throws ParserConfigurationException If there are errors creating the SAX parser to use d512 2 a513 1 private static XMLReader createXMLReader() throws SAXException, ParserConfigurationException d770 1 a770 1 value = map.get( key ); d772 1 a772 1 if ( value instanceof String ) d774 3 a776 1 try d778 1 a778 11 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } d780 1 a780 1 catch ( Exception e ) d782 1 a782 2 // do nothing. log.debug( "Unexpected error evaluating expression", e ); d784 7 a791 1 context.setVariable( key, value ); d885 1 d888 1 d897 1 d900 1 @ 1.107.4.14 log @need to set these properties each time - integrateMap will not override them @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 1 a827 1 try d829 4 a832 2 String literalValue = (String) value; Expression expr = CompositeExpression.parse( literalValue, factory ); d834 8 a841 3 if ( expr != null ) { value = expr; d843 1 a843 1 else d845 2 a846 1 value = literalValue; a847 5 } catch ( Exception e ) { // do nothing. log.debug( "Unexpected error evaluating expression", e ); @ 1.107.4.15 log @Fix some checkstyle errors @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d148 1 a148 1 try d203 1 a203 1 boolean useParentPom ) d210 1 a210 1 project = (Project) getProjectBeanReader().parse( projectDescriptor ); d214 1 a214 1 throw new MavenException("Error parsing project.xml '" + projectDescriptor.getAbsolutePath() + "'"); d314 1 a314 2 private static BeanReader getProjectBeanReader() throws IntrospectionException, SAXException, ParserConfigurationException d335 2 a336 2 private static Project getJellyProject( Project project ) throws IOException, SAXException, IntrospectionException, ParserConfigurationException d388 3 a390 1 * @@throws MavenException when reading the project d401 1 a401 1 throw new MavenException("Error writing the project", e); d496 1 a496 1 public static BeanReader createBeanReader( Class clazz ) d831 1 a831 1 d1089 2 a1090 1 * @@param classLoader the class loader @ 1.107.4.16 log @PR: MAVEN-1205 remove function unused, and would cause ClassCastException if used @ text @d36 1 d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 3 d228 1 a228 1 Expression e = JellyUtils.decomposeExpression( pomToExtend, context ); d380 1 a380 1 Expression e = JellyUtils.decomposeExpression( projectString, context ); a764 2 // TODO: need an exception for those specified on the command line @ 1.107.4.17 log @PR: MAVEN-1050 Submitted by: Shinsuke SUGAYA Use system file encoding for POM @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d84 3 d426 4 a429 1 return projectStream.toString( System.getProperty( "file.encoding" ) ); d721 1 a721 1 public static MavenJellyContext createContext( File descriptorDirectory, d761 2 @ 1.107.4.18 log @trim properties @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a875 7 for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) { String property = ( String ) i.next(); properties.setProperty( property, properties.getProperty( property ).trim() ); } @ 1.107.4.19 log @o enhancements to maven --info o display help on submitting a bug report if fatal exception thrown o resolve relative paths for properties such as maven.repo.local @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a785 3 // deliberately use the original base directory for these variables context.resolveRelativePaths( new File( System.getProperty( "user.dir" ) ) ); @ 1.107.4.20 log @improve inheritence tests, fix parent property inheritence. setVariables( context.getVariables() ) will obviously not pass in properties from a parent context of context, so these were replaced with an iterating function to fold them in to the new context (which has an alternative parent context tree). @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d340 1 a340 1 JellyUtils.populateVariables( context, originalContext ); @ 1.107.4.21 log @Make imports consistent @ text @a20 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.107.4.22 log @PR: MAVEN-1296 Submitted by: Eric Lapierre Reviewed by: Brett Porter fix for property inheritence in some circumstances @ text @d75 1 a75 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d239 4 a242 2 // Map in the parent context which already has the properties loaded integrateMapInContext( parent.getContext().getVariables(), context ); @ 1.107.2.1 log @PR: MAVEN-760 PluginManager changes, and the flow on effects. @ text @a58 21 import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import javax.xml.parsers.SAXParserFactory; d63 1 d84 19 d108 1 a108 2 * @@author Brett Porter * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a110 1 * @@todo [RC2] split getProject (project.properties + defaults) != getPluginProject (plugin.properties only) d184 3 a186 1 * @@todo should cache all project xml files with the right context , merged down to the leafs in inheritence a205 1 d225 5 a229 2 parent.setFile( parentPom ); parentPoms.put( parentPom.getCanonicalPath(), parent ); d232 2 a233 4 Properties properties = loadProjectBuildProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); properties = loadProjectProperties( parentPom.getParentFile() ); integrateMapInContext( properties, context ); d235 3 a237 1 project.mergeParent( parent ); d247 2 d261 2 a262 2 * @@param includes the pattern that matches a project that you want included * @@param excludes the pattern that matches a project that you don't want included d266 1 a266 1 public static List getProjects( File directory, String includes, String excludes ) d269 1 a269 1 return getProjects( directory, includes, excludes, null ); d341 1 a341 1 // We don't want the context or the parent being written out into the XML which a343 4 Project parent = project.getParent(); project.setParent( null ); // Interpolate d345 1 a345 3 // Restore parent and context project.setParent( parent ); d369 16 d422 80 d674 1 a674 1 if ( dominantMap == null ) d713 1 a713 1 Map result; a736 30 * Load the build.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectBuildProperties( File directory ) { // project build properties File projectBuildPropertiesFile = new File( directory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); return loadProperties( projectBuildPropertiesFile ); } /** * Load the project.properties file for a project. * @@param directory the directory of the project * @@return the properties */ private static Properties loadProjectProperties( File directory ) { // project properties File projectPropertiesFile = new File( directory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); return loadProperties( projectPropertiesFile ); } /** a755 1 * @@todo should premerge driver, etc if they are being kept d772 13 a784 2 Properties projectProperties = loadProjectProperties( descriptorDirectory ); Properties projectBuildProperties = loadProjectBuildProperties( descriptorDirectory ); d840 2 a841 2 context.setVariable( "basedir", descriptorDirectory.getAbsolutePath() ); d883 1 a883 1 a1113 16 } /** * Get a list of goals from a CSV list. * @@param goalCsv the goals * @@return the list of goal names */ public static List getGoalListFromCsv( String goalCsv ) { StringTokenizer tok = new StringTokenizer( goalCsv, "," ); List goals = new ArrayList(); while ( tok.hasMoreTokens() ) { goals.add( tok.nextToken() ); } return goals; @ 1.106 log @handle path == basedir for makeRelativePath @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1097 1 a1097 1 if ( canonicalPath.equals(canonicalBasedir)) @ 1.105 log @Fix tabs @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1096 6 @ 1.104 log @- Remove unneeded ${basedir} - Update makeAbsolutePath for return a correct pathname and not a mixture of slash/backslash for separator on windows. Now, if we use a relative path or an absolute path, we obtain the same string for absolute path. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d829 1 a829 1 MavenUtils.integrateMapInContext( result, context ); d834 2 a835 2 // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); @ 1.103 log @Fix documentation. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d1074 2 a1075 1 if ( !(new File( dir ).isAbsolute()) ) d1079 4 a1082 1 return dir; @ 1.102 log @Remove local variable @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a211 1 // we encourage the use of ${basedir} using extension: d213 1 a213 1 // ${basedir}/../project.xml @ 1.101 log @rename local variable to not hide outer one @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 1 a201 2 BeanReader beanReader = getProjectBeanReader(); Project project = (Project) beanReader.parse( projectDescriptor ); d225 1 a225 1 parent = (Project) beanReader.parse( parentPom ); @ 1.100 log @Change POM interpolation from compiling as a script to evaluating as an expression. This saves around 40M on bootstrapping. Checkstyle fixes. @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 2 a202 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d226 1 a226 1 parent = (Project) projectBeanReader.parse( parentPom ); @ 1.99 log @Switch stable branch back to HEAD @ text @a67 2 import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d81 1 a84 1 import java.io.BufferedWriter; a89 1 import java.io.OutputStreamWriter; a90 1 import java.io.Writer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d139 1 a139 1 * Create a Project object given a name a file descriptor. d151 7 d188 2 d219 1 d264 1 d280 1 d346 2 a347 16 Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); d355 35 d435 1 a435 1 for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d461 1 a495 4 else if ( o == null ) { return true; } d498 2 a499 1 return false; d696 1 a696 1 for ( Iterator i = contributingRecessiveKeys.iterator(); i.hasNext(); ) d817 1 a817 1 d819 1 a819 1 d822 1 a822 1 d835 1 a835 1 d864 1 a864 1 for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) d891 1 d907 1 a907 1 return loadProperties( new FileInputStream( file ) ); d912 1 d935 1 d949 1 d993 2 a994 1 * d1072 1 d1076 1 a1076 1 if ( new File( dir ).isAbsolute() == false ) d1087 1 @ 1.98 log @Update copyright @ text @d59 29 a89 1 import java.io.FileReader; d92 1 d94 1 a94 1 import java.io.StringWriter; a106 7 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; import org.xmlpull.v1.XmlPullParserException; d111 2 a112 2 * NOTE: * I need to make this class not-visible from outside this package. d114 1 a114 2 * @@author Jason van Zyl * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 21 d142 8 a149 7 /** Project marshaller. */ private DefaultProjectMarshaller marshaller; /** Project unmarshaller. */ private DefaultProjectUnmarshaller unmarshaller; public MavenUtils() d152 1 a152 2 marshaller = new DefaultProjectMarshaller(); unmarshaller = new DefaultProjectUnmarshaller(); d155 1 a155 5 // ---------------------------------------------------------------------- // Protected methods to be used by the Maven facade. // ---------------------------------------------------------------------- Project getProject( File project, Maven maven ) d158 1 a158 1 return getProject( project, true, maven ); d161 30 a190 1 Project getProject( File projectDescriptor, boolean useParentPom, Maven maven ) d193 2 d196 2 a197 12 FileReader pfr = new FileReader( projectDescriptor ); Project project = null; try { project = unmarshaller.parse( pfr ); } catch (XmlPullParserException e) { System.err.println("Error reading file: " + projectDescriptor); throw e; } pfr.close(); d200 2 a201 13 Map properties = createProjectProperties( projectDescriptor.getParentFile() ); // We do not want to do POM interpolation in properties files but maven.final.name is // baked into the driver.properties file. So we'll leave its default value but we will // place the real value in here because we are not interpolating the POM into properties. String mavenFinalName = (String) properties.get( "maven.final.name" ); if ( mavenFinalName.indexOf( "${" ) >= 0 ) { project.getId(); properties.put( "maven.final.name", project.getArtifactId() + "-" + project.getCurrentVersion() ); } d207 8 a214 1 pomToExtend = StringUtils.interpolate( pomToExtend, properties ); d220 1 a220 3 FileReader fr = new FileReader( parentPom ); parent = unmarshaller.parse( fr ); fr.close(); d226 1 d228 2 a229 2 project.setParent( parent ); } d231 3 a233 1 project = setupInheritance( project, parent ); d236 4 a239 6 // We need to do the interpolation after the merging so that ${basedir} is // expanded correctly. project = interpolateProject( project, properties ); // Set the standard properties. project.setProjectProperties( properties ); d241 2 a242 2 // Set a reference to the maven session. project.setMaven( maven ); a252 112 private Project setupInheritance( Project child, Project parent ) { // Id if ( child.getId() == null ) { child.setId( parent.getId() ); } // Group id if ( child.getGroupId() == null ) { child.setGroupId( parent.getGroupId() ); } // Short description if ( child.getShortDescription() == null ) { child.setShortDescription( parent.getShortDescription() ); } // Organization if ( child.getOrganization() == null ) { child.setOrganization( parent.getOrganization() ); } // Build if ( child.getBuild() == null ) { child.setBuild( parent.getBuild() ); } // Dependencies :: aggregate child.addParentDependencies( parent.getDependencies() ); return child; } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ Map createProjectProperties( File descriptorDirectory ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, defaultProperties, driverProperties } ); // project build properties File pluginPropertiesFile = new File( descriptorDirectory, "plugin.properties" ); Properties pluginProperties = loadProperties( pluginPropertiesFile ); if ( pluginProperties != null ) { result = mergeMaps( result, pluginProperties ); } // Set the basedir value in the context. result.put( "basedir", descriptorDirectory.getPath() ); for ( Iterator i = result.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) result.get( key ); result.put( key, StringUtils.interpolate( value, result ) ); } return result; } d261 1 a261 1 List getProjects( File directory, String includes, Maven maven ) d264 1 a264 1 return getProjects( directory, includes, null, maven ); d276 4 a279 4 List getProjects( File directory, String includes, String excludes, Maven maven ) d288 1 a288 1 Project p = getProject( new File( files[i] ), maven ); d296 65 d365 1 a365 1 public InputStream getProjectInputStream( Project project ) d378 1 a378 1 public String getProjectString( Project project ) d381 93 a473 3 StringWriter writer = new StringWriter(); marshaller.marshall( writer, project ); return writer.toString(); d483 1 a483 1 public String[] getFiles( File directory, String includes ) d496 1 a496 1 public String[] getFiles( File directory, String includes, String excludes ) a524 3 // ---------------------------------------------------------------------- // private // ---------------------------------------------------------------------- d526 10 a535 1 private Project interpolateProject( Project p, Map map ) d538 60 a597 2 return unmarshaller.parse( new StringReader( StringUtils.interpolate( getProjectString( p ), map ) ) ); d600 15 a614 3 // ---------------------------------------------------------------------- // Static methods that can probably be moved to a real util class. // ---------------------------------------------------------------------- d711 157 d875 1 a875 1 public static Properties loadProperties( File file ) d895 1 a895 1 public static Properties loadProperties( InputStream is ) d925 49 d1033 39 @ 1.97 log @Add debug messages with silly project.xml files @ text @d6 1 a6 1 * Copyright (c) 2002 The Apache Software Foundation. All rights d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.96 log @Reorg improts @ text @d83 1 d93 1 a93 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d128 10 a137 1 Project project = unmarshaller.parse( pfr ); @ 1.95 log @o RC1 Refactoring PR: Obtained from: Submitted by: Reviewed by: @ text @a58 6 import org.apache.commons.collections.CollectionUtils; import org.apache.maven.project.Project; import org.apache.maven.util.StringInputStream; import org.apache.plexus.util.DirectoryScanner; import org.apache.plexus.util.StringUtils; a65 2 import java.io.Writer; import java.io.OutputStreamWriter; d78 6 d92 1 a92 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d135 1 a135 1 // place the real value in here because we are not interpolatin the POM into roperties. @ 1.94 log @o MAVEN-294 Applying John Casey's patches for dealing with property values that are present in driver.properties that need to be overriden. @ text @a58 6 import com.werken.forehead.ForeheadClassLoader; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.collections.BeanMap; a59 15 import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.jelly.MavenExpressionFactory; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.project.BaseObject; a60 1 import org.apache.maven.repository.Artifact; d62 2 a63 2 import org.apache.tools.ant.DirectoryScanner; import org.xml.sax.XMLReader; a64 3 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; d67 1 a69 1 import java.io.OutputStreamWriter; d71 1 d73 1 d90 3 d94 1 a94 3 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ * * @@todo Remove all the context creation code and make a ContextBuilder class. d98 2 a99 2 /** Log. */ private static final Log logger = LogFactory.getLog( MavenUtils.class ); d101 2 a102 2 /** Internal encoding used for Jelly interpolation. */ private static final String INTERNAL_ENCODING = "ISO-8859-1"; d104 2 a105 2 /** we want to parse something */ private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d107 1 a107 23 /** Should we cache and reuse the introspector */ private static boolean cacheIntrospector = true; /** The singleton introspector if caching is enabled */ private static XMLIntrospector singletonIntrospector; /** Project Bean Reader */ private static BeanReader projectBeanReader; /** Maven Expression Factory. */ private static MavenExpressionFactory mavenExpressionFactory = new MavenExpressionFactory(); /** Map of loaded POMs. */ private static HashMap parentPoms = new HashMap(); /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor ) d110 2 a111 1 return getProject( projectDescriptor, null ); d114 5 a118 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d121 1 a121 1 return getProject( projectDescriptor, parentContext, true ); d124 1 a124 30 /** * Create a Project object given a file descriptor and optionally a parent Jelly * context. We are doing several things when creating a POM object, the phases * are outlined here: * * 1) The project.xml file is read in using betwixt which creates for us a * Project object that, at this point, has not been run through Jelly i.e. * no interpolation has occured yet. * * 2) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * * 3) We check to see if the tag is being employed. If so, the parent * project.xml file is read in. At this point we have a child and parent POM * and the values are merged where the child's values override those of the * parent. * * 4) The POM we have at this point is then processed through Jelly. * * 5) The project is handed the reference to the File that was used to create * the project itself. * * @@param projectDescriptor a maven project.xml {@@link File} * @@return the MavenSession project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) a126 2 //if ( pom.get()) d128 3 a130 2 BeanReader projectBeanReader = getProjectBeanReader(); Project project = (Project) projectBeanReader.parse( projectDescriptor ); d133 13 a145 2 MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); d151 1 a151 7 // We must look in the element for expressions that may be present as // we encourage the use of ${basedir} using extension: // // ${basedir}/../project.xml Expression e = JellyUtils.decomposeExpression( pomToExtend, mavenExpressionFactory, context ); pomToExtend = e.evaluateAsString( context ); d157 3 a159 1 parent = (Project) projectBeanReader.parse( parentPom ); d165 2 d169 2 a170 2 // This is very slow. A BCEL solution would be very nice here. project = (Project) mergeBeans( project, parent ); d172 3 a174 4 // Now let's do some magic with dependencies. We take all // the parent's dependencies and put them in with the childs. project.addParentDependencies( parent.getDependencies() ); } d176 2 a177 4 // Set the created context, and put the project itself in the context. This // is how we get the ${pom} reference in the project.xml file to work. project.setContext( context ); context.setProject( project ); d179 2 a180 2 // 4) project = getJellyProject( project ); d188 94 a281 2 // This may definitely break plugins. ClassLoader cl = project.getContext().getClassLoader(); d283 3 a285 1 if ( cl instanceof ForeheadClassLoader ) d287 1 a287 5 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); ) { Artifact artifact = (Artifact) i.next(); ( (ForeheadClassLoader) cl ).addURL( artifact.getFile().toURL() ); } d290 9 a298 3 // Explicity set the classloader used to find resources. As we just // poked all the dependencies into the classloader. project.getContext().setClassLoader( cl ); d300 1 a300 1 return project; d311 1 a311 1 public static List getProjects( File directory, String includes, MavenJellyContext context ) d314 1 a314 1 return getProjects( directory, includes, null, context ); d326 4 a329 4 public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) d338 1 a338 1 Project p = getProject( new File( files[i] ), context ); a345 65 * Create a project bean reader. We use it more than once so we don't want * to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} * @@throws Exception when anything goes wrong. FIXME this is bad */ private static BeanReader getProjectBeanReader() throws Exception { if ( projectBeanReader == null ) { projectBeanReader = createBeanReader( Project.class ); } return projectBeanReader; } /** * Take the POM and interpolate the value of the project's context to create * a new version of the POM with expanded context values. * * @@param project the maven POM * @@return Jelly interpolated project. * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Project getJellyProject( Project project ) throws Exception { // Save the original context because we null it temporarly // while we funnel it through betwixt. MavenJellyContext originalContext = project.getContext(); // We don't want any taglib references in the context or Jelly // gets confused. All we want are the variables for interpolation. We // can change this but I think we would like to avoid general Jelly // idiom in the POM anyway. JellyContext context = new JellyContext(); context.setVariables( originalContext.getVariables() ); // We don't want the context being written out into the XML which // is the interpolated POM. project.setContext( null ); Script script = JellyUtils.compileScript( getProjectInputStream( project ), context, INTERNAL_ENCODING ); // Now run the script against the fully populated context so all the // values are filled in correctly. ByteArrayOutputStream baos = new ByteArrayOutputStream(); Writer writer = new BufferedWriter( new OutputStreamWriter( baos, INTERNAL_ENCODING ) ); XMLOutput output = XMLOutput.createXMLOutput( writer ); script.run( context, output ); writer.close(); // Read in the the project.xml contents with the interpolated values and // put back the original context with all the values that have been populated // but change the project in the context to the newly interpolated version. project = (Project) getProjectBeanReader().parse( new StringReader( baos.toString() ) ); project.setContext( originalContext ); project.getContext().setProject( project ); return project; } /** d350 1 a350 1 public static InputStream getProjectInputStream( Project project ) d363 1 a363 1 public static String getProjectString( Project project ) d366 3 a368 93 ByteArrayOutputStream projectStream = new ByteArrayOutputStream(); BeanWriter beanWriter = new BeanWriter( projectStream ); beanWriter.setXMLIntrospector( createXMLIntrospector() ); beanWriter.setWriteIDs( true ); beanWriter.write( project ); // We do not care what the original encoding was originally. This // is all completely internal. Our StringInputStream requires // everything to be encoded in "ISO-8859-1". return projectStream.toString( INTERNAL_ENCODING ); } /** * Merge a child and parent Project object. * * @@param child child object * @@param parent the maven project * @@return the child after properties from the parent are merged */ private static Object mergeBeans( Object child, Object parent ) { BeanMap parentBeanMap = new BeanMap( parent ); BeanMap childBeanMap = new BeanMap( child ); for ( Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) { // Take the property for the parent and insert it // into the child bean map. String property = (String) i.next(); try { // If the childs property is null then take it from // the parent. Object c = childBeanMap.get( property ); Object p = parentBeanMap.get( property ); if ( valueNeedsPopulating( c ) ) { childBeanMap.put( property, p ); } else if ( c != null && p != null && !valuePrimitive( c ) ) { Object mergedBean = mergeBeans( c, p ); childBeanMap.put( property, mergedBean ); } } catch ( IllegalArgumentException e ) { // There is no write method for this property. } } return child; } /** * Test if a value is a primitive or not * * @@param o the value to test * @@return true if o is a Boolean, String, Class or Integer. */ private static boolean valuePrimitive( Object o ) { if ( o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer ) { return true; } return false; } /** * Check a child value to see if it needs populating with the parent value. * The constructor sets List values to [] so we have to check those. * * @@param o a child value * @@return true if the child value is an empty collection or null */ private static boolean valueNeedsPopulating( Object o ) { if ( o instanceof Collection && ( (Collection) o ).size() == 0 ) { return true; } else if ( o == null ) { return true; } else { return false; } d378 1 a378 1 public static String[] getFiles( File directory, String includes ) d391 1 a391 1 public static String[] getFiles( File directory, String includes, String excludes ) d420 3 d424 1 a424 10 /** * Creates a new instance of BeanReader * * @@param clazz the class to register with the reader * @@return a {@@link BeanReader bean reader} * @@throws Exception when an error occurs trying to determine * properties of the class provided * @@throws Exception when anything goes wrong. FIXME this is bad */ public static BeanReader createBeanReader( Class clazz ) d427 2 a428 26 BeanReader beanReader = new BeanReader( getXMLReader() ); beanReader.setRules( new ExtendedBaseRules() ); beanReader.addRule( "*/properties/?", new MetaPropertiesRule() ); beanReader.setXMLIntrospector( getXMLIntrospector() ); beanReader.registerBeanClass( clazz ); return beanReader; } /** * If caching is enabled then this method will return a pooled introspector * * @@return XMLIntrospector used for processing the MavenSession xml-based POM. */ public static XMLIntrospector getXMLIntrospector() { if ( cacheIntrospector ) { if ( singletonIntrospector == null ) { singletonIntrospector = createXMLIntrospector(); } return singletonIntrospector; } return createXMLIntrospector(); d431 3 a433 49 /** * Create the type of XMLIntrospector that is used to read all MavenSession style * XML files. * * @@return Betwixt XMLIntrospector */ public static XMLIntrospector createXMLIntrospector() { XMLIntrospector introspector = new XMLIntrospector(); introspector.setAttributesForPrimitives( false ); introspector.setElementNameMapper( new DecapitalizeNameMapper() ); return introspector; } /** * Get the XMLReader to use for processing XML related resources. * * @@return an XMLReader which is pooled per thread * @@throws Exception If an error occurs while creating the XMLReader. */ public static XMLReader getXMLReader() throws Exception { XMLReader parser = (XMLReader) xmlReaderPool.get(); if ( parser == null ) { parser = createXMLReader(); xmlReaderPool.set( parser ); } return parser; } /** * Creates a new XMLReader instance * * @@return XMLReader used for parsing XML related maven resource. * @@throws Exception If an error occurs while creating the reader. */ private static XMLReader createXMLReader() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); return factory.newSAXParser().getXMLReader(); } a529 157 /** * Create a jelly context given a descriptor directory. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory ) { return createContext( descriptorDirectory, null ); } /** * Create a jelly context given a descriptor directory and parent * jelly context. * * @@param descriptorDirectory The directory from which to pull the standard maven * properties files from. * @@param parentContext The parent jelly context. * @@return The generated maven based on the contents of the standard maven * properties files. */ public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties Properties systemProperties = System.getProperties(); // User build properties File userBuildPropertiesFile = new File( System.getProperty( "user.home" ), "build.properties" ); logger.debug( "Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath() ); Properties userBuildProperties = loadProperties( userBuildPropertiesFile ); // project build properties File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug( "Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath() ); Properties projectBuildProperties = loadProperties( projectBuildPropertiesFile ); // project properties File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug( "Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath() ); Properties projectProperties = loadProperties( projectPropertiesFile ); Properties driverProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); Properties defaultProperties = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DEFAULTS_PROPERTIES ) ); Map result = MavenUtils.mergeMaps( new Map[] { systemProperties, userBuildProperties, projectBuildProperties, projectProperties, driverProperties } ); MavenJellyContext context; // If we have a parent we eventually want what values it can provide but // we turn inheritance off momentarily until we finish integrating the // child's context values into the jelly context because we want the // child values to win and only use the parent in the event the // child cannot provide the value. if ( parentContext != null ) { context = new MavenJellyContext( parentContext ); context.setInherit( false ); MavenUtils.integrateMapInContext( result, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); //add in the driver.properties with defaults, but in inheritance mode. MavenUtils.integrateMapInContext( defaultProperties, context ); } else { context = new MavenJellyContext(); //integrate everything else... MavenUtils.integrateMapInContext( result, context ); //integrate defaults... MavenUtils.integrateMapInContext( defaultProperties, context ); // Turn inheritance back on to make the parent's values visible. context.setInherit( true ); } // Set the basedir value in the context. context.setVariable( "basedir", descriptorDirectory.getPath() ); return context; } /** * Integrate a Map of key:value pairs into a MavenJellyContext. * The values in the Map may be CompositeExpressions that need * to be evaluated before being placed into the context. * * @@param map Map to integrate into the provided jelly context. * @@param context Jelly context to integrate the map into. */ public static void integrateMapInContext( Map map, MavenJellyContext context ) { if ( map == null ) { return; } JexlExpressionFactory factory = new JexlExpressionFactory(); for ( Iterator i = map.keySet().iterator(); i.hasNext(); ) { String key = (String) i.next(); Object value; if ( context.getVariable( key ) == null ) { String literalValue = (String) map.get( key ); try { Expression expr = CompositeExpression.parse( literalValue, factory ); if ( expr != null ) { value = expr; } else { value = literalValue; } context.setVariable( key, value ); } catch ( Exception e ) { // do nothing. } } } } d537 1 a537 1 private static Properties loadProperties( File file ) d557 1 a557 1 private static Properties loadProperties( InputStream is ) a584 47 } // ------------------------------------------------------------ // M E T A P R O P E R T I E S R U L E C L A S S // ------------------------------------------------------------ /** * A simple digester rule for populating an object in the POM * with meta properties. */ static class MetaPropertiesRule extends Rule { /** The body of the found property. */ private String value; /** * Constructor for the InfoRule object */ public MetaPropertiesRule() { } /** * Process the body of this element. * * @@param value body * @@throws Exception when any errors occur */ public void body(String namespace, String name, String text) throws Exception { this.value = text; } /** * Finish off this element. * * @@throws Exception when any errors occur */ public void end(String namespace, String elementName) throws Exception { BaseObject baseObject = (BaseObject) getDigester().peek(); String name = getDigester().getCurrentElementName(); baseObject.addProperty( name + ":" + value ); } @ 1.94.2.1 log @Update from back ported fixes @ text @d6 1 a6 1 * Copyright (c) 2002-2003 The Apache Software Foundation. All rights d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.94.2.2 log @Start of MAVEN-536 @ text @d59 1 d82 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d250 16 @ 1.94.2.3 log @Fix typo @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 * @@return the Maven project object for the given project descriptor @ 1.94.2.4 log @PR: MAVEN-522 clarification of POM elements that use paths. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a212 1 pomToExtend = MavenUtils.makeAbsolutePath( projectDescriptor.getParentFile(), pomToExtend ); d571 1 a571 1 private static XMLIntrospector createXMLIntrospector() d948 1 a948 3 * @@param namespace the namespace * @@param name the tag name * @@param text the body text a1029 39 } /** * Resolve directory against a base directory if it is not already absolute. * @@param basedir the base directory for relative paths * @@param dir the directory to resolve * @@throws IOException if canonical path fails */ public static String makeAbsolutePath( File basedir, String dir ) throws IOException { if ( new File( dir ).isAbsolute() == false ) { return new File( basedir, dir ).getCanonicalPath(); } return dir; } /** * Convert an absolute path to a relative path if it is under a given base directory. * @@param basedir the base directory for relative paths * @@param path the directory to resolve * @@throws IOException if canonical path fails */ public static String makeRelativePath( File basedir, String path ) throws IOException { String canonicalBasedir = basedir.getCanonicalPath(); String canonicalPath = new File( path ).getCanonicalPath(); if ( canonicalPath.startsWith( canonicalBasedir ) ) { if ( canonicalPath.charAt( canonicalBasedir.length() ) == File.separatorChar ) { canonicalPath = canonicalPath.substring( canonicalBasedir.length() + 1 ); } else { canonicalPath = canonicalPath.substring( canonicalBasedir.length() ); } } return canonicalPath; @ 1.93 log @Apache MavenSession -> Apache Maven @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d782 4 d807 8 a818 1 } d820 1 d823 3 d828 2 @ 1.92 log @Fix encoding problem. Use of non-English characters in project descriptor was impossible because POM interpolation lost encoding. @ text @d29 1 a29 1 * "Apache MavenSession" must not be used to endorse or promote products d34 1 a34 1 * "Apache MavenSession", nor may "Apache" appear in their name, without d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.91 log @Remove deprecated digester and betwixt methods @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d362 1 a362 1 Writer writer = new BufferedWriter( new OutputStreamWriter( baos ) ); @ 1.90 log @o Correct author - add mailto: @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a593 1 introspector.setCachingEnabled( true ); d952 1 a952 1 public void body( String value ) d955 1 a955 1 this.value = value; d963 1 a963 1 public void end() @ 1.89 log @Remove unused code @ text @d113 2 a114 3 * @@author Jason van Zyl * * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.88 log @o Removed the 'file' @@param from HttpUtils. The only thing is was being used for was to display error messages. We were also passing in the actual destinationFile so we can simply getName() to display error messages. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a142 1 private static HashMap poms = new HashMap(); @ 1.87 log @o The child will now inherit a parent's dependencies. o Quick check for ForeheadClassLoader as test don't like it. This will be moved when classworlds goes in. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d403 1 @ 1.86 log @o Adding some caching of parent POMs o Preparing for classworlds. @ text @d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d146 1 a146 1 /** d215 1 a215 1 Expression e = JellyUtils.decomposeExpression( pomToExtend , mavenExpressionFactory, context); d218 1 a218 1 File parentPom = new File ( pomToExtend ); d233 4 d254 1 a254 1 ForeheadClassLoader cl = (ForeheadClassLoader) project.getContext().getClassLoader(); d256 1 a256 1 for ( Iterator i = project.getArtifacts().iterator(); i.hasNext();) d258 5 a262 2 Artifact artifact = (Artifact) i.next(); cl.addURL( artifact.getFile().toURL() ); d356 1 a356 1 project.setContext( null) ; d730 1 a730 1 /** d989 1 a989 1 catch( MissingResourceException e ) d1009 1 a1009 1 /** @ 1.85 log @o removing unused constant o allow POMs to be read in while optionally ignoring the parent POM. @ text @d59 1 a59 23 import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; import java.util.Properties; import java.util.ResourceBundle; import java.util.Set; import javax.xml.parsers.SAXParserFactory; d78 1 a79 1 import org.apache.maven.jelly.MavenExpressionFactory; d82 1 d87 22 d115 1 a115 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 4 d192 3 a194 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext, boolean useParentPom ) d197 2 d217 15 a231 1 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d248 13 @ 1.84 log @o Changing the place of the previous 2) and 3) to allow for interpolation in the element. And this was done so that we can start encouraging the use of ${basedir} when extending POMs in the file system. This is what will be documented in the examples. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d154 6 d187 1 a187 1 public static Project getProject( File projectDescriptor, MavenJellyContext parentContext ) d200 1 a200 1 if ( pomToExtend != null ) a207 1 @ 1.83 log @Reorder imports @ text @d101 1 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d138 3 d163 5 a167 1 * 2) We check to see if the tag is being employed. If so, the parent a171 5 * * 3) The context for the project is created and set. So each project manages its * own context. See the createContext() method for the details context creation * process. * d189 3 d193 1 d196 7 a205 4 // 3) MavenJellyContext context = MavenUtils.createContext( projectDescriptor.getParentFile(), parentContext ); @ 1.82 log @Cleanup @ text @d59 23 d86 1 a87 1 import org.apache.commons.collections.BeanMap; a106 22 import javax.xml.parsers.SAXParserFactory; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.StringReader; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.81 log @o cleaned up and tried to fully explain two of the most obscure operations in maven: the creation of project object and the use of jelly to do interpolation. @ text @a79 1 import org.apache.maven.project.Resource; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.80 log @refactoring @ text @d80 1 d113 1 a113 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 22 a172 1 * Create a Project object given a file descriptor. d181 1 d185 1 d193 1 a193 3 project = getJellyProject( project ); project.setFile( projectDescriptor ); d197 3 d201 6 a206 1 project.setContext( context ); d215 42 d275 2 a276 1 * Process the project descriptor using Jelly itself. d285 8 d294 1 d296 3 a298 2 context.setVariable( MavenConstants.MAVEN_POM, project ); d303 2 d311 6 a316 1 BeanReader projectBeanReader = getProjectBeanReader(); d318 1 a318 2 return (Project) projectBeanReader.parse( new StringReader( baos.toString() ) ); a350 1 a484 40 /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes the pattern that matches a project * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, MavenJellyContext context ) throws Exception { return getProjects( directory, includes, null, context ); } /** * This is currently used for the reactor but may be generally useful. * * @@param directory the directory to scan for maven projects * @@param includes Patterns to include. * @@param excludes Patterns to exclude. * @@return a {link List} of {@@link Project}s * @@throws Exception when anything goes wrong. FIXME this is bad */ public static List getProjects( File directory, String includes, String excludes, MavenJellyContext context ) throws Exception { String[] files = getFiles( directory, includes, excludes ); List projects = new ArrayList(); for ( int i = 0; i < files.length; i++ ) { projects.add( getProject( new File( files[i] ), context ) ); } return projects; } d755 1 a755 1 // Turn inheritance back on to make the parent's values visible; d757 3 @ 1.79 log @Used IDEAJ's optimize imports thingy to clean up the import statements - this time only with single-type-imports @ text @d29 1 a29 1 * "Apache Maven" must not be used to endorse or promote products d34 1 a34 1 * "Apache Maven", nor may "Apache" appear in their name, without d63 1 a64 1 import org.apache.commons.collections.CollectionUtils; a98 1 import java.util.Locale; a99 1 import java.util.MissingResourceException; d101 1 d103 2 a104 1 import java.util.Set; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d136 1 a136 1 /** d140 1 a140 1 * @@return the Maven project object for the given project descriptor d146 1 a146 1 return getProject( projectDescriptor, new File( "." ) ); d153 1 a153 2 * @@param dir the base directory to find related files * @@return the Maven project object for the given project descriptor d156 1 a156 1 public static Project getProject( File projectDescriptor, File dir ) d165 1 a165 3 Project parent = (Project) projectBeanReader.parse( new File( dir, pomToExtend ) ); d172 9 d246 1 a246 1 * @@param project Maven project to turn into an XML representation. d405 1 a405 1 public static List getProjects( File directory, String includes ) d408 1 a408 1 return getProjects( directory, includes, null ); d420 4 a423 1 public static List getProjects( File directory, String includes, String excludes ) d432 1 a432 2 projects.add( getProject( new File( files[i] ), new File( files[i] ).getParentFile() ) ); d463 1 a463 1 * @@return XMLIntrospector used for processing the Maven xml-based POM. d479 1 a479 1 * Create the type of XMLIntrospector that is used to read all Maven style d490 1 a490 1 introspector.setNameMapper( new DecapitalizeNameMapper() ); a673 1 // driver properties d689 6 d698 1 a698 1 context.setInherit( true ); d707 3 d869 1 a869 1 * Load Maven user messages from a resource bundle given the @ 1.78 log @Used IDEAJ's optimize imports thingy to clean up the import statements @ text @d94 11 a104 1 import java.util.*; d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.77 log @o Adding excludes capabilities. @ text @d63 1 a64 1 import org.apache.commons.collections.BeanMap; d94 1 a94 11 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Locale; d102 1 a102 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.76 log @o Maven will now execute when a project.xml file is not present, or more accurately when the maven bean has not been handed a live project instance. We can now create plugins that generate various maven projects. PR: Obtained from: Submitted by: Reviewed by: @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d345 2 a346 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d349 1 a349 1 public static String[] getFiles( String directory, String includes ) d351 1 a351 1 return getFiles( new File( directory ), includes ); d357 3 a359 2 * @@param directory Directory to scan * @@param includes Comma separated list of includes d362 1 a362 1 public static String[] getFiles( File directory, String includes ) d369 7 d379 1 d402 16 a417 1 String[] files = getFiles( directory, includes ); d851 1 a851 1 d859 1 a859 1 try d863 2 a864 2 } catch( MissingResourceException e ) @ 1.75 log @o Patch for MAVEN-172. @ text @d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d831 1 @ 1.74 log @o Turning on the use of localized messages sets using resource bundles. @ text @d103 1 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d827 5 a831 1 d834 6 a839 6 // Look for the message bundle corresponding to the user's locale. messages = ResourceBundle.getBundle( "org/apache/maven/messages/messages" ); // If we can't find the appropriate message bundle for the locale then // we will fall back to English. if ( messages == null ) d841 2 a845 1 a882 1 @ 1.73 log @o adding really simple localized messaging and just defaulting to english right now. @ text @d102 2 d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d824 2 a825 1 private static Properties messages; d829 11 a839 3 messages = loadProperties( MavenUtils.class.getClassLoader().getResourceAsStream( "org/apache/maven/messages/messages.en" ) ); d869 1 a869 1 return messages.getProperty( messageId ); d873 1 a873 1 return StringUtils.replace( messages.getProperty( messageId ), @ 1.72 log @o adding todo @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d820 47 @ 1.71 log @Remove Piccolo specific code @ text @d109 3 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.70 log @refactoring @ text @a58 1 import com.bluecast.xml.JAXPSAXParserFactory; d485 1 a485 1 SAXParserFactory factory = new JAXPSAXParserFactory(); @ 1.69 log @o more checkstyle fixes. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d588 13 d602 2 a603 1 * Process properties in dominant order. d607 1 d611 2 a612 1 public static MavenJellyContext createContext( File descriptorDirectory ) d652 12 a663 1 MavenJellyContext context = new MavenJellyContext(); @ 1.68 log @Trying out IDEA cvs integration. @ text @d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 1 private final static String INTERNAL_ENCODING = "ISO-8859-1"; d121 1 a121 1 private final static ThreadLocal xmlReaderPool = new ThreadLocal(); a195 1 * @@param parentContext a context to resolve variables d407 1 a407 1 * @@throws IntrospectionException when an error occurs trying to determine d426 2 d460 2 d463 1 d479 3 d508 3 a510 3 * @@param dominantMap * @@param recessiveMap * @@return Map d590 5 a597 2 System.out.println( "descriptorDirectory: " + descriptorDirectory ); d647 2 a648 2 * @@param map * @@param context d693 3 d713 3 d758 1 @ 1.67 log @*** empty log message *** @ text @d109 2 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.66 log @o fixing the imports again after setting up IDEA correctly. Unused imports should now be nuked. @ text @d65 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.65 log @o optimizing imports using my new IDEA toy :-) @ text @a90 1 import java.io.InputStreamReader; a101 1 import java.util.StringTokenizer; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 1 a118 4 /** * A thread pool to avoid the startup overhead of the XML parser each time * we want to parse something */ d138 1 a138 1 throws Exception d152 1 a152 1 throws Exception d161 1 a161 1 projectBeanReader.parse( new File( dir, pomToExtend ) ); d180 1 a180 1 throws Exception d199 1 a199 1 throws Exception d218 1 a218 1 new StringReader( baos.toString() ) ); d227 1 a227 1 throws Exception d240 1 a240 1 throws Exception d307 1 a307 1 || o instanceof Class || o instanceof Integer ) d386 1 a386 1 throws Exception d411 1 a411 1 throws Exception d460 1 a460 1 throws Exception d475 1 a475 1 throws Exception d530 2 a531 2 CollectionUtils.subtract( recessiveMapKeys, CollectionUtils.intersection( dominantMapKeys, recessiveMapKeys ) ); d591 1 a591 1 new File( System.getProperty( "user.home" ), "build.properties" ); d598 1 a598 1 new File( descriptorDirectory, "build.properties" ); d605 1 a605 1 new File( descriptorDirectory, "project.properties" ); d612 2 a613 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES ) ); d738 1 a738 1 extends Rule d756 1 a756 1 throws Exception d767 1 a767 1 throws Exception @ 1.64 log @refactoring @ text @d58 1 d60 23 d84 1 d89 1 a91 1 import java.io.IOException; a94 1 d97 1 a100 1 import java.util.HashMap; a104 35 import javax.xml.parsers.SAXParserFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections.BeanMap; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.betwixt.io.BeanReader; import org.apache.commons.betwixt.io.BeanWriter; import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.MavenConstants; import org.apache.maven.project.BaseObject; import org.apache.maven.project.Project; import org.apache.tools.ant.DirectoryScanner; import org.apache.maven.jelly.MavenJellyContext; import org.apache.maven.jelly.JellyUtils; import org.apache.maven.util.StringInputStream; import org.xml.sax.XMLReader; import org.apache.commons.digester.ExtendedBaseRules; import org.apache.commons.digester.Rule; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.expression.CompositeExpression; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; d110 1 a110 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d115 2 a116 2 private static final Log logger = LogFactory.getLog(MavenUtils.class); d142 2 a143 2 public static Project getProject(File projectDescriptor) throws Exception d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d156 2 a157 2 public static Project getProject(File projectDescriptor, File dir) throws Exception d160 1 a160 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d163 1 a163 1 if (pomToExtend != null) d166 1 a166 1 projectBeanReader.parse(new File(dir, pomToExtend)); d168 1 a168 1 project = (Project) mergeBeans(project, parent); d171 2 a172 2 project = getJellyProject(project); project.setFile(projectDescriptor); d185 1 a185 1 throws Exception d187 1 a187 1 if (projectBeanReader == null) d189 1 a189 1 projectBeanReader = createBeanReader(Project.class); d203 2 a204 2 private static Project getJellyProject(Project project) throws Exception d208 1 a208 1 context.setVariable(MavenConstants.MAVEN_POM, project); d210 3 a212 3 Script script = JellyUtils.compileScript(getProjectInputStream(project), context, INTERNAL_ENCODING); d215 3 a217 3 Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLOutput output = XMLOutput.createXMLOutput(writer); script.run(context, output); d223 1 a223 1 new StringReader(baos.toString())); d231 2 a232 2 public static InputStream getProjectInputStream(Project project) throws Exception d234 1 a234 1 return new StringInputStream(getProjectString(project)); d244 2 a245 2 public static String getProjectString(Project project) throws Exception d248 4 a251 4 BeanWriter beanWriter = new BeanWriter(projectStream); beanWriter.setXMLIntrospector(createXMLIntrospector()); beanWriter.setWriteIDs(true); beanWriter.write(project); d257 1 a257 1 return projectStream.toString(INTERNAL_ENCODING); d267 1 a267 1 private static Object mergeBeans(Object child, Object parent) d269 2 a270 2 BeanMap parentBeanMap = new BeanMap(parent); BeanMap childBeanMap = new BeanMap(child); d272 1 a272 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext(); ) d282 2 a283 2 Object c = childBeanMap.get(property); Object p = parentBeanMap.get(property); d285 1 a285 1 if (valueNeedsPopulating(c)) d287 1 a287 1 childBeanMap.put(property, p); d289 1 a289 1 else if (c != null && p != null && !valuePrimitive(c)) d291 2 a292 2 Object mergedBean = mergeBeans(c, p); childBeanMap.put(property, mergedBean); d295 1 a295 1 catch (IllegalArgumentException e) d309 1 a309 1 private static boolean valuePrimitive(Object o) d311 2 a312 2 if (o instanceof Boolean || o instanceof String || o instanceof Class || o instanceof Integer) d326 1 a326 1 private static boolean valueNeedsPopulating(Object o) d328 1 a328 1 if (o instanceof Collection && ((Collection) o).size() == 0) d332 1 a332 1 else if (o == null) d349 1 a349 1 public static String[] getFiles(String directory, String includes) d351 1 a351 1 return getFiles(new File(directory), includes); d361 1 a361 1 public static String[] getFiles(File directory, String includes) d364 1 a364 1 if (includes != null) d366 1 a366 1 includePatterns = StringUtils.split(includes, ","); d369 2 a370 2 directoryScanner.setBasedir(directory); directoryScanner.setIncludes(includePatterns); d374 1 a374 1 for (int i = 0; i < files.length; i++) d376 1 a376 1 files[i] = new File(directory, files[i]).getAbsolutePath(); d390 2 a391 2 public static List getProjects(File directory, String includes) throws Exception d393 1 a393 1 String[] files = getFiles(directory, includes); d397 1 a397 1 for (int i = 0; i < files.length; i++) d399 1 a399 1 projects.add( getProject( new File( files[i] ), d415 2 a416 2 public static BeanReader createBeanReader(Class clazz) throws Exception d418 3 a420 3 BeanReader beanReader = new BeanReader(getXMLReader()); beanReader.setRules(new ExtendedBaseRules()); beanReader.addRule("*/properties/?", new MetaPropertiesRule()); d422 2 a423 2 beanReader.setXMLIntrospector(getXMLIntrospector()); beanReader.registerBeanClass(clazz); d433 1 a433 1 if (cacheIntrospector) d435 1 a435 1 if (singletonIntrospector == null) d454 3 a456 3 introspector.setAttributesForPrimitives(false); introspector.setCachingEnabled(true); introspector.setNameMapper(new DecapitalizeNameMapper()); d465 1 a465 1 throws Exception d468 1 a468 1 if (parser == null) d471 1 a471 1 xmlReaderPool.set(parser); d480 1 a480 1 throws Exception d484 1 a484 1 factory.setNamespaceAware(true); d493 1 a493 1 * d496 1 a496 1 * d508 1 a508 1 public static Map mergeMaps(Map dominantMap, Map recessiveMap) d511 2 a512 2 if (dominantMap == null && recessiveMap == null) d516 2 a517 2 if (dominantMap != null && recessiveMap == null) d520 3 a522 3 } if (dominantMap == null && recessiveMap != null) d525 2 a526 2 } d530 1 a530 1 d534 6 a539 6 Collection contributingRecessiveKeys = CollectionUtils.subtract(recessiveMapKeys, CollectionUtils.intersection(dominantMapKeys, recessiveMapKeys)); result.putAll(dominantMap); d542 1 a542 1 for (Iterator i = contributingRecessiveKeys.iterator(); i.hasNext();) d545 1 a545 1 result.put(key, recessiveMap.get(key)); d547 1 a547 1 d550 1 a550 1 d559 1 a559 1 public static Map mergeMaps(Map[] maps) d562 2 a563 2 if (maps.length == 0) d567 1 a567 1 else if (maps.length == 1) d573 3 a575 3 result = mergeMaps(maps[0], maps[1]); for (int i = 2; i < maps.length; i++) d577 1 a577 1 result = mergeMaps(result, maps[i]); d580 1 a580 1 d583 1 a583 1 d587 1 a587 1 public static MavenJellyContext createContext(File descriptorDirectory) d589 2 a590 2 System.out.println("descriptorDirectory: " + descriptorDirectory); d593 1 a593 1 d595 4 a598 4 File userBuildPropertiesFile = new File( System.getProperty("user.home"), "build.properties" ); logger.debug("Using userBuildPropertiesFile: " + userBuildPropertiesFile.getAbsolutePath()); d600 1 a600 1 d602 4 a605 4 File projectBuildPropertiesFile = new File( descriptorDirectory, "build.properties" ); logger.debug("Using projectBuildPropertiesFile: " + projectBuildPropertiesFile.getAbsolutePath()); d607 1 a607 1 d609 4 a612 4 File projectPropertiesFile = new File( descriptorDirectory, "project.properties" ); logger.debug("Using projectPropertiesFile: " + projectPropertiesFile.getAbsolutePath()); d614 1 a614 1 d617 2 a618 2 MavenUtils.class.getClassLoader().getResourceAsStream( MavenConstants.DRIVER_PROPERTIES)); d627 2 a628 2 }); d630 2 a631 2 MavenUtils.integrateMapInContext(result, context); d643 1 a643 1 public static void integrateMapInContext(Map map, MavenJellyContext context) d645 1 a645 1 if (map == null) d652 1 a652 1 for (Iterator i = map.keySet().iterator(); i.hasNext();) d656 2 a657 2 if (context.getVariable(key) == null) d659 2 a660 2 String literalValue = (String) map.get(key); d663 1 a663 1 Expression expr = CompositeExpression.parse(literalValue, factory); d665 1 a665 1 if (expr != null) d674 1 a674 1 context.setVariable(key, value); d676 1 a676 1 catch (Exception e) d687 1 a687 1 private static Properties loadProperties(File file) d691 1 a691 1 return loadProperties(new FileInputStream(file)); d693 1 a693 1 catch(Exception e) d697 1 a697 1 d704 1 a704 1 private static Properties loadProperties(InputStream is) d709 1 a709 1 properties.load(is); d712 1 a712 1 catch (IOException e) d720 1 a720 1 if (is != null) d725 1 a725 1 catch (IOException e) d730 1 a730 1 d743 1 a743 1 extends Rule d750 2 a751 2 public MetaPropertiesRule() { d760 2 a761 2 public void body(String value) throws Exception d772 1 a772 1 throws Exception d776 1 a776 1 baseObject.addProperty(name + ":" + value); @ 1.63 log @o Adding new method to merge a Map with a MavenJellyContext. @ text @d66 1 d76 2 d91 2 d101 1 a102 1 import org.apache.maven.util.JellyUtils; d121 1 a121 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d125 3 d410 2 a411 2 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d521 17 d549 2 d556 1 a556 1 dominantMap.put(key, recessiveMap.get(key)); d559 1 a559 1 return dominantMap; d596 51 d671 1 a671 1 d693 50 @ 1.62 log @o Moving all the constants to MavenConstants o Adding CLI constants to App.java. Need to unify App.java and CLIManager.java @ text @d94 2 a98 4 import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; d104 7 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d566 49 @ 1.61 log @o Adding a javadoc blurb. @ text @d89 1 a89 1 import org.apache.maven.jelly.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d206 1 a206 1 context.setVariable(MavenJellyContext.MAVEN_POM, project); @ 1.60 log @o Adding another Map merging method which takes an array of Maps. o Put in the functionality to merge all the required properties from the CLI wrapper and create a context from the resultant values but not activated yet. More testing first. @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d529 9 a537 1 @ 1.59 log @o Breaking apart the app package and trying to put some of the classes into more appropriate places. PR: Obtained from: Submitted by: Reviewed by: @ text @d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d486 1 a486 1 d528 25 @ 1.58 log @o Merged MetaProperties into MavenUtils as an inner class. o Added mergeMaps which will be used for properties inheritance. o Remove context inheritance for the moment as I'm going to rework it. @ text @d89 1 a89 1 import org.apache.maven.app.MavenJellyContext; d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.57 log @o another constant @ text @a57 1 d74 2 d82 1 d90 1 d101 2 d104 1 a104 2 import org.xml.sax.XMLReader; d107 2 a108 2 * Utilities for reading maven project descriptors, profile descriptors * and workspace descriptors. d111 1 a111 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d119 2 a120 2 * A thread pool to avoid the startup overhead of the XML parser each * time we want to parse something d122 1 a122 1 private static final ThreadLocal xmlReaderPool = new ThreadLocal(); d143 1 a143 27 return getProject(projectDescriptor, new File("."), null); } /** * @@return the POM from the given file in the current directory, using the * given context as the parent context * @@param projectDescriptor the file to read the POM from * @@param parentContext a context to resolve variables * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception { return getProject(projectDescriptor, new File("."), parentContext); } /** * @@return the POM from the given file in the given directory, with no * parent context * @@param projectDescriptor the file to read the POM from * @@param dir the base directory to find related files * @@throws Exception when anything goes wrong. FIXME this is bad */ public static Project getProject(File projectDescriptor, File dir) throws Exception { return getProject(projectDescriptor, dir, null); a150 1 * @@param parentContext a context to resolve variables d154 1 a154 3 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) d164 1 a164 1 projectBeanReader.parse( new File(dir, pomToExtend ) ); d169 1 a169 1 project = getJellyProject(project, parentContext); d176 2 a177 2 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. d201 1 a201 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d204 1 a204 1 JellyContext context = null; a205 10 if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } d209 2 a210 2 context, INTERNAL_ENCODING); d263 1 a263 1 * @@return the child after properties from the parent are merged d270 1 a270 1 for (Iterator i = parentBeanMap.keySet().iterator(); i.hasNext();) d303 1 d318 2 a319 3 * Check a child value to see if it needs populating with * the parent value. The constructor sets List values to [] * so we have to check those. d381 1 a381 2 * This is currently used for the reactor but may be * generally useful. a441 1 d443 2 a444 2 * Create the type of XMLIntrospector that is used to read * all Maven style XML files. d462 2 a463 1 public static XMLReader getXMLReader() throws Exception a473 1 d477 2 a478 1 private static XMLReader createXMLReader() throws Exception d482 1 a482 1 factory.setNamespaceAware( true ); d485 89 @ 1.56 log @o Removing workspace and profile notions from Maven proper. We'll leave that to wrapping applications like Continuum and the like. @ text @d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d120 1 a120 3 /** * Should we cache and reuse the introspector */ d123 1 a123 3 /** * The singleton introspector if caching is enabled */ a141 8 /* project.xml [ISO-8859-1] | v */ a187 32 if (pomToExtend.startsWith("template:")) { JellyContext context = null; if (parentContext != null) { context = new JellyContext(parentContext); context.setInherit(true); } else { context = new JellyContext(); } String mavenHome = (String) context.findVariable(parentContext.MAVEN_HOME); StringTokenizer st = new StringTokenizer(pomToExtend, ":"); st.nextToken(); pomToExtend = mavenHome + "/templates/" + st.nextToken() + "/project.xml"; } // Project parent; // try // { // parent = (Project) projectBeanReader.parse( // new File(pomToExtend)); // } // catch (Exception e) // { // parent = (Project) projectBeanReader.parse( // new File(dir, pomToExtend)); // } a291 18 } /** * Merge a child and parent Project object. * * I would like to use BeanUtils but it doesn't quite work the * way I need. So I will patch it later. * * @@param child child object * @@param parent the maven project * @@return the child after project properties have been copied * @@throws Exception when anything goes wrong. FIXME this is bad */ private static Object mergeBeansX(Object child, Object parent) throws Exception { BeanUtils.copyProperties(child, parent); return child; @ 1.55 log @o Cleanup, use constants. Preparing for another pass. @ text @a88 2 import org.apache.maven.project.Profile; import org.apache.maven.project.Workspace; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a435 95 } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor A reactor profile * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(String profileDescriptor) throws Exception { return getProfile(new File(profileDescriptor)); } /** * Create a Profile object given a file descriptor. * * @@param profileDescriptor a maven profile descriptor * @@return the Maven profile object for the given profile descriptor * @@throws Exception when any errors occur */ public static Profile getProfile(File profileDescriptor) throws Exception { BeanReader reader = createBeanReader(Profile.class); Profile profile = (Profile) reader.parse( new FileInputStream(profileDescriptor)); return profile; } /** * Create a Workspace object given a workspace and profile descriptor. * * @@param workspaceDescriptor the file name of a maven workspace descriptor * @@param profileDescriptor the file name of a maven project descriptor * @@param mavenLocalRepo a local maven repository * @@return a maven {@@link Workspace} specifed by the given descriptors * @@throws Exception when any error occurs */ public static Workspace getWorkspace(String workspaceDescriptor, String profileDescriptor, String mavenLocalRepo) throws Exception { return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); } /** * Create a {@@link Workspace} object given a workspace * descriptor, a project descriptor and a local repository. * * @@param workspaceDescriptor the xml file describing the workspace * @@param profileDescriptor the xml file describing the projects to build * @@param mavenLocalRepo the local maven repository * @@return a {@@link Workspace} object ready for building * @@throws Exception when an error occurs */ public static Workspace getWorkspace(File workspaceDescriptor, File profileDescriptor, File mavenLocalRepo) throws Exception { // Create our workspace. BeanReader workspaceReader = createBeanReader(Workspace.class); Workspace workspace = (Workspace) workspaceReader.parse( new FileInputStream(workspaceDescriptor)); // Create our profile. Profile profile = getProfile(profileDescriptor); // Set the workspace profile. workspace.setProfile(profile); // Create our set of project. for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) { String projectId = (String) i.next(); // This should take care of any trailing slashes, or the directory // formatted in any arbitrary fashion. I don't want to expect a // particular format because people do everything different. File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); File projectDescriptor = new File(baseDir, "project.xml"); // Map the project descriptors and add them to the profile. Project project = getProject(projectDescriptor); profile.addProject(project); } return workspace; @ 1.54 log @Fix project extends not working. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d287 2 a288 1 context.setVariable("pom", project); @ 1.53 log @Comment out and restore old code for changes which broke bootstrap. Should work again now. @ text @d60 1 a60 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 2 a117 2 /** * A thread pool to avoid the startup overhead of the XML parser each d124 2 a125 2 */ private static boolean cacheIntrospector = true; d131 1 a131 1 d149 1 a149 1 d153 1 a153 1 d163 1 a163 1 public static Project getProject(File projectDescriptor, d168 1 a168 1 d191 1 a191 1 public static Project getProject(File projectDescriptor, d193 1 a193 1 MavenJellyContext parentContext) d205 1 a205 1 d233 4 a236 4 Project parent = (Project) projectBeanReader.parse( new File( pomToExtend ) ); d239 1 a239 1 d242 1 a242 1 d249 1 a249 1 * d259 2 a260 2 } d272 2 a273 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) d277 1 a277 1 d288 2 a289 2 Script script = JellyUtils.compileScript(getProjectInputStream(project), d292 1 a292 1 d298 1 a298 1 d300 1 a300 1 d304 1 a304 1 d331 1 a331 1 d335 1 a335 1 d344 1 a344 1 * d359 1 a359 1 * d368 1 a368 1 d376 1 a376 1 { d381 1 a381 1 d399 1 a399 1 d407 1 a407 1 if (o instanceof Boolean || o instanceof String d414 1 a414 1 d419 1 a419 1 * d436 1 a436 1 } d465 1 a465 1 d507 1 a507 1 d510 1 a510 1 d513 1 a513 1 d521 1 a521 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d527 1 a527 1 d573 1 a573 1 d577 1 a577 1 * d587 1 a587 1 d589 1 a589 1 d592 1 a592 1 projects.add(getProject(new File(files[i]), d595 1 a595 1 d599 2 a600 2 /** * Creates a new instance of BeanReader d608 1 a608 1 public static BeanReader createBeanReader(Class clazz) d614 1 a614 1 d617 1 a617 1 d620 1 a620 1 d623 1 a623 1 */ d626 1 a626 1 if (cacheIntrospector) d628 1 a628 1 if (singletonIntrospector == null) d636 1 a636 1 d651 1 a651 1 d658 1 a658 1 public static XMLReader getXMLReader() throws Exception d673 1 a673 1 private static XMLReader createXMLReader() throws Exception @ 1.52 log @Added the ability to use project templates, via the "extend" tag. Templates are found under ${maven.home}/templates/${template-id}/project.xml. To use this feature, "extend" your project with "template:${template-id}". When using the "extend" tag, a distributed project won't be able to extend another project if the directory layouts are different on both systems. Using templates, you can move around your projects in your system, and Maven will find its way to the parent project. @ text @d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d222 14 a235 11 Project parent; try { parent = (Project) projectBeanReader.parse( new File(pomToExtend)); } catch (Exception e) { parent = (Project) projectBeanReader.parse( new File(dir, pomToExtend)); } @ 1.51 log @Add support for extend properties where a project extend to an another project @ text @d75 1 d109 1 a109 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 20 @ 1.50 log @We can use absolute paths for extended projects @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d201 11 a211 2 Project parent = (Project) projectBeanReader.parse( new File(pomToExtend)); @ 1.49 log @Remove unused code @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d202 1 a202 1 new File(dir,pomToExtend)); @ 1.48 log @o Trying to localize the compilation of jelly scripts to the JellyUtils class. o Move JellyUtils class to the org.apache.maven.util package. o Added the ability to deal with different encodings and InputStreams w.r.t the compilation of Jelly scripts. PR: Obtained from: Submitted by: Reviewed by: @ text @d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a578 1 ExtendedBaseRules ebr = new ExtendedBaseRules(); @ 1.47 log @Patch to cache the XML parser used by Betwixt and to cache the XMLIntrospector to boost performance a bit. Speeds up by 1 or 2 seconds on my machine. Though still more work to do... @ text @d93 1 a94 4 // Jelly goodies. import org.apache.commons.jelly.Jelly; a97 1 import org.apache.commons.jelly.parser.XMLParser; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d112 3 d147 8 d190 4 a193 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d201 3 a203 2 Project parent = (Project) projectBeanReader.parse(new File(dir, pomToExtend)); d212 19 a230 1 d240 2 a241 1 MavenJellyContext parentContext) throws Exception a254 2 XMLParser parser = new XMLParser(); parser.setContext(context); d256 3 a258 5 // Jelly jelly = new Jelly(); Script script = parser.parse(new InputStreamReader( getProjectInputStream(project))); script = script.compile(); d273 2 a274 4 * Create a project bean reader. We use it more than once so we don't * want to create it more than once. * * @@return a {@@link BeanReader} capable of reading {@@link Project projects} d277 1 a277 1 private static BeanReader getProjectBeanReader() d280 1 a280 6 if (projectBeanReader == null) { projectBeanReader = createBeanReader(Project.class); } return projectBeanReader; d282 1 a282 1 d299 5 a303 12 return projectStream.toString(); } /** * @@return an {@@link InputStream} for the given project * @@param project a {@@link Project maven project} * @@throws Exception when anything goes wrong. FIXME this is bad */ public static InputStream getProjectInputStream(Project project) throws Exception { return new StringInputStream(getProjectString(project)); a615 1 // set elements for attributes to true a617 5 // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case @ 1.46 log @- Rearrange code to allow easier understanding - remove unused object - cache xml bean infos @ text @d58 2 d76 2 d94 1 d105 2 d112 1 a112 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d116 5 d122 10 d567 1 a567 1 BeanReader beanReader = new BeanReader(); d571 2 a572 1 beanReader.setXMLIntrospector(createXMLIntrospector()); d577 17 d616 27 @ 1.45 log @Removed log as it wasn't being used @ text @d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a191 5 ByteArrayOutputStream baos = new ByteArrayOutputStream(); Jelly jelly = new Jelly(); Writer writer = new BufferedWriter(new OutputStreamWriter(baos)); XMLParser parser = new XMLParser(); a202 1 d204 1 d207 1 d213 2 d567 1 @ 1.44 log @Checkstyle violations @ text @a97 3 import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; d105 1 a105 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.43 log @o Refactoring of the core to try and encapsulate everything to do with Maven in Maven.java and simply using the App.java as a CLI harness. o Fixed ProjectVerifier which was causing the grief today. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 2 a59 1 a62 1 import java.io.FileOutputStream; d65 1 a65 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; d67 1 a70 1 import java.util.HashMap; a72 1 import java.util.Map; a85 1 import org.apache.maven.project.Dependency; a90 8 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; d108 1 a108 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a111 2 /** Log. */ private static final Log log = LogFactory.getLog(MavenUtils.class); d129 9 a137 2 public static Project getProject(File projectDescriptor, MavenJellyContext parentContext) throws Exception d141 8 a148 1 d159 2 d164 2 a165 2 public static Project getProject(File projectDescriptor, File dir, MavenJellyContext parentContext) throws Exception d173 2 a174 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d187 2 a188 1 * @@param project d190 1 d192 2 a193 2 private static Project getJellyProject(Project project, MavenJellyContext parentContext) throws Exception d216 2 a217 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d226 2 a227 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d233 3 d253 1 d267 5 d283 5 d298 4 d339 5 a343 1 /** Hack-a-roo */ d346 5 a350 5 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d358 3 d364 1 a364 1 if (o instanceof Collection && ((Collection)o).size() == 0) d516 5 d531 2 a532 1 projects.add(getProject(new File(files[i]), new File(files[i]).getParentFile())); d545 1 @ 1.42 log @make checkstyle happy @ text @d62 1 d65 2 d71 1 d74 1 d84 1 d88 1 d95 3 d100 2 d130 1 a130 1 * Create a Project object given a name of a file. d136 1 a136 1 public static Project getProject(String projectDescriptor) d139 1 a139 1 return getProject(new File(projectDescriptor), new File(".")); d141 2 a142 9 /** * Create a Project object given a name a file descriptor. * * @@param projectDescriptor a maven project.xml * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(File projectDescriptor) d145 1 a145 1 return getProject(projectDescriptor, new File(".")); d148 1 a148 9 /** * Create a Project object given a name a file descriptor and a directory. * * @@param projectDescriptor a maven project.xml * @@param dir Directory to read the projectDescriptor from * @@return the Maven project object for the given project descriptor * @@throws Exception when any errors occur */ public static Project getProject(String projectDescriptor, File dir) d150 2 a151 2 { return getProject(new File(projectDescriptor), dir); d155 1 a155 1 * Create a Project object given a file descriptor and a dir. a157 1 * @@param dir Directory to read the projectDescriptor from d161 1 a161 1 public static Project getProject(File projectDescriptor, File dir) d165 1 a165 2 Project project = (Project) projectBeanReader .parse(projectDescriptor); d170 1 a170 2 Project parent = (Project) projectBeanReader .parse(new File(dir, pomToExtend)); d174 1 a174 1 project = getJellyProject(project); d183 1 a183 1 * @@param project a maven Project a184 1 * @@throws Exception when any errors occur d186 1 a186 1 private static Project getJellyProject(Project project) d193 13 a205 1 JellyContext context = new JellyContext(); d210 1 a210 2 Script script = parser.parse( new InputStreamReader(getProjectInputStream(project))); d219 1 a219 2 return (Project) projectBeanReader .parse(new StringReader(baos.toString())); a224 2 * @@return a BeanReader * @@throws Exception when any errors occur a241 1 * @@throws Exception when any errors occur a254 6 /** * Create a project InputStream. * @@param project a maven Project * @@return the Project's InputStream * @@throws Exception when any errors occur */ a265 5 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project * @@throws Exception when any errors occur a275 4 * * @@param child the child Project to merge * @@param parent the parent Project to merge * @@return the child Project, merged with the parent Project d313 1 a313 6 /** * Checks if an Object is a Primitive * * @@param o any Object * @@return true if the Object is a Primitive */ d316 4 a319 16 if (o instanceof Boolean) { return true; } if (o instanceof String) { return true; } if (o instanceof Class) { return true; } if (o instanceof Integer) { return true; } a327 3 * * @@param o the value that we want to ckeck * @@return true if it needs populating d331 1 a331 1 if (o instanceof Collection && ((Collection) o).size() == 0) a482 5 * * @@param directory Directory to scan * @@param includes Comma separated list of includes * @@return the List of projects found in the directory * @@throws Exception when any errors occur d493 1 a493 2 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d504 2 a505 1 * @@throws Exception when any errors occur @ 1.41 log @o Modify the bean reader so that a rule is added that will allow the use of meta properties in the POM, or any other object type eventually used by Maven. @ text @a61 1 import java.io.FileOutputStream; a63 2 import java.io.PipedInputStream; import java.io.PipedOutputStream; a67 1 import java.util.HashMap; a69 1 import java.util.Map; a81 1 import org.apache.maven.project.Dependency; a87 3 import java.io.File; import java.io.FileWriter; import java.io.InputStream; a89 2 import java.net.MalformedURLException; import java.net.URL; d107 1 a107 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d158 1 a158 1 * Create a Project object given a file descriptor. d161 1 d169 2 a170 1 Project project = (Project) projectBeanReader.parse(projectDescriptor); d175 2 a176 1 Project parent = (Project) projectBeanReader.parse(new File(dir,pomToExtend)); d189 1 a189 1 * @@param project d191 1 d205 2 a206 1 Script script = parser.parse( new InputStreamReader( getProjectInputStream(project) )); d215 2 a216 1 return (Project) projectBeanReader.parse(new StringReader(baos.toString())); d222 2 d241 1 d255 6 d272 5 d287 4 d328 6 a333 1 /** Hack-a-roo */ d336 16 a351 4 if (o instanceof Boolean) return true; if (o instanceof String) return true; if (o instanceof Class) return true; if (o instanceof Integer) return true; d360 3 d366 1 a366 1 if (o instanceof Collection && ((Collection)o).size() == 0) d518 5 d533 2 a534 1 projects.add(getProject(files[i], new File(files[i]).getParentFile())); d545 1 a545 2 * @@throws IntrospectionException when an error occurs trying to determine * properties of the class provided @ 1.40 log @o cleaning up the javadoc @ text @d111 2 d118 1 a118 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d180 1 a180 1 d187 1 a187 1 d211 1 d513 3 @ 1.39 log @o only create the project bean reader once and reuse it. @ text @d112 2 a113 2 * An ant task that takes values from the project descriptor and creates the * necessary patternsets and paths required to build the project. d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d127 1 a127 1 * Create a Project object given a file descriptor. d138 8 a145 1 d152 8 d186 1 a186 1 project = getInterpolatedProject(project); d192 6 a197 6 private static Project getInterpolatedProject(Project project) throws Exception { return getJellyProject(project); } d236 6 a241 1 d516 6 @ 1.38 log @o simplifying interpolation for the sake of speed. step toward lazy evaluation of interpolated values. @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d122 4 a125 1 d161 1 a161 1 BeanReader projectBeanReader = createBeanReader(Project.class); d201 1 a201 1 BeanReader projectBeanReader = createBeanReader(Project.class); d205 16 @ 1.37 log @o updating for commons-lang b1 and changes to commons-cli @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d177 1 a177 1 return getJellyProject(getJellyProject(project)); @ 1.36 log @o correctly the getProjects() method used by the reactor. @ text @d78 1 a78 1 import org.apache.commons.lang.Strings; d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d424 1 a424 1 includePatterns = Strings.split(includes, ","); @ 1.35 log @o MavenUtils will now grab a set of projects o Project knows where it's project.xml lives. Used primarily in the the reactor. o getReadId() added to Dependency so that an id using the fugly notation can be changed into the id that is actually stated in the dependencies POM. PR: Obtained from: Submitted by: Reviewed by: @ text @d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d439 5 a443 1 d453 1 a453 1 projects.add(getProject(files[i])); @ 1.34 log @Glenn McAllister - 2002/07/25 - fixed the '//' url name problem when downloading dependencies - maven.repo.remote can now be set in one of the standard properties files; if it isn't found, defaults to http://jakarta.apache.org/turbin/jars2/ - starting to debug the 74-null.jar style errors, looks like a bad dependency is being added to the project. @ text @d69 1 d73 1 d116 1 a116 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d144 1 a144 1 { d169 1 d438 15 @ 1.33 log @o Applying martin's patches for the ant build and the test resources o Updating MavenUtils so that we can specify a project descriptor in a specific directory so that reactor type builds work correctly. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d143 1 a143 1 return getProject(projectDescriptor, dir); @ 1.32 log @o Adding better extension support. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d131 13 a143 1 return getProject(new File(projectDescriptor)); d153 1 a153 1 public static Project getProject(File projectDescriptor) d162 1 a162 1 Project parent = (Project) projectBeanReader.parse(new File(pomToExtend)); @ 1.31 log @o Adding method to deal with inheritance, interpolation and methods that are used by the Project class to turn itself into a dom4j document. @ text @d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d151 1 a151 1 project = mergeProjects(project, parent); d208 13 d222 1 a222 1 private static Project mergeProjects(Project child, Project parent) d237 4 a240 2 Object o = childBeanMap.get(property); if (valueNeedsPopulating(o)) d242 7 a248 2 childBeanMap.put(property, parentBeanMap.get(property)); } d256 11 @ 1.30 log @o When reading in a project descriptor now look for an element which indicates we have a parent to inherit from. @ text @d59 1 d62 6 d78 1 d85 1 d88 20 d114 1 a114 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d118 3 d144 3 a146 2 BeanReader beanReader = createBeanReader(Project.class); Project project = (Project) beanReader.parse(new FileInputStream(projectDescriptor)); a147 1 d150 1 a150 1 Project parent = (Project) beanReader.parse(new FileInputStream(new File(pomToExtend))); d154 2 d159 47 d406 2 d409 5 a423 3 beanReader.setXMLIntrospector(introspector); beanReader.registerBeanClass(clazz); d425 1 a425 1 return beanReader; @ 1.29 log @Style violations @ text @d61 3 d65 1 d67 2 a68 2 import java.beans.IntrospectionException; a69 1 d85 1 a85 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d113 63 a175 2 return (Project) beanReader.parse(new FileInputStream( projectDescriptor)); d322 1 a322 1 throws IntrospectionException @ 1.28 log @Style violations @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d96 1 a96 1 return getProject( new File( projectDescriptor ) ); d109 1 a109 1 BeanReader beanReader = createBeanReader( Project.class ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) d274 1 a274 1 beanReader.registerBeanClass( clazz ); @ 1.27 log @Unwiring the utils from all packages except 'project' package. I wasn't here to -1 this. @ text @d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d110 2 a111 1 return (Project) beanReader.parse( new FileInputStream( projectDescriptor ) ); d190 1 a190 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d253 1 @ 1.26 log @Checkstyle fixes @ text @d63 2 d67 4 a70 2 import org.apache.maven.build.BeanReader; import org.apache.maven.build.ProjectDescriptor; d82 1 a82 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a86 6 * Maven project class name. */ private static final String PROJECT_CLASS = "org.apache.maven.project.Project"; /** d96 1 a96 1 return new ProjectDescriptor(projectDescriptor).getProject(); d109 2 a110 1 return new ProjectDescriptor(projectDescriptor).getProject(); d136 1 a136 1 BeanReader reader = new BeanReader(Profile.class); d178 1 a178 1 BeanReader workspaceReader = new BeanReader(Workspace.class); d246 29 @ 1.25 log @- Added ProjectDescriptor and Repository for build process - Reworked project class and removed file dependencies to descriptor class - reworked build to use descriptor - Added tests - fixed formatting on simple docbook stylesheet @ text @a70 2 import org.apache.commons.betwixt.strategy.DecapitalizeNameMapper; d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.24 log @Change getProject methods to call constructors @ text @d66 1 d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d100 1 a100 1 return new Project(projectDescriptor); d113 1 a113 1 return new Project(projectDescriptor); @ 1.23 log @Remove createBeanReader method @ text @d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d99 1 a99 1 return getProject(new File(projectDescriptor)); d112 1 a112 5 BeanReader reader = new BeanReader(Project.class); Project project = (Project) reader.parse( new FileInputStream(projectDescriptor)); return project; @ 1.22 log @Utilitised BeanReader here for later removal of the createBeanReader method @ text @d65 1 a69 2 import org.apache.commons.betwixt.XMLIntrospector; import org.apache.commons.betwixt.io.BeanReader; d79 1 a79 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a89 14 * Create a BeanReader that is setup to parse XML in the * standard Maven/Turbine format. * * @@param clazz Class that the XML is mapped to * @@return An initialized BeanReader * @@throws Exception on any error */ public static BeanReader createBeanReader(Class clazz) throws Exception { return new org.apache.maven.build.BeanReader(clazz); } /** d112 1 a112 1 BeanReader reader = createBeanReader(Project.class); d142 1 a142 1 BeanReader reader = createBeanReader(Profile.class); d184 1 a184 1 BeanReader workspaceReader = createBeanReader(Workspace.class); @ 1.21 log @More checkstyle fixes @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d101 1 a101 16 XMLIntrospector introspector = new XMLIntrospector(); // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(clazz); return reader; @ 1.20 log @removed unused import and lines longer than 80 char @ text @d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d87 1 a87 1 private final static String PROJECT_CLASS = d96 1 d225 1 a225 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext(); ) @ 1.19 log @- Using betwixt and not the mapper now Created some utility methods for creating project, profiles and workspaces. All the mapping is now performed by betwixt. @ text @a70 1 import org.apache.commons.betwixt.io.BeanWriter; d80 1 a80 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d142 2 a143 1 Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d172 2 a173 1 Profile profile = (Profile) reader.parse(new FileInputStream(profileDescriptor)); d214 2 a215 1 Workspace workspace = (Workspace) workspaceReader.parse(new FileInputStream(workspaceDescriptor)); @ 1.18 log @Adding the code to use betwixt instead of the mapper but it's commented out at the moment until some final issues are sorted out with betwixt. @ text @a73 2 import org.apache.commons.xo.Mapper; d81 1 a81 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 28 d142 3 a144 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d146 1 d148 12 a159 2 /* XMLIntrospector introspector = new XMLIntrospector(); d161 12 a172 14 // set elements for attributes to true introspector.setAttributesForPrimitives(false); // wrap collections in an XML element //introspector.setWrapCollectionsInElement(true); // turn bean elements into lower case introspector.setNameMapper(new DecapitalizeNameMapper()); BeanReader reader = new BeanReader(); reader.setXMLIntrospector(introspector); reader.registerBeanClass(Project.class); Project project = (Project) reader.parse(new FileInputStream(projectDescriptor)); d174 1 a174 2 return project; */ d211 8 a218 9 // Create our workspace Mapper workspaceMapper = new Mapper(); Workspace workspace = (Workspace) workspaceMapper.map( workspaceDescriptor, Workspace.class.getName()); // Create our profile Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d220 1 a220 1 d228 2 a229 2 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d233 2 a234 3 Mapper projectMapper = new Mapper(); Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); @ 1.17 log @no message @ text @d60 1 d69 5 d79 2 a80 3 * An ant task that takes values from the project descriptor and * creates the necessary patternsets and paths required to build * the project. d83 1 a83 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 1 a90 1 private static final String PROJECT_CLASS = d108 2 a109 1 * @@param projectDescriptor a maven project.xml {@@link File} d117 1 a117 1 Project project = (Project) mapper.map(projectDescriptor, d120 21 d144 2 a145 3 * Create a Workspace object given a workspace and profile * descriptor. * d152 1 a152 1 public static Workspace getWorkspace(String workspaceDescriptor, d157 3 a159 3 return getWorkspace(new File(workspaceDescriptor), new File(profileDescriptor), new File(mavenLocalRepo)); d163 1 a163 1 * Create a {@@link Workspace} object given a workspace d165 1 a169 1 * d172 1 a172 1 public static Workspace getWorkspace(File workspaceDescriptor, d178 1 a178 1 Mapper workspaceMapper = new Mapper(); d181 1 a181 1 d183 2 a184 2 Mapper profileMapper = new Mapper(); Profile profile = (Profile) profileMapper.map(profileDescriptor, d187 1 a187 1 d189 1 a189 1 for (Iterator i = profile.getProjectIds().iterator(); i.hasNext();) d195 1 a195 1 File baseDir = new File(new File(mavenLocalRepo, "project"), d198 1 a198 1 d201 1 a201 1 Project project = (Project) projectMapper.map(projectDescriptor, d205 1 a205 1 @ 1.16 log @Fix checkstyle issues @ text @d55 2 d78 1 a78 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.15 log @More checkstyle fixes (and Netbeans testing) @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d109 2 a110 1 Project project = (Project) mapper.map(projectDescriptor, PROJECT_CLASS); d119 1 a119 1 * @@param projectDescriptor the file name of a maven project descriptor d135 6 a140 1 * Create a Project object given a file descriptor. d142 1 a142 1 * @@throws Exception d151 2 a152 1 Workspace workspace = (Workspace) workspaceMapper.map(workspaceDescriptor, Workspace.class.getName()); d156 2 a157 1 Profile profile = (Profile) profileMapper.map(profileDescriptor, Profile.class.getName()); d167 2 a168 1 File baseDir = new File(new File(mavenLocalRepo, "project"), projectId); d173 2 a174 1 Project project = (Project) projectMapper.map(projectDescriptor, Project.class.getName()); d215 1 a215 1 files[i] = new File(directory,files[i]).getAbsolutePath(); @ 1.14 log @Added javadoc @@param and @@return for checkstyle issues @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d91 1 a91 1 * @@throws Exception d101 3 a103 2 * * @@throws Exception d109 1 a109 1 Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); d116 6 a121 2 * * @@throws Exception @ 1.13 log @Removed unused import @ text @d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d83 1 a83 1 private final static String PROJECT_CLASS = d89 2 @ 1.12 log @- Created a FileProcessingExecutor that can be used to process files in a project's directory. This executor is an abstract class that provides a template method called "doProcessFile" that subclasses can override to do whatever (my motivation is to use SourceTool to parse each file and pass it a visitor). Additionally, there is pre/post processing template methods that can be overridden if needed. I.e. in most cases you'll want to use the postProcessing method to do something with the results of the processing (again, in my case, I query the visitor object for the information it accumulated). - Created a placeholder TaskListVisitor that will be used to accumulate todo/task tags in JavaDoc which will then be used to create the task list for a project. Currenly, TaskListVisitor simply counts the number of JavaDoc entries (its a placeholder and I'm getting tired :) - Created a TaskListExecutor which is a subclass of the new FileProcessingExecutor. By using the FileProcessingExecutor it becomes trivial to pass any type of visitor through the entire source tree. TaskListExecutor uses a TaskListVisitor. bhl: This is how you can create a new JXR task using another visitor. - Modified SourceTool to pass any parser exceptions. Jason: you had modified this to ignore them so you could continue processing, but now I believe you can just use the FileProcessingExecutor instead, see the 'doProcessFile' of my TaskListExecutor, this is the more appropriate spot to ignore the exception. - Modified MavenUtils.getFiles to check if the 'includes' parameter is null. If it is null, then pass that directly to Ant's directory scanner setIncludes() method which indicates all files should be matched. Prior to this change, a NPE was thrown. - Finally, the build files have a new target called maven:task-list which will invoke TaskListExecutor which will process all files in the {$src} directory and count the number of JavaDocs (until I actually write the real TaskListVisitor). This new target is not automatically invoked as part of any other target yet (I'll hold off until it does what its supposed to), but in the meantime, you can invoke the target for testing purposes. @ text @a58 1 import java.util.List; d76 1 a76 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.11 log @Adding a workspace mapper. Used in the workspace mapper test and in the reactor. @ text @d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d186 5 d193 1 a193 1 directoryScanner.setIncludes(Strings.split(includes,",")); @ 1.10 log @Moving to commons-xo. PR: Obtained from: Submitted by: Reviewed by: @ text @d58 1 d64 2 d77 1 a77 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d111 53 @ 1.9 log @Simplifying getProject(String) method. @ text @d64 1 a64 1 import org.apache.stratum.xo.Mapper; d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ @ 1.8 log @Broke long line at 80 characters. @ text @d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d89 1 a89 1 public static Project getProject(File projectDescriptor) d92 1 a92 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d100 1 a100 1 public static Project getProject(String projectDescriptor) d108 1 d120 1 a120 1 @ 1.7 log @Pushing in changes to maven utils, thanks to glenn for pointing this out. @ text @d58 1 d74 1 a74 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d81 2 a82 1 private final static String PROJECT_CLASS = "org.apache.maven.project.Project"; a143 1 @ 1.6 log @turn off debuging @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d117 12 d130 1 a130 1 directoryScanner.setBasedir(new File(directory)); @ 1.5 log @Detect whether there are actually any sources and set a property in the Ant project called "sourcesPresent". The source related documentation will not be generated if there are no sources present. Fancy that. Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ a90 1 mapper.setDebug(true); @ 1.4 log @Added executor and accompanying changes to create a package -> project map so that a set of class references can be turned into a set of project references with the help of bcel which will collect the class references from a set of JARs or classfiles. If you want to make run the dist target you need to have the gump descriptors checked out in order to make a set of maven descriptors. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d90 4 a93 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; d104 3 a106 3 Mapper mapper = new Mapper(); Project project = (Project) mapper.map(projectDescriptor,PROJECT_CLASS); return project; @ 1.3 log @Extra semicolon removed. @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d95 12 @ 1.2 log @The build.xml file is now being checked into CVS because we have to deal with project specific targets and it is most convenient to place these specifics in build.xml so that users can simply type: 'ant '. Standard targets are in the maven build files and the build.xml file just delegates to them. PR: Obtained from: Submitted by: Reviewed by: @ text @d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */; d119 1 a119 1 }@ 1.1 log @Adding executor beans, slowly moving away from the Ant coupling. Texen is still a problem because I started with an Ant task for Maven instead of using the bean pattern. But I will convert texen to a bean, I didn't realize that Costin had the TaskAdapter cooked right into Ant to allow beans to be used by Ant provided they contained a setProject() and execute() method. Not sure why the setProject() is needed but it allows us to have plain beans used by Ant which is what we want so that I can use the beans in conjunction with a CLI util, or a GUI (more important for the stuff I want to do). @ text @d59 2 d65 2 d73 1 a73 1 * @@version $Id: MavenUtils.java,v,v 1.1.1.1 2004/10/22 12:29:49 evenisse Exp $ d86 1 a86 1 */ d94 26 a119 1 } @ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000115510401301162033746 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000251610401301162033750 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000331410401301162033745 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. #UseNewInfoFmtStrings=yes ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000255210401301162033750 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/val-tagsmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000001510401301162033740 0ustar twernertwernerMAVEN_1_0 y ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000140110401301162033740 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000413010401301162033742 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000133610401301162033747 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000002310401301162033737 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000365510401301162033755 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify # that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always # Set `UserAdminOptions' to the list of `cvs admin' commands (options) # that users not in the `cvsadmin' group are allowed to run. This # defaults to `k', or only allowing the changing of the default # keyword expansion mode for files for users not in the `cvsadmin' group. # This value is ignored if the `cvsadmin' group does not exist. # # The following string would enable all `cvs admin' commands for all # users: #UserAdminOptions=aAbceIklLmnNostuU # Set `UseNewInfoFmtStrings' to `no' if you must support a legacy system by # enabling the deprecated old style info file command line format strings. # Be warned that these strings could be disabled in any new version of CVS. UseNewInfoFmtStrings=yes @ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000311410401301162033743 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %l = name of log file to be verified. # # If no format strings are present in the filter, a default " %l" will # be appended to the filter, but this usage is deprecated. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000151710401301162033750 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000335410401301162033751 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000447210401301162033753 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments if no format strings are present: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- tagtype "?" on delete, "T" for branch, "N" for static # $4 -- repository # $5-> file revision [file revision ...] # # If any format strings are present in the filter, they will be replaced as follows: # %b = branch mode = "?" (delete ops - unknown) | "T" (branch) | "N" (not branch) # %o = operation = "add" | "mov" | "del" # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %t = tagname # %{sVv} = attribute list = file name, old version tag will be deleted from, # new version tag will be added to (or deleted from, but this feature is # deprecated. When either old or new revision is unknown, doesn't exist, # or isn't applicable, the string "NONE" will be placed on the command # line. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sV} is # a legal format string, but will only be replaced with file name and old revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are having a tag moved from version 1.1 to versoin 1.1.2.9, %{sVv} # will generate the following six arguments in this order: file1, 1.1, 1.1.2.9, file2, 1.1, # 1.1.2.9. # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000215410401301162033746 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # Format strings present in the filter will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{s} = file name, file name, ... # # If no format strings are present in the filter string, a default of # " %r %s" will be appended to the filter string, but this usage is # deprecated. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000174310401301162033751 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # format strings are replaceed as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %s = user to notify # # For example: #ALL (echo Committed to %r/%p; cat) |mail %s -s "CVS notification" @ ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000077410401301162033754 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000601210401301162033743 0ustar twernertwernerΚW&<îÿ(¹ï$Ÿ-ûRc“†Àîÿ(¹Ÿ-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹!Ù-ûRc“†Àîÿ(¹ï-ûRc“†Àîÿ(¹éØ !îÿ(¹ÑØ$Ÿ D:\apache\maven\trunks\scm\maven-scm-providers\maven-scm-provider-cvs\src\test\repository/test-repo/checkout/src/java/org/apache/maven/.svn/wcprops/MavenUtils.java,v.svn-work© ! ! !¹× ÿ$ÿ-ûRc“†Àîÿ(¹ï © ! ! !ïש ! ! !¹Öö ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ?›õ MAVE ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿMAVEN_1_0y././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000157010401301162033747 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000257310401301162033753 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000371610401301162033753 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.06.23.19.20.08; author trygvis; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # If any format strings are present in the filter, they will be replaced as follows: # %p = path relative to repository # %r = repository (path portion of $CVSROOT) # %{sVv} = attribute list = file name, old version number (pre-checkin), # new version number (post-checkin). When either old or new revision is # unknown, doesn't exist, or isn't applicable, the string "NONE" will be # placed on the command line instead. # # Note that %{sVv} is a list operator and not all elements are necessary. Thus %{sv} is # a legal format string, but will only be replaced with file name and new revision. # it also generates multiple arguments for each file being operated upon. i.e. if two # files, file1 & file2, are being commited from 1.1 to version 1.1.2.1 and from 1.1.2.2 # to 1.1.2.3, respectively, %{sVv} will generate the following six arguments in this # order: file1, 1.1, 1.1.2.1, file2, 1.1.2.2, 1.1.2.3. # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000122610401301162033745 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000223110401301162033742 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/test/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/test/java/Test.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000060610401301162033746 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.50; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/test/java/Test.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/main/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/src/main/java/Application.java,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000061510401301162033746 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/src/main/java/Application.java@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/pom.xml,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000056610401301162033753 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/pom.xml@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/test-repo/module/readme.txt,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000057110401301162033747 0ustar twernertwernerhead 1.1; branch 1.1.1; access ; symbols INIT:1.1.1.1 ASF:1.1.1; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.12.30.03.21.49; author Brett; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @/readme.txt@ 1.1.1.1 log @foo @ text @@ ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000755000175000017500000000000011345536665033774 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/cvswrappersmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000113210401301162033741 0ustar twernertwerner# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/commitinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000170110401301162033743 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000173710401301162033754 0ustar twernertwerner# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/verifymsgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000200210401301162033736 0ustar twernertwerner# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/editinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000231210401301162033742 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/notifymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000106410401301162033745 0ustar twernertwerner# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/editinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000200110401301162033735 0ustar twernertwerner# The "editinfo" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/taginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000155710401301162033754 0ustar twernertwerner# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/checkoutlist,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000127010401301162033744 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' @ ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/.cvsignoremaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000002310401301162033737 0ustar twernertwernerhistory Emptydir ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/config,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000225010401301162033743 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Set this to "no" if pserver shouldn't check system users/passwords #SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOEFWUPCGMAR # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg # script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra # second per directory being committed, so it is not recommended for large # repositories. Set it to `never' (the previous CVS behavior) to prevent # verifymsg scripts from changing the log message. #RereadLogAfterVerify=always @ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/verifymsg,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000231310401301162033743 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "verifymsg" file is used to allow verification of logging # information. It works best when a template (as specified in the # rcsinfo file) is provided for the logging procedure. Given a # template with locations for, a bug-id number, a list of people who # reviewed the code before it can be checked in, and an external # process to catalog the differences that were code reviewed, the # following test can be applied to the code: # # Making sure that the entered bug-id number is correct. # Validating that the code that was reviewed is indeed the code being # checked in (using the bug-id number or a seperate review # number to identify this particular code set.). # # If any of the above test failed, then the commit would be aborted. # # Actions such as mailing a copy of the report to each reviewer are # better handled by an entry in the loginfo file. # # One thing that should be noted is the the ALL keyword is not # supported. There can be only one entry that matches a given # repository. @ ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/cvswrappers,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000144310401301162033746 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# This file affects handling of files based on their names. # # The -m option specifies whether CVS attempts to merge files. # # The -k option specifies keyword expansion (e.g. -kb for binary). # # Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) # # wildcard [option value][option value]... # # where option is one of # -f from cvs filter value: path to filter # -t to cvs filter value: path to filter # -m update methodology value: MERGE or COPY # -k expansion mode value: b, o, kkv, &c # # and value is a single-quote delimited value. # For example: #*.gif -k 'b' @ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/loginfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000216510401301162033750 0ustar twernertwerner# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/historymaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000000010401301162033732 0ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/taginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000207010401301162033743 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "taginfo" file is used to control pre-tag checks. # The filter on the right is invoked with the following arguments: # # $1 -- tagname # $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d # $3 -- repository # $4-> file revision [file revision ...] # # A non-zero exit of the filter program will cause the tag to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/commitinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000137010401301162033745 0ustar twernertwerner# The "commitinfo" file is used to control pre-commit checks. # The filter on the right is invoked with the repository and a list # of files to check. A non-zero exit of the filter program will # cause the commit to be aborted. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being committed to, relative # to the $CVSROOT. For the first match that is found, then the remainder # of the line is the name of the filter to run. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/notify,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000137510401301162033752 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "notify" file controls where notifications from watches set by # "cvs watch add" or "cvs edit" are sent. The first entry on a line is # a regular expression which is tested against the directory that the # change is being made to, relative to the $CVSROOT. If it matches, # then the remainder of the line is a filter program that should contain # one occurrence of %s for the user to notify, and information on its # standard input. # # "ALL" or "DEFAULT" can be used in place of the regular expression. # # For example: #ALL mail -s "CVS notification" %s @ ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/checkoutlistmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000075710401301162033755 0ustar twernertwerner# The "checkoutlist" file is used to support additional version controlled # administrative files in $CVSROOT/CVSROOT, such as template files. # # The first entry on a line is a filename which will be checked out from # the corresponding RCS file in the $CVSROOT/CVSROOT directory. # The remainder of the line is an error message to use if the file cannot # be checked out. # # File format: # # [][] # # comment lines begin with '#' ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/val-tags.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000000010401301162033732 0ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/modules.dbmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000600010401301162033740 0ustar twernertwernerΚW&<Íy—[Úêí*¼ d$ŸÍy—[Úêí*¼ î$ŸÍy—[Úêí*¼ ‰ñ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/rcsinfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000152210401301162033744 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". @ ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/modules,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000251010401301162033742 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. @ ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/loginfo,vmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000247610401301162033755 0ustar twernertwernerhead 1.1; access ; symbols ; locks ; strict; comment @# @; 1.1 date 2004.12.30.03.21.15; author Brett; state Exp; branches; next ; desc @@ 1.1 log @initial checkin@ text @# The "loginfo" file controls where "cvs commit" log information # is sent. The first entry on a line is a regular expression which must match # the directory that the change is being made to, relative to the # $CVSROOT. If a match is found, then the remainder of the line is a filter # program that should expect log information on its standard input. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name ALL appears as a regular expression it is always used # in addition to the first matching regex or DEFAULT. # # You may specify a format string as part of the # filter. The string is composed of a `%' followed # by a single format character, or followed by a set of format # characters surrounded by `{' and `}' as separators. The format # characters are: # # s = file name # V = old version number (pre-checkin) # v = new version number (post-checkin) # # For example: #DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog @ ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/rcsinfomaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000121110401301162033737 0ustar twernertwerner# The "rcsinfo" file is used to control templates with which the editor # is invoked on commit and import. # # The first entry on a line is a regular expression which is tested # against the directory that the change is being made to, relative to the # $CVSROOT. For the first match that is found, then the remainder of the # line is the name of the file that contains the template. # # If the repository name does not match any of the regular expressions in this # file, the "DEFAULT" line is used, if it is specified. # # If the name "ALL" appears as a regular expression it is always used # in addition to the first matching regex or "DEFAULT". ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resources/tck-repository/CVSROOT/modulesmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/resour0000644000175000017500000000217710401301162033753 0ustar twernertwerner# Three different line formats are valid: # key -a aliases... # key [options] directory # key [options] directory files... # # Where "options" are composed of: # -i prog Run "prog" on "cvs commit" from top-level of module. # -o prog Run "prog" on "cvs checkout" of module. # -e prog Run "prog" on "cvs export" of module. # -t prog Run "prog" on "cvs rtag" of module. # -u prog Run "prog" on "cvs update" of module. # -d dir Place module in directory "dir" instead of module name. # -l Top-level directory only -- do not recurse. # # NOTE: If you change any of the "Run" options above, you'll have to # release and re-checkout any working directories of these modules. # # And "directory" is a path to a directory relative to $CVSROOT. # # The "-a" option specifies an alias. An alias is interpreted as if # everything on the right of the "-a" had been typed on the command line. # # You can encode a module within a module by using the special '&' # character to interpose another module into the current module. This # can be useful for creating a module that consists of many directories # spread out over the entire source repository. maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/0000755000175000017500000000000011345536665033455 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000360111050561465033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: AbstractCvsScmTest.java 685548 2008-08-13 13:35:49Z vsiveton $ * @todo refactor into non-existence */ public abstract class AbstractCvsScmTest extends ScmTestCase { /** {@inheritDoc} */ public void setUp() throws Exception { super.setUp(); FileUtils.mkdir( getWorkingDirectory().getAbsolutePath() ); } protected ScmRepository getScmRepository() throws Exception { return makeScmRepository( CvsScmTestUtils.getScmUrl( getRepository(), getModule() ) ); } public void assertBetween( long small, long large, long value ) { assertTrue( value + " should be >= than " + small, value >= small ); assertTrue( value + " should be <= than " + large, value <= large ); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/branch/CvsBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000327711050561465033634 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.branch; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.branch.BranchCommandTckTest; /** * This test tests the branch command. * * @author Emmanuel Venisse * @version $Id: CvsBranchCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsBranchCommandTckTest extends BranchCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000321611050561465033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.update; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest; /** * @author Brett Porter * @version $Id: CvsUpdateCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsUpdateCommandTckTest extends UpdateCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000001367611053246641033637 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.update; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest; import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.FileWriter; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsUpdateCommandTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class CvsUpdateCommandTest extends AbstractCvsScmTest { private File repository; private File workingDirectory; private File assertionDirectory; /** {@inheritDoc} */ public void setUp() throws Exception { super.setUp(); repository = getTestFile( "target/update-test/repository" ); workingDirectory = getTestFile( "target/update-test/working-directory" ); assertionDirectory = getTestFile( "target/update-test/assertion-directory" ); CvsScmTestUtils.initRepo( repository, workingDirectory, assertionDirectory ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/update"; } /** * @todo merge into tck */ public void testCvsUpdate() throws Exception { if ( !isSystemCmd( CvsScmTestUtils.CVS_COMMAND_LINE ) ) { System.err.println( "'" + CvsScmTestUtils.CVS_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ScmManager scmManager = getScmManager(); String scmUrl = CvsScmTestUtils.getScmUrl( repository, getModule() ); // Check out the repo to a working directory where files will be modified and committed String arguments = "-f -d " + repository.getAbsolutePath() + " " + "co -d " + workingDirectory.getName() + " " + getModule(); CvsScmTestUtils.executeCVS( workingDirectory.getParentFile(), arguments ); // Check out the repo to a assertion directory where the command will be used arguments = "-f -d " + repository.getAbsolutePath() + " " + "co -d " + assertionDirectory.getName() + " " + getModule(); CvsScmTestUtils.executeCVS( assertionDirectory.getParentFile(), arguments ); // A new check out should return 0 updated files. ScmRepository scmRepository = scmManager.makeScmRepository( scmUrl ); UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( assertionDirectory ) ); assertNotNull( result ); if ( !result.isSuccess() ) { System.out.println( "result.providerMessage: " + result.getProviderMessage() ); System.out.println( "result.commandOutput: " + result.getCommandOutput() ); fail( "Command failed" ); } assertNull( result.getProviderMessage() ); assertNull( result.getCommandOutput() ); assertNotNull( result.getUpdatedFiles() ); assertEquals( 0, result.getUpdatedFiles().size() ); // Modifing a file File fooJava = new File( workingDirectory, "Foo.java" ); String content = FileUtils.fileRead( fooJava ); FileWriter writer = new FileWriter( fooJava ); writer.write( content + System.getProperty( "line.separator" ) ); writer.write( "extra line" ); writer.close(); // Adding a new file writer = new FileWriter( new File( workingDirectory, "New.txt" ) ); writer.write( "new file" ); writer.close(); arguments = "-f -d " + repository.getAbsolutePath() + " add New.txt"; CvsScmTestUtils.executeCVS( workingDirectory, arguments ); // Committing arguments = "-f -d " + repository.getAbsolutePath() + " commit -m ."; CvsScmTestUtils.executeCVS( workingDirectory, arguments ); // Check the updated files result = scmManager.update( scmRepository, new ScmFileSet( assertionDirectory ) ); assertNotNull( result ); if ( !result.isSuccess() ) { System.out.println( "result.providerMessage: " + result.getProviderMessage() ); System.out.println( "result.commandOutput: " + result.getCommandOutput() ); fail( "Command failed" ); } assertNull( result.getProviderMessage() ); assertNull( result.getCommandOutput() ); assertNotNull( result.getUpdatedFiles() ); assertEquals( 2, result.getUpdatedFiles().size() ); ScmFile file1 = (ScmFile) result.getUpdatedFiles().get( 0 ); assertPath( "Foo.java", file1.getPath() ); assertEquals( ScmFileStatus.UPDATED, file1.getStatus() ); ScmFile file2 = (ScmFile) result.getUpdatedFiles().get( 1 ); assertPath( "New.txt", file2.getPath() ); assertEquals( ScmFileStatus.UPDATED, file2.getStatus() ); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000324111050561465033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: CvsCheckOutCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsCheckOutCommandTckTest extends CheckOutCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000001057011053246641033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest; import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import java.io.File; import java.util.List; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsCheckoutCommandTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class CvsCheckoutCommandTest extends AbstractCvsScmTest { /** {@inheritDoc} */ protected String getModule() { return "test-repo/checkout"; } /** * @todo move this test to the TCK. */ public void testCheckOutWithoutTag() throws Exception { if ( !isSystemCmd( CvsScmTestUtils.CVS_COMMAND_LINE ) ) { System.err.println( "'" + CvsScmTestUtils.CVS_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ScmManager scmManager = getScmManager(); CheckOutScmResult result = scmManager.checkOut( getScmRepository(), getScmFileSet() ); if ( !result.isSuccess() ) { fail( result.getProviderMessage() + "\n" + result.getCommandOutput() ); } List files = result.getCheckedOutFiles(); assertNotNull( files ); assertEquals( 3, files.size() ); assertCheckedOutFile( files, 0, "/Foo.java", ScmFileStatus.UPDATED ); assertCheckedOutFile( files, 1, "/Readme.txt", ScmFileStatus.UPDATED ); assertCheckedOutFile( files, 2, "/src/java/org/apache/maven/MavenUtils.java", ScmFileStatus.UPDATED ); } /** * @todo move this test to the TCK - checkout with "revision", then have one for tag as well. */ public void testCheckOutWithTag() throws Exception { if ( !isSystemCmd( CvsScmTestUtils.CVS_COMMAND_LINE ) ) { System.err.println( "'" + CvsScmTestUtils.CVS_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ScmManager scmManager = getScmManager(); CheckOutScmResult result = scmManager.getProviderByRepository( getScmRepository() ).checkOut( getScmRepository(), getScmFileSet(), "MAVEN_1_0" ); if ( !result.isSuccess() ) { fail( result.getProviderMessage() + "\n" + result.getCommandOutput() ); } List files = result.getCheckedOutFiles(); assertNotNull( files ); assertEquals( 1, files.size() ); File mavenUtils = assertCheckedOutFile( files, 0, "/src/java/org/apache/maven/MavenUtils.java", ScmFileStatus.UPDATED ); assertBetween( 38403, 39511, mavenUtils.length() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private File assertCheckedOutFile( List files, int i, String fileName, ScmFileStatus status ) throws Exception { File file = new File( getWorkingDirectory(), fileName ); assertTrue( file.getAbsolutePath() + " file doesn't exist.", file.exists() ); ScmFile coFile = (ScmFile) files.get( i ); assertSame( status, coFile.getStatus() ); assertPath( fileName, coFile.getPath() ); return file; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000321611050561465033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.status; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.status.StatusCommandTckTest; /** * @author Brett Porter * @version $Id: CvsStatusCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsStatusCommandTckTest extends StatusCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000324311050561465033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.tag; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.tag.TagCommandTckTest; /** * This test tests the tag command. * * @author Brett Porter * @version $Id: CvsTagCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsTagCommandTckTest extends TagCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000331111050561465033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest; /** * @author Brett Porter * @version $Id: CvsCheckInCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsCheckInCommandTckTest extends CheckInCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { // TODO: should have an assertion directory? CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000320211050561465033620 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.diff; /* * 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. */ import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest; /** * @author Brett Porter * @version $Id: CvsDiffCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class CvsDiffCommandTckTest extends DiffCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() { return CvsScmTestUtils.getScmUrl( getRepositoryRoot(), getModule() ); } /** {@inheritDoc} */ protected String getModule() { return "test-repo/module"; } /** {@inheritDoc} */ public void initRepo() throws Exception { CvsScmTestUtils.initRepo( "src/test/tck-repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000755000175000017500000000000011345536665033634 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000655411053246641033634 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib.command.changelog; /* * 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. */ import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.cvslib.AbstractCvsScmTest; import org.apache.maven.scm.provider.cvslib.CvsScmTestUtils; import java.util.Date; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: CvsChangeLogCommandTest.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public class CvsChangeLogCommandTest extends AbstractCvsScmTest { /** {@inheritDoc} */ protected String getModule() { return "test-repo/changelog"; } public void testGetCommandWithStartAndEndDate() throws Exception { Date startDate = getDate( 2003, 1, 1 ); Date endDate = getDate( 2004, 1, 1 ); testChangeLog( startDate, endDate, 32, null ); } public void testGetCommandWithoutEndDate() throws Exception { Date startDate = getDate( 2003, 1, 1 ); Date endDate = null; testChangeLog( startDate, endDate, 51, null ); } public void testGetCommandWithBranchOrTag() throws Exception { Date startDate = null; Date endDate = null; testChangeLog( startDate, endDate, 22, "1.107.4" ); } private void testChangeLog( Date startDate, Date endDate, int changeLogSize, String branch ) throws Exception { if ( !isSystemCmd( CvsScmTestUtils.CVS_COMMAND_LINE ) ) { System.err.println( "'" + CvsScmTestUtils.CVS_COMMAND_LINE + "' is not a system command. Ignored " + getName() + "." ); return; } ScmManager scmManager = getScmManager(); CvsScmTestUtils.executeCVS( getWorkingDirectory(), "-f -d " + getTestFile( "src/test/repository/" ) + " co " + getModule() ); ChangeLogScmResult changeLogResult = scmManager.getProviderByRepository( getScmRepository() ).changeLog( getScmRepository(), getScmFileSet(), startDate, endDate, 0, branch ); if ( !changeLogResult.isSuccess() ) { fail( changeLogResult.getProviderMessage() + "\n" + changeLogResult.getCommandOutput() ); } ChangeLogSet changeLogSet = changeLogResult.getChangeLog(); assertNotNull( changeLogSet ); assertEquals( changeLogSize, changeLogSet.getChangeSets().size() ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmTestUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/src/main/java/o0000644000175000017500000000476411053246641033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.cvslib; /* * 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. */ import junit.framework.Assert; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; /** * @author Brett Porter * @version $Id: CvsScmTestUtils.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public final class CvsScmTestUtils { /** 'cvs' command line */ public static final String CVS_COMMAND_LINE = "cvs"; private CvsScmTestUtils() { } public static String getScmUrl( File repository, String module ) { return "scm:cvs|local|" + repository + "|" + module; } public static void executeCVS( File workingDirectory, String arguments ) throws Exception { ScmTestCase.execute( workingDirectory, CVS_COMMAND_LINE, arguments ); } public static void initRepo( File repository, File workingDirectory, File assertionDirectory ) throws IOException { initRepo( "src/test/repository/", repository, workingDirectory ); FileUtils.deleteDirectory( assertionDirectory ); Assert.assertTrue( assertionDirectory.mkdirs() ); } public static void initRepo( String source, File repository, File workingDirectory ) throws IOException { // Copy the repository to target File src = PlexusTestCase.getTestFile( source ); FileUtils.deleteDirectory( repository ); Assert.assertTrue( repository.mkdirs() ); FileUtils.copyDirectoryStructure( src, repository ); FileUtils.deleteDirectory( workingDirectory ); Assert.assertTrue( workingDirectory.mkdirs() ); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvstest/pom.xml0000644000175000017500000000310411322611461032313 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-cvs 1.3 maven-scm-provider-cvstest Maven SCM CVS Provider TCK tests Tests library for the SCM CVS Provider. org.apache.maven.scm maven-scm-test maven-scm-1.3/maven-scm-providers/maven-scm-providers-cvs/pom.xml0000644000175000017500000000325511322611461025113 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-providers-cvs pom Maven SCM CVS Provider - Parent SCM Provider implementation for CVS (http://www.nongnu.org/cvs/). maven-scm-provider-cvs-commons maven-scm-provider-cvsexe maven-scm-provider-cvsjava maven-scm-provider-cvstest maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/0000755000175000017500000000000011345536663024437 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/0000755000175000017500000000000011345536663025226 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/site/0000755000175000017500000000000011345536663026172 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/site/site.xml0000644000175000017500000000213011051127665027644 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/site/apt/0000755000175000017500000000000011345536663026756 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/site/apt/index.apt0000644000175000017500000000650711046444042030566 0ustar twernertwerner -------------- Maven Perforce SCM provider -------------- Mike Perham -------------- 01 December 2006 -------------- Maven Perforce SCM provider The Perforce provider acts as a "driver" between Maven's generic SCM API and the Perforce SCM system. Use Cases The provider must handle a number of different usecases: * Check out to a directory or update that source regularly as part of a build server (Continuum) * Label a source tree and check out that label to a temp directory (the release plugin) * Map a number of commands designed for CVS/SVN onto the (frequently) very different semantics provided by Perforce (the scm plugin) Details The main semantic issue faced by the provider is CVS/SVN's concept of a working copy versus Perforce's concept of a clientspec. CVS/SVN allow the user to checkout any repository location to any local directory at will and tracks this by keeping metadata in a CVS/.svn directory. Perforce instead uses a "clientspec" to track any number of repository locations and how they map onto the local filesystem. Consider the complications required just to check out source to a directory. The provider cannot assume that it can modify the current or default clientspec so it needs to create a clientspec. But since clientspecs are persistent it needs to know if it should delete the clientspec (the release plugin) or keep the clientspec around so it can be used to refresh the source tree in the future (build server). The provider uses a few system properties to control how it operates. * <<>> - Allows you to override the default name created by the provider. By default the provider creates a clientspec with the name "--MavenSCM-" to ensure uniqueness and tracability. If you want to use a pre-existing clientspec or conform to a corporate naming standard, you can just pass the name here and the provider will use it instead. This property is most useful for scenarios where you want the clientspec to be retained, as with Continuum. * <<>> - Controls whether the Perforce provider will delete the clientspec once the operation is done. In the case where we just want to check out a source tree to a temporary directory (like with the release plugin), we want this to be false since there is no reason to keep the clientspec around. On the other hand, when used with Continuum, you want to remember the checkout so that repeated syncs take a minimum of time. The default is false. * <<>> - Controls whether the provider will lock the tag once it has been successfully created. This is useful for the release plugin since the tag should be frozen based on a one-time release. Defaults to true since none of the above usecases require a floating label. Troubleshooting * Under the covers, the provider just executes the <<>> command. <<>> must be in your path. * Make sure <<>> returns your correct information. * The provider does not login for you. You must run <<>> before any Maven SCM commands will work. If you need automated SCM operations (e.g. you are using Continuum on a build server), it is recommended that you use a special Perforce user whose login does not time out. * Ensure that your module has a valid SCM element and the depot path is correct. maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/0000755000175000017500000000000011345536663026205 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/0000755000175000017500000000000011345536663030217 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/0000755000175000017500000000000011345536663032024 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/login_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/login_good0000644000175000017500000000004710342633721034055 0ustar twernertwernerEnter password: User mperham logged in.././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/difflog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/difflog.tx0000644000175000017500000003076610342633721034014 0ustar twernertwerner--- //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/IThing.java 2005/11/14 14:35:48 +++ //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/IThing.java 2005/11/22 07:28:55 @@ -1,10 +1,7 @@ package com.webify.framework.model; -import com.webify.framework.model.metadata.ClassInfo; import com.webify.framework.model.metadata.InterfaceInfo; - -import java.net.URI; -import java.util.Set; +import com.webify.wsf.modelstore.IPersisted; /** * Base interface for all model types in WSF. Corresponds to owl:Thing. @@ -15,52 +12,14 @@ * @version $Id: difflog.txt 349435 2005-11-28 17:01:05Z evenisse $ * @since 2.0.0 */ -public interface IThing { +public interface IThing extends IPersisted { /** * @deprecated Should not rely on, or hardcode 3.4 base namespace in code. */ String NS_BASE_CATALOG = "http://www.webifysolutions.com/2005/06/base-catalog#"; - - /** - * @param name the property URI in string form. - * @deprecated use {@link #getProperty(URI)} instead. - */ - Object getProperty(String name); - - Object getProperty(URI name); - - /** - * @param name the property URI in string form. - * @deprecated use {@link #setProperty(URI, Object)} instead. - */ - void setProperty(String name, Object value); - - void setProperty(URI name, Object value); - - /** - * @param name the property URI in string form. - * @deprecated use {@link #removeProperty(URI, Object)} instead. - */ - void removeProperty(String name, Object value); - - void removeProperty(URI name, Object value); - - /** - * @param name the property URI in string form. - * @return true if value is associated with the specified property - * @deprecated use {@link #hasProperty(URI, Object)} instead. - */ - boolean hasProperty(String name, Object value); - boolean hasProperty(URI name, Object value); - /** - * @return a (non-null, possibly empty) set of URIs corresponding to property names. - */ - Set propertyNameSet(); - - /** * @OntProperty (uri="http://www.w3.org/2000/01/rdf-schema#comment") */ String getComment(); @@ -91,27 +50,6 @@ void setVersionInfo(String versionInfo); /** - * @return the local name within {@link #getURI()}'s namespace. - */ - String getId(); - - /** - * @return the full URI for this thing, which is unique within a model. - */ - URI getURI(); - - /** - * @return the declared type of the instance - */ - URI getDeclaredType(); - - /** - * @return a locked {@link ClassInfo} instance - * representing this thing's interface/declared type. - */ - ClassInfo getClassInfo(); - - /** * @return a locked {@link InterfaceInfo} instance * representing this thing's interface/declared type. */ --- //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/ModelFactory.java 2005/11/21 08:58:32 +++ //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/ModelFactory.java 2005/11/21 10:29:33 @@ -3,8 +3,8 @@ import com.webify.framework.model.changes.ModelChanges; import com.webify.framework.model.metadata.MetadataRegistry; import com.webify.framework.support.trackingmap.MultiValueMap; +import com.webify.framework.triples.TripleStore; import com.webify.framework.triples.VersionInfo; -import com.webify.framework.triples.TripleStore; import java.net.URI; import java.util.List; @@ -114,12 +114,6 @@ MultiValueMap getAllProperties(final long version, final URI subject); - /** - * Attaches disconnected instances and {@link java.util.Collection}s - * of {@link IThing}s. Other types of objects are ignored. - */ - void attachDisconnected(Object disconnected); - long getCurrentVersion(); VersionInfo getCurrentVersionInfo(); --- //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/dbstore/HibernateModelFactory.java 2005/11/21 08:58:32 +++ //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/dbstore/HibernateModelFactory.java 2005/11/22 07:34:00 @@ -6,7 +6,6 @@ import com.webify.framework.model.ModelQuery; import com.webify.framework.model.NotFoundException; import com.webify.framework.model.proxy.ProxyHandlerContext; -import com.webify.framework.support.collections.IdentitySet; import com.webify.framework.support.trackingmap.TrackingMap; import com.webify.framework.triples.changes.TripleChanges; import com.webify.wsf.modelstore.impl.ModelAccessImpl; @@ -168,56 +167,6 @@ return version; } - /** - * @return non-null possibly empty collection - */ - private Collection getOtherThingsInCloud(final IThing thing) { - final HibernateInvocationHandler handler = HibernateInvocationHandler.handlerForThing(thing); - final Collection others = handler.getThingsInCloud(); - others.remove(thing); - return others; - } - - /** - * @param disconnected - * can be an {@link IThing}, a {@link Collection}or regular - * {@link Object} - */ - public void attachDisconnected(Object disconnected) { - HashSet things = new HashSet(); - findAllThingsInClouds(disconnected, new IdentitySet(), things); - if (GENERAL_LOG.isDebugEnabled()) { - GENERAL_LOG.debug("Reattaching: " + things); - } - for (Iterator i = things.iterator(); i.hasNext();) { - final IThing thing = (IThing) i.next(); - HibernateInvocationHandler handler = HibernateInvocationHandler.handlerForThing(thing); - handler.reattach(this); - } - } - - private void findAllThingsInClouds(final Object disconnected, - final Set visited, - final Set target) { - if (!visited.add(disconnected)) { - // already seen this object - return; - } - - if (disconnected instanceof Collection) { - final Collection collection = (Collection) disconnected; - for (Iterator i = collection.iterator(); i.hasNext();) { - findAllThingsInClouds(i.next(), visited, target); - } - } - else if (disconnected instanceof IThing) { - final IThing thing = (IThing) disconnected; - // no need to recurse into each because they all have the same cloud - target.add(thing); - target.addAll(getOtherThingsInCloud(thing)); - } - } - long getWorkingVersion() { // TODO implement getWorkingVersion properly. return ModelFactory.CURRENT_VERSION; @@ -250,7 +199,7 @@ final HibernateProxyBuilder builder = new HibernateProxyBuilder(); builder.setContext(this); if (typeUri == null) { - final TypeComputation tc = new TypeComputation(this, iface, properties); + final TypeComputation tc = new TypeComputation(this.getMetadataRegistry(), iface, properties); builder.setInterface(tc.deriveInterface()); builder.setTypeUri(tc.deriveType()); } --- //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/dbstore/TypeComputation.java 2005/11/21 08:58:32 +++ //depot/modules/cordoba/storage/modelstore/src/main/java/com/webify/framework/model/dbstore/TypeComputation.java 2005/11/22 07:34:00 @@ -4,7 +4,7 @@ import com.webify.framework.model.IThing; import com.webify.framework.model.PredicateConstants; import com.webify.framework.model.metadata.ClassInfo; -import com.webify.framework.model.proxy.ProxyHandlerContext; +import com.webify.framework.model.metadata.MetadataRegistry; import com.webify.framework.support.trackingmap.TrackingMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -21,7 +21,7 @@ * @author dranatunga * @version $Id: difflog.txt 349435 2005-11-28 17:01:05Z evenisse $ */ -class TypeComputation { +public class TypeComputation { private static final int NONE = 0; @@ -44,28 +44,28 @@ private int _ifaceState = NONE; private int _typeState = NONE; - private final ProxyHandlerContext _context; + private final MetadataRegistry _registry; private final Class _ifaceIn; private Class _bestIface; private URI _bestType; private final TrackingMap _knowledge; - TypeComputation(ProxyHandlerContext context, Class ifaceIn, TrackingMap knowledge) { + public TypeComputation(MetadataRegistry registry, Class ifaceIn, TrackingMap knowledge) { // TODO an instance can have more than one type, we need to account for this in our API - _context = context; + _registry = registry; _ifaceIn = ifaceIn; _knowledge = knowledge; _bestIface = ifaceIn; } - Class deriveInterface() { + public Class deriveInterface() { determineUsingInstanceAssociation(); // TODO determineUsingClassAssocation determineUsingTypeNameGuessing(); return _bestIface; } - URI deriveType() { + public URI deriveType() { determineUsingInstanceType(); determineUsingMetadataInfo(); return _bestType; @@ -141,7 +141,7 @@ ClassInfo mostSpecificType = null; for (Iterator i = _knowledge.getAll(PredicateConstants.TYPE_OF).iterator(); i.hasNext();) { URI oneDeclaredType = (URI) i.next(); - ClassInfo oneDeclaredInfo = _context.getMetadataRegistry().getClassInfo(oneDeclaredType); + ClassInfo oneDeclaredInfo = _registry.getClassInfo(oneDeclaredType); if ((mostSpecificType == null) || oneDeclaredInfo.getSuperClasses().contains(mostSpecificType)) { mostSpecificType = oneDeclaredInfo; } @@ -163,7 +163,7 @@ if (_typeState >= FOUND_FROM_ANNOTATION) { return; } - final ClassInfo classInfo = _context.getMetadataRegistry().getInterfaceInfo(_ifaceIn).getTypeInfo(); + final ClassInfo classInfo = _registry.getInterfaceInfo(_ifaceIn).getTypeInfo(); if ((classInfo == null) || (classInfo.getTypeUri() == null)) { return; } --- //depot/modules/cordoba/storage/modelstore/src/test/java/com/webify/framework/model/kowari/KowariModelFactoryTest.java 2005/11/14 14:53:49 +++ //depot/modules/cordoba/storage/modelstore/src/test/java/com/webify/framework/model/kowari/KowariModelFactoryTest.java 2005/11/21 10:29:33 @@ -1,23 +1,22 @@ package com.webify.framework.model.kowari; +import java.net.URI; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; -import java.net.URI; import com.webify.framework.model.IThing; import com.webify.framework.model.ModelFactory; import com.webify.framework.model.ModelQuery; import com.webify.framework.model.metadata.InterfaceInfo; import com.webify.framework.model.metadata.PropertyInfo; +import com.webify.framework.support.uri.URIs; import com.webify.framework.support.uuid.UUID; -import com.webify.framework.support.uri.URIs; +import com.webify.framework.test.ConfiguredCoreTest; +import com.webify.framework.test.ModelExistsCondition; import com.webify.framework.test.PreTestCondition; -import com.webify.framework.test.ModelExistsCondition; -import com.webify.framework.test.ConfiguredCoreTest; - import junit.framework.TestSuite; /** @@ -52,7 +51,6 @@ ts.addTest(new KowariModelFactoryTest("testModifyKnownSubject")); ts.addTest(new KowariModelFactoryTest("testListExisting")); ts.addTest(new KowariModelFactoryTest("testListLiterals")); - ts.addTest(new KowariModelFactoryTest("testSerializeThing")); ts.addTest(new KowariModelFactoryTest("testMetadataAccessFromThing")); return ts; } @@ -112,15 +110,6 @@ } - public void testSerializeThing() { - final IThing original = getModelFactory().load(IThing.class, EXISTING_THING); - final byte[] serialized = serialize(original); - final Object reloaded = deserialize(serialized); - assertEquals(original, reloaded); - // TODO lookup something off reloaded that would require it to be connected. - getModelFactory().attachDisconnected(reloaded); - } - public void testMetadataAccessFromThing() { final IThing created = getModelFactory().create(SampleCar.class, new UUID().toString()); final InterfaceInfo info = created.getInterfaceInfo(); ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/editlog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/editlog.tx0000644000175000017500000000055110342633721034016 0ustar twernertwerner//depot/modules/cordoba/storage/triplestore-spi/.classpath#7 - opened for edit ... //depot/modules/cordoba/storage/triplestore-spi/.classpath - also opened by arichardson@corkdog-wsf //depot/modules/cordoba/storage/triplestore-spi/.project#5 - opened for edit ... //depot/modules/cordoba/storage/triplestore-spi/.project - also opened by arichardson@corkdog-wsf././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/perforcelog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/perforcelo0000644000175000017500000000127411176353307034105 0ustar twernertwernerChange 13 on 2003/10/15 13:38:40 by jim@cpt-jcrossley Where's my change # Change 10 on 2003/10/15 07:14:46 by jim@jcrossley Added a linefeed at the end to see if the [noeol] descriptor goes away in vim. Change 9 on 2003/10/15 07:01:59 by jim@cpt-jcrossley Testing CR/LF resolution on different platforms Change 7 on 2003/10/01 16:24:20 by jim@cpt-jcrossley Backing out my test changes Updating a description Change 4 on 2003/10/01 08:35:08 by jim@cpt-jcrossley Another test Change 3 on 2003/10/01 08:29:15 by jim@cpt-jcrossley Testing review daemon Updating description Change 1 on 2003/08/07 17:21:57 by mcronin@mcronin demonstration of Perforce on Windows, Unix and VMS. ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/unedit_bad.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/unedit_bad0000644000175000017500000000013510342633721034031 0ustar twernertwerner.classpath - file(s) not opened on this client. .project - file(s) not opened on this client.././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_bad.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_ba0000644000175000017500000000052010342633721033777 0ustar twernertwernerChange 80837 created with 1 open file(s). Submitting change 80837. Locking 1 files ... edit //depot/modules/cordoba/runtime-ear/Foo.java#2 Submit validation failed -- fix problems then use 'p4 submit -c 80837'. 'checkstyle' validation failed: depot/modules/cordoba/runtime-ear/Foo.java:3:1: Got an exception - expecting EOF, found '}' ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_gooder.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_go0000644000175000017500000000024110414531524034020 0ustar twernertwernerChange 80835 created with 1 open file(s). Submitting change 80835. Locking 1 files ... add //depot/modules/cordoba/runtime-ear/foo.xml#1 Change 80835 submitted. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkin_go0000644000175000017500000000027210414531524034024 0ustar twernertwernerChange 80835 created with 1 open file(s). Submitting change 80835. Locking 1 files ... add //depot/modules/cordoba/runtime-ear/foo.xml#1 Change 94821 renamed change 94823 and submitted. ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/addlog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/addlog.txt0000644000175000017500000000021710641011426033776 0ustar twernertwerner//depot/something/foo.xml#1 - opened for add //depot/something/bar.xml#1 - opened for add //depot/scm-323/release-pom.xml#123 - opened for add ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/login_bad.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/login_bad.0000644000175000017500000000004110342633721033723 0ustar twernertwernerEnter password: Password invalid.././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/perforcedescribelog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/perforcede0000644000175000017500000000244611176353307034065 0ustar twernertwernerChange 13 by jim@cpt-jcrossley on 2003/10/15 13:38:40 Where's my change # Affected files ... ... //depot/test/junk/linefeed.txt#3 edit ... //depot/not-test/stuff.txt#1 add Change 10 by jim@jcrossley on 2003/10/15 07:14:46 Added a linefeed at the end to see if the [noeol] descriptor goes away in vim. Jobs fixed ... bug000001 on 2003/10/15 by jim *closed* Description of the bug Affected files ... ... //depot/test/junk/linefeed.txt#2 edit Change 9 by jim@cpt-jcrossley on 2003/10/15 07:01:59 Testing CR/LF resolution on different platforms Affected files ... ... //depot/test/junk/linefeed.txt#1 add Change 7 by jim@cpt-jcrossley on 2003/10/01 16:24:20 Backing out my test changes Updating a description Affected files ... ... //depot/test/demo/demo.c#4 edit Change 4 by jim@cpt-jcrossley on 2003/10/01 08:35:08 Another test Affected files ... ... //depot/test/demo/demo.c#3 edit Change 3 by jim@cpt-jcrossley on 2003/10/01 08:29:15 Testing review daemon Updating description Affected files ... ... //depot/test/demo/demo.c#2 edit Change 1 by mcronin@mcronin on 2003/08/07 17:21:57 demonstration of Perforce on Windows, Unix and VMS. Affected files ... ... //depot/test/demo/demo.c#1 add ... //depot/test/demo/dictcalls.txt#1 add ... //depot/test/demo/dictwords.txt#1 add ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/status_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/status_goo0000644000175000017500000000045610342633721034130 0ustar twernertwerner//depot/sandbox/mperham/scm-test/Foo.java#1 - add default change (text) //depot/sandbox/mperham/scm-test/bar/Bar.xml#1 - add default change (text) //depot/sandbox/mperham/scm-test/bar/foo.xml#1 - edit default change (text) //depot/sandbox/mperham/scm-test/bar/hello.xml#1 - delete default change (text)././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/tag_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/tag_good.t0000644000175000017500000000021010342633721033752 0ustar twernertwernerLabel maven-scm-test saved. //depot/modules/cordoba/runtime-ear/pom.xml#4 - added //depot/modules/cordoba/runtime-ear/.runtime#1 - added././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/unedit_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/unedit_goo0000644000175000017500000000024110342633721034065 0ustar twernertwerner//depot/modules/cordoba/storage/triplestore-spi/.classpath#7 - was edit, reverted //depot/modules/cordoba/storage/triplestore-spi/.project#5 - was edit, reverted././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkout_bad.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkout_b0000644000175000017500000000006410342633721034042 0ustar twernertwerner Invalid changelist/client/label/date '@somelabel'. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/tag_bad.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/tag_bad.tx0000644000175000017500000000013610342633721033747 0ustar twernertwernerLabel maven-scm-test saved. Label 'maven-scm-tes' unknown - use 'label' command to create it. ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/removelog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/removelog.0000644000175000017500000000024610342633721034013 0ustar twernertwerner//depot/something/foo.xml#1 - opened for delete //depot/something/bar.xml#123 - opened for delete ... //depot/something/bar.xml#123 - also opened by foobar@foomachine././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkout_good.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/resources/perforce/checkout_g0000644000175000017500000000070610342633721034052 0ustar twernertwerner//depot/modules/cordoba/runtime-ear/.j2ee#1 - deleted as d:\perforce\depot\modules\cordoba\runtime-ear\.j2ee //depot/modules/cordoba/runtime-ear/.project#1 - deleted as d:\perforce\depot\modules\cordoba\runtime-ear\.project //depot/modules/cordoba/runtime-ear/.runtime#1 - deleted as d:\perforce\depot\modules\cordoba\runtime-ear\.runtime //depot/modules/cordoba/runtime-ear/Foo.java#1 - deleted as d:\perforce\depot\modules\cordoba\runtime-ear\Foo.java maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/0000755000175000017500000000000011345536663027126 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/0000755000175000017500000000000011345536663027715 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/0000755000175000017500000000000011345536663031136 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/0000755000175000017500000000000011345536663032244 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536663033026 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/login/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/login/PerforceLoginConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000475310535556312033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.login; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumerTest.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceLoginConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/login_good.txt" ); PerforceLoginConsumer consumer = new PerforceLoginConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertEquals( "", consumer.getOutput() ); assertTrue( consumer.isSuccess() ); } public void testBadParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/login_bad.txt" ); PerforceLoginConsumer consumer = new PerforceLoginConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertFalse( consumer.isSuccess() ); assertTrue( consumer.getOutput().startsWith( "Password invalid." ) ); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/login/PerforceLoginCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000634311116057214033541 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.login; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceLoginCommandTest.java 723478 2008-12-04 22:49:48Z carlos $ */ public class PerforceLoginCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-login-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( cmdPrefix + " login" ); } /** * This test requires P4 installed * * @throws Exception */ public void disabledTestLoginWithoutPassword() throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository scmRepository = (PerforceScmProviderRepository) repository.getProviderRepository(); ScmFileSet fileSet = new ScmFileSet( new File( "." ) ); PerforceLoginCommand command = new PerforceLoginCommand(); ScmLogger logger = new DefaultLog(); command.setLogger( logger ); command.executeLoginCommand( scmRepository, fileSet, null ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository scmRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); //CommandParameters params = new CommandParameters(); Commandline cl = PerforceLoginCommand.createCommandLine( scmRepository, workingDirectory ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/PerforceInfoCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000465510613504337033551 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.tag.PerforceTagCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; /** * @author Trygve Laugstøl * @version $Id: PerforceScmProviderTest.java 372209 2006-01-25 13:30:01Z evenisse $ */ public class PerforceInfoCommandTest extends ScmTestCase { public void testPerforceInfo() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); PerforceScmProvider prov = new PerforceScmProvider(); PerforceTagCommand cmd = new PerforceTagCommand(); cmd.setLogger( prov.getLogger() ); if ( PerforceScmProvider.isLive() ) { assertNotNull( PerforceInfoCommand.getInfo( prov.getLogger(), p4Repo ).getEntry( "User name" ) ); assertNotNull( PerforceInfoCommand.getInfo( prov.getLogger(), p4Repo ).getEntry( "Client root" ) ); assertNotNull( PerforceInfoCommand.getInfo( prov.getLogger(), p4Repo ).getEntry( "Client name" ) ); assertNotNull( PerforceInfoCommand.getInfo( prov.getLogger(), p4Repo ).getEntry( "Client host" ) ); assertNull( PerforceInfoCommand.getInfo( prov.getLogger(), p4Repo ).getEntry( "foobar" ) ); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000701611015073323033534 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceCheckOutCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class PerforceCheckOutCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-checkout-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " -ctest-test-maven sync -f @somelabel" ); } public void testGetCommandLineWithHost() throws Exception { testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix + " -p a -u username -ctest-test-maven sync -f @somelabel" ); } public void testGetCommandLineWithHostAndPort() throws Exception { testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname", cmdPrefix + " -p myhost:1234 -u username -ctest-test-maven sync -f @somelabel" ); } public void testClean() { String generated = PerforceScmProvider.clean( "p4 -u mr -P mypass -cclient sync ..." ); assertEquals( "p4 -u mr -P ****** -cclient sync ...", generated ); assertEquals( "p4 sync ...", PerforceScmProvider.clean( "p4 sync ..." ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { workingDirectory.mkdirs(); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); Commandline cl = PerforceCheckOutCommand.createCommandLine( svnRepository, workingDirectory, new ScmRevision( "somelabel" ), "test-test-maven" ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000734210535556312033550 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: PerforceCheckOutConsumerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceCheckOutConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/checkout_good.txt" ); PerforceCheckOutConsumer consumer = new PerforceCheckOutConsumer( "test-test-maven", "//depot/modules" ); consumer.consumeLine( "Client test-test-maven saved." ); assertEquals( "", consumer.getOutput() ); assertTrue( consumer.isSuccess() ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertTrue( consumer.getOutput(), consumer.isSuccess() ); assertEquals( "", consumer.getOutput() ); assertEquals( 4, consumer.getCheckedout().size() ); ScmFile file = (ScmFile) consumer.getCheckedout().get( 0 ); assertEquals( "cordoba/runtime-ear/.j2ee", file.getPath() ); assertEquals( ScmFileStatus.DELETED, file.getStatus() ); } public void testBadParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/checkout_bad.txt" ); PerforceCheckOutConsumer consumer = new PerforceCheckOutConsumer( "test-test-maven", "//depot/modules" ); consumer.consumeLine( "Something bad happened." ); assertFalse( consumer.isSuccess() ); consumer = new PerforceCheckOutConsumer( "test-test-maven", "" ); consumer.consumeLine( "Client test-test-maven saved." ); assertTrue( consumer.isSuccess() ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertFalse( consumer.getOutput(), consumer.isSuccess() ); assertTrue( consumer.getOutput(), consumer.getOutput().length() > 0 ); assertContains( consumer.getOutput(), "Invalid" ); assertContains( consumer.getOutput(), "somelabel" ); } private void assertContains( String block, String element ) { if ( block.indexOf( element ) == -1 ) { fail( "Block '" + block + "' does not contain element '" + element + "'" ); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/status/PerforceStatusConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000506210535556312033545 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumerTest.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceStatusConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/status_good.txt" ); PerforceStatusConsumer consumer = new PerforceStatusConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertEquals( "", consumer.getOutput() ); assertTrue( consumer.isSuccess() ); List results = consumer.getDepotfiles(); assertEquals( "Wrong number of entries returned", 4, results.size() ); String entry = (String) results.get( 0 ); assertEquals( 33, entry.indexOf( "Foo.java" ) ); results = PerforceStatusCommand.createResults( "//depot/sandbox/mperham/scm-test", consumer ); assertEquals( 4, results.size() ); assertTrue( results.get( 0 ) instanceof ScmFile ); ScmFile file = (ScmFile) results.get( 0 ); assertEquals( "Foo.java", file.getPath() ); assertEquals( ScmFileStatus.ADDED, file.getStatus() ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/status/PerforceStatusCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000500311015073323033526 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.status; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceChangeLogCommandTest.java 162277 2005-01-11 19:02:26Z * trygvis $ */ public class PerforceStatusCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-tag-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testCreateCommandLine() throws Exception { testCommandLine( cmdPrefix + " opened //depot/projects/pathname/..." ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); Commandline cl = PerforceStatusCommand.createOpenedCommandLine( svnRepository, workingDirectory, "//depot/projects/pathname" ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/unedit/PerforceUnEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000521311016330232033525 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceUnEditCommandTest.java 660011 2008-05-25 18:31:54Z hboutemy $ */ public class PerforceUnEditCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-unedit-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " revert foo.xml bar.xml" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl = PerforceUnEditCommand.createCommandLine( svnRepository, workingDirectory, files ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/unedit/PerforceUnEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000556010535556312033550 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumerTest.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceUnEditConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/unedit_good.txt" ); PerforceUnEditConsumer consumer = new PerforceUnEditConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertTrue( consumer.isSuccess() ); List edits = consumer.getEdits(); assertEquals( "Wrong number of entries returned", 2, edits.size() ); String entry = (String) edits.get( 0 ); assertTrue( entry.startsWith( "//" ) ); assertTrue( entry.endsWith( ".classpath" ) ); } public void testBadParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/unedit_bad.txt" ); PerforceUnEditConsumer consumer = new PerforceUnEditConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertFalse( consumer.isSuccess() ); assertTrue( consumer.getOutput().indexOf( ".classpath - file(s) not opened on this client." ) == 0 ); assertTrue( consumer.getOutput().indexOf( ".project - file(s) not opened on this client." ) > 0 ); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/remove/PerforceRemoveCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000621611016330232033531 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceRemoveCommandTest.java 660011 2008-05-25 18:31:54Z hboutemy $ */ public class PerforceRemoveCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-remove-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " delete foo.xml bar.xml" ); } public void testGetCommandLineWithHost() throws Exception { testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix + " -p a -u username delete foo.xml bar.xml" ); } public void testGetCommandLineWithHostAndPort() throws Exception { testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname", cmdPrefix + " -p myhost:1234 -u username delete foo.xml bar.xml" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl = PerforceRemoveCommand.createCommandLine( svnRepository, workingDirectory, files ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/remove/PerforceRemoveConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000404210535556312033542 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.remove; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceRemoveConsumerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceRemoveConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/removelog.txt" ); PerforceRemoveConsumer consumer = new PerforceRemoveConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } List removes = consumer.getRemovals(); assertEquals( "Wrong number of entries returned", 2, removes.size() ); String entry = (String) removes.get( 0 ); assertTrue( entry.startsWith( "//" ) ); assertTrue( entry.endsWith( "foo.xml" ) ); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000541710535556312033551 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.tag; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumerTest.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceTagConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/tag_good.txt" ); PerforceTagConsumer consumer = new PerforceTagConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertEquals( "", consumer.getOutput() ); assertTrue( consumer.isSuccess() ); List results = consumer.getTagged(); assertEquals( "Wrong number of entries returned", 2, results.size() ); String entry = (String) results.get( 0 ); assertTrue( entry.endsWith( "pom.xml" ) ); } public void testBadParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/tag_bad.txt" ); PerforceTagConsumer consumer = new PerforceTagConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertFalse( consumer.isSuccess() ); assertTrue( consumer.getOutput().startsWith( "Label 'maven-scm-tes' unknown - use 'label' command to create it." ) ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000554411016330232033534 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceChangeLogCommandTest.java 162277 2005-01-11 19:02:26Z * trygvis $ */ public class PerforceTagCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-tag-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testCreateCommandLine() throws Exception { testCommandLine( "foo-tag", cmdPrefix + " label -i", cmdPrefix + " labelsync -l foo-tag foo.xml bar.xml" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String tag, String create, String sync ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl1 = PerforceTagCommand.createLabelCommandLine( svnRepository, workingDirectory ); assertCommandLine( create, null, cl1 ); Commandline cl2 = PerforceTagCommand.createLabelsyncCommandLine( svnRepository, workingDirectory, files, tag ); assertCommandLine( sync, null, cl2 ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000741411016330232033532 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceCheckInCommandTest.java 660011 2008-05-25 18:31:54Z hboutemy $ */ public class PerforceCheckInCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-checkin-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " submit -i" ); } public void testGetCommandLineWithHost() throws Exception { testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix + " -p a -u username submit -i" ); } public void testGetCommandLineWithHostAndPort() throws Exception { testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname", cmdPrefix + " -p myhost:1234 -u username submit -i" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl = PerforceCheckInCommand.createCommandLine( svnRepository, workingDirectory ); assertCommandLine( commandLine, null, cl ); String change = PerforceCheckInCommand.createChangeListSpecification( svnRepository, files, "Test checkin", "//depot/projects/pathname", "testjob" ); assertContains( change, "//depot/projects/pathname/foo.xml" ); assertContains( change, "//depot/projects/pathname/bar.xml" ); assertContains( change, "Test checkin" ); assertContains( change, "testjob" ); } private void assertContains( String block, String element ) { if ( block.indexOf( element ) == -1 ) { fail( "Block '" + block + "' does not contain element '" + element + "'" ); } } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000624210535556312033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: PerforceCheckInConsumerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceCheckInConsumerTest extends ScmTestCase { public void testGoodParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/checkin_good.txt" ); PerforceCheckInConsumer consumer = new PerforceCheckInConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertTrue( consumer.getOutput(), consumer.isSuccess() ); assertEquals( "", consumer.getOutput() ); } public void testGooderParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/checkin_gooder.txt" ); PerforceCheckInConsumer consumer = new PerforceCheckInConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertTrue( consumer.getOutput(), consumer.isSuccess() ); assertEquals( "", consumer.getOutput() ); } public void testBadParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/checkin_bad.txt" ); PerforceCheckInConsumer consumer = new PerforceCheckInConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertFalse( consumer.getOutput(), consumer.isSuccess() ); assertTrue( consumer.getOutput(), consumer.getOutput().length() > 0 ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000524211016330232033527 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.edit; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceEditCommandTest.java 660011 2008-05-25 18:31:54Z hboutemy $ */ public class PerforceEditCommandTest extends ScmTestCase { private static final File workingDir = new File( "." ); private static final String cmdPrefix = "p4 -d " + workingDir.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " edit foo.xml bar.xml" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { //File workingDirectory = getTestFile( "target/perforce-edit-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl = PerforceEditCommand.createCommandLine( svnRepository, workingDir, files ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000402010535556312033536 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.edit; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceEditConsumerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceEditConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/editlog.txt" ); PerforceEditConsumer consumer = new PerforceEditConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } List edits = consumer.getEdits(); assertEquals( "Wrong number of entries returned", 2, edits.size() ); String entry = (String) edits.get( 0 ); assertTrue( entry.startsWith( "//" ) ); assertTrue( entry.endsWith( ".classpath" ) ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000543411161162004033533 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.diff; /* * 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. */ import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceDiffCommandTest.java 756929 2009-03-21 12:56:36Z olamy $ */ public class PerforceDiffCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-diff-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( new ScmRevision( "somelabel" ), null, cmdPrefix + " diff2 -u ...@somelabel ...@now" ); } public void testGetCommandLineWithRevs() throws Exception { testCommandLine( new ScmRevision( "somelabel" ), new ScmRevision( "someend" ), cmdPrefix + " diff2 -u ...@somelabel ...@someend" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( ScmVersion startRev, ScmVersion endRev, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository .getProviderRepository(); Commandline cl = PerforceDiffCommand.createCommandLine( svnRepository, workingDirectory, startRev, endRev ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000375410535556312033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.diff; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; /** * @author Emmanuel Venisse * @version $Id: PerforceDiffConsumerTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceDiffConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/difflog.txt" ); PerforceDiffConsumer consumer = new PerforceDiffConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } // Linebreak differences will fail if we try to assert // the exact file length so we just use a rough approximation. assertTrue( consumer.getOutput().length() > 12500 ); assertTrue( consumer.getOutput().length() < 13500 ); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceDescribeConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000544211176353307033550 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList; /** * @author Emmanuel Venisse * @version $Id: PerforceDescribeConsumerTest.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceDescribeConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/perforcedescribelog.txt" ); PerforceDescribeConsumer consumer = new PerforceDescribeConsumer( "//depot/test", null, new DefaultLog() ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } ArrayList entries = new ArrayList( consumer.getModifications() ); assertEquals( "Wrong number of entries returned", 7, entries.size() ); ChangeSet entry = (ChangeSet) entries.get(0); assertEquals( "mcronin", entry.getAuthor() ); assertEquals( "Wrong number of files returned", 3, entry.getFiles().size() ); assertEquals( "demo/demo.c", ( (ChangeFile) entry.getFiles().get( 0 ) ).getName() ); assertEquals( "2003-08-07", entry.getDateFormatted() ); assertEquals( "17:21:57", entry.getTimeFormatted() ); entry = (ChangeSet) entries.get(6); assertEquals( "jim", entry.getAuthor() ); assertEquals( "Wrong number of files returned", 1, entry.getFiles().size() ); assertEquals( "junk/linefeed.txt", ( (ChangeFile) entry.getFiles().get( 0 ) ).getName() ); } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000425011176353307033544 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.ArrayList; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumerTest.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceChangeLogConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/perforcelog.txt" ); PerforceChangesConsumer consumer = new PerforceChangesConsumer( new DefaultLog() ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } ArrayList entries = new ArrayList( consumer.getChanges() ); assertEquals( "Wrong number of entries returned", 7, entries.size() ); String changelist = (String) entries.get(2); assertEquals( "9", changelist ); } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001235711176353307033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceChangeLogCommandTest.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceChangeLogCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-changelog-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " changes -t ..." ); } public void testGetCommandLineWithHost() throws Exception { testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix + " -p a -u username changes -t ..." ); } public void testGetCommandLineWithHostAndPort() throws Exception { System.setProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY, "foo" ); testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname", cmdPrefix + " -p myhost:1234 -u username -c foo changes -t ..." ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository repo = (PerforceScmProviderRepository) repository.getProviderRepository(); Commandline cl = PerforceChangeLogCommand.createCommandLine( repo, workingDirectory, System.getProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY ), null, null, null, null, null ); assertCommandLine( commandLine, null, cl ); } public void testGetCommandLineWithStartAndEndDates() throws Exception { System.setProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY, "foo" ); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); testCommandLineDates( cmdPrefix + " -c foo changes -t ...@2008/07/15:00:00:00,2008/07/16:00:00:00", sdf.parse("2008/07/15 00:00:00"), sdf.parse("2008/07/16 00:00:00") ); } public void testGetCommandLineWithStartAndEndChangelists() throws Exception { System.setProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY, "foo" ); testCommandLineRevs( cmdPrefix + " -c foo changes -t ...@123456,234567", new ScmRevision( "123456" ), new ScmRevision( "234567" ) ); } private void testCommandLineRevs( String commandLine, ScmVersion version1, ScmVersion version2 ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname"); PerforceScmProviderRepository repo = (PerforceScmProviderRepository) repository.getProviderRepository(); Commandline cl = PerforceChangeLogCommand.createCommandLine( repo, workingDirectory, System.getProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY ), null, null, null, version1, version2 ); assertCommandLine( commandLine, null, cl ); } private void testCommandLineDates( String commandLine, Date date1, Date date2 ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( "scm:perforce://depot/projects/pathname"); PerforceScmProviderRepository repo = (PerforceScmProviderRepository) repository.getProviderRepository(); Commandline cl = PerforceChangeLogCommand.createCommandLine( repo, workingDirectory, System.getProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY ), null, date1, date2, null, null ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033547 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/add/PerforceAddConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000401210641011426033525 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.add; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceAddConsumerTest.java 551686 2007-06-28 19:59:18Z pschneider $ */ public class PerforceAddConsumerTest extends ScmTestCase { public void testParse() throws Exception { File testFile = getTestFile( "src/test/resources/perforce/addlog.txt" ); PerforceAddConsumer consumer = new PerforceAddConsumer(); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } List adds = consumer.getAdditions(); assertEquals( "Wrong number of entries returned", 3, adds.size() ); String entry = (String) adds.get( 0 ); assertTrue( entry.startsWith( "//" ) ); assertTrue( entry.endsWith( "foo.xml" ) ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/add/PerforceAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000616711016330232033536 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.add; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: PerforceAddCommandTest.java 660011 2008-05-25 18:31:54Z hboutemy $ */ public class PerforceAddCommandTest extends ScmTestCase { private static final File workingDirectory = getTestFile( "target/perforce-add-command-test" ); private static final String cmdPrefix = "p4 -d " + workingDirectory.getAbsolutePath(); public void testGetCommandLine() throws Exception { testCommandLine( "scm:perforce://depot/projects/pathname", cmdPrefix + " add foo.xml bar.xml" ); } public void testGetCommandLineWithHost() throws Exception { testCommandLine( "scm:perforce:a:username@//depot/projects/pathname", cmdPrefix + " -p a -u username add foo.xml bar.xml" ); } public void testGetCommandLineWithHostAndPort() throws Exception { testCommandLine( "scm:perforce:myhost:1234:username@//depot/projects/pathname", cmdPrefix + " -p myhost:1234 -u username add foo.xml bar.xml" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); PerforceScmProviderRepository svnRepository = (PerforceScmProviderRepository) repository.getProviderRepository(); ScmFileSet files = new ScmFileSet( new File( "." ), Arrays.asList( new File[] { new File( "foo.xml" ), new File( "bar.xml" ) } ) ); Commandline cl = PerforceAddCommand.createCommandLine( svnRepository, workingDirectory, files ); assertCommandLine( commandLine, null, cl ); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/PerforceScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001277110535556312033552 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; /** * @author Trygve Laugstøl * @version $Id: PerforceScmProviderTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceScmProviderTest extends ScmTestCase { public void testParseConnection() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertNull( p4Repo.getHost() ); assertEquals( 0, p4Repo.getPort() ); assertNull( p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithUsername() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:username@//depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertNull( p4Repo.getHost() ); assertEquals( 0, p4Repo.getPort() ); assertEquals( "username", p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithHostPortAndUsername() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:host:1234:username@//depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertEquals( "host", p4Repo.getHost() ); assertEquals( 1234, p4Repo.getPort() ); assertEquals( "username", p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithHostAndPort() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:host:1234://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertEquals( "host", p4Repo.getHost() ); assertEquals( 1234, p4Repo.getPort() ); assertNull( p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithHostPortAndUsername2() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:username@host:1234://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertEquals( "host", p4Repo.getHost() ); assertEquals( 1234, p4Repo.getPort() ); assertEquals( "username", p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithHostAndUsername() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:username@host://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertEquals( "host", p4Repo.getHost() ); assertEquals( 0, p4Repo.getPort() ); assertEquals( "username", p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testParseConnectionWithHost() throws Exception { ScmRepository repo = makeScmRepository( "scm:perforce:host://depot/projects/pathname" ); PerforceScmProviderRepository p4Repo = (PerforceScmProviderRepository) repo.getProviderRepository(); assertEquals( "host", p4Repo.getHost() ); assertEquals( 0, p4Repo.getPort() ); assertNull( p4Repo.getUser() ); assertNull( p4Repo.getPassword() ); assertEquals( "//depot/projects/pathname", p4Repo.getPath() ); } public void testRepositoryPathCanonicalization() { assertEquals( "//depot/foo/bar/...", PerforceScmProvider.getCanonicalRepoPath( "//depot/foo/bar" ) ); assertEquals( "//depot/foo/bar/...", PerforceScmProvider.getCanonicalRepoPath( "//depot/foo/bar/" ) ); assertEquals( "//depot/foo/bar/...", PerforceScmProvider.getCanonicalRepoPath( "//depot/foo/bar/..." ) ); } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/0000755000175000017500000000000011345536663026152 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/0000755000175000017500000000000011345536663027073 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/0000755000175000017500000000000011345536663027662 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/0000755000175000017500000000000011345536663031103 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/0000755000175000017500000000000011345536663032211 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536663032773 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/login/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/login/PerforceLoginCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001014111161137405033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.login; /* * 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. */ import java.io.File; import java.io.StringBufferInputStream; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.login.AbstractLoginCommand; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Mike Perham * @version $Id: PerforceLoginCommand.java 756909 2009-03-21 10:18:45Z olamy $ */ public class PerforceLoginCommand extends AbstractLoginCommand implements PerforceCommand { /** {@inheritDoc} */ public LoginScmResult executeLoginCommand( ScmProviderRepository repo, ScmFileSet files, CommandParameters params ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir() ); PerforceLoginConsumer consumer = new PerforceLoginConsumer(); boolean isSuccess = false; try { String password = repo.getPassword(); if ( StringUtils.isEmpty( password ) ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "No password found, proceeding without it." ); } isSuccess = true; } else { CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, new StringBufferInputStream( password ), consumer, err ); isSuccess = consumer.isSuccess(); if ( !isSuccess ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } } catch ( CommandLineException e ) { throw new ScmException( e.getMessage(), e ); } return new LoginScmResult( cl.toString(), isSuccess ? "Login successful" : "Login failed", consumer.getOutput(), isSuccess ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDir ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDir ); command.createArg().setValue( "login" ); if ( !StringUtils.isEmpty( repo.getUser() ) ) { command.createArg().setValue( repo.getUser() ); } return command; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/login/PerforceLoginConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000373111050561465033511 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.login; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.regexp.RE; import org.codehaus.plexus.util.cli.StreamConsumer; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceLoginConsumer extends AbstractPerforceConsumer implements StreamConsumer { private static final String LOGIN_PATTERN = "^User [^ ]+ logged in.$"; public static final int STATE_LOGIN = 1; public static final int STATE_ERROR = 2; private int currentState = STATE_LOGIN; /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( "Enter password:" ) ) { return; } if ( currentState != STATE_ERROR && new RE( LOGIN_PATTERN ).match( line ) ) { return; } error( line ); } private void error( String line ) { currentState = STATE_ERROR; output.println( line ); } public boolean isSuccess() { return currentState == STATE_LOGIN; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/PerforceVerbMapper.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000445011051357615033511 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ import org.apache.maven.scm.ScmFileStatus; import java.util.HashMap; import java.util.Map; /** * @author mperham * @version $Id: PerforceVerbMapper.java 686352 2008-08-15 19:57:01Z vsiveton $ */ public class PerforceVerbMapper { private static final Map VERB = new HashMap(); static { // Perforce uses different tenses sometimes so we need to map // the different tenses to the same status. VERB.put( "add", ScmFileStatus.ADDED ); VERB.put( "added", ScmFileStatus.ADDED ); VERB.put( "delete", ScmFileStatus.DELETED ); VERB.put( "deleted", ScmFileStatus.DELETED ); VERB.put( "edit", ScmFileStatus.MODIFIED ); VERB.put( "edited", ScmFileStatus.MODIFIED ); VERB.put( "updating", ScmFileStatus.UPDATED ); VERB.put( "updated", ScmFileStatus.UPDATED ); // UNKNOWN means we just ignore this verb VERB.put( "refreshing", ScmFileStatus.UNKNOWN ); } public static ScmFileStatus toStatus( String verb ) { ScmFileStatus stat = (ScmFileStatus) VERB.get( verb ); if ( stat == null ) { // XXX testing only System.err.println( "No such verb: " + verb ); return ScmFileStatus.UNKNOWN; } if ( stat == ScmFileStatus.UNKNOWN ) { // Return a null status in cases where the verb does not indicate a status change. stat = null; } return stat; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/AbstractPerforceConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000257010535556312033513 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.PrintWriter; import java.io.StringWriter; /** * @author mperham * @version $Id: AbstractPerforceConsumer.java 483105 2006-12-06 15:07:54Z evenisse $ */ public abstract class AbstractPerforceConsumer implements StreamConsumer { private StringWriter out = new StringWriter(); protected PrintWriter output = new PrintWriter( out ); public String getOutput() { output.flush(); out.flush(); return out.toString(); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/PerforceInfoCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001317711057615201033511 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; /** * Encapsulates the 'p4 info' command which can be very useful in determining * the runtime environment. Use getEntry(String key) to query * the info set for a particular property. The data from p4 info looks like this: *

*

 * User name: mperham
 * Client name: mikeperham-dt
 * Client host: mikeperham-dt
 * Client root: d:\perforce
 * 
*

* where the key is the content before the first colon and the value is the data after * the first colon, trimmed. For example: * PerforceInfoCommand.getInfo( this, repo ).getEntry( "User name" ) *

* Note that this is not a traditional SCM command. This uses the Command class * simply because it needs a logger for error handling and the current repository data for * command line creation. * * @author mperham * @version $Id: $ */ public class PerforceInfoCommand extends AbstractCommand implements PerforceCommand { private static PerforceInfoCommand singleton = null; private Map entries = null; public static PerforceInfoCommand getInfo( ScmLogger logger, PerforceScmProviderRepository repo ) { return getSingleton( logger, repo ); } public String getEntry( String key ) { return (String) entries.get( key ); } private static synchronized PerforceInfoCommand getSingleton( ScmLogger logger, PerforceScmProviderRepository repo ) { if ( singleton == null ) { PerforceInfoCommand pic = new PerforceInfoCommand(); if ( logger != null ) { pic.setLogger( logger ); } try { pic.executeCommand( repo, null, null ); singleton = pic; } catch ( ScmException e ) { if ( pic.getLogger().isErrorEnabled() ) { pic.getLogger().error( "ScmException " + e.getMessage(), e ); } } } return singleton; } /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repo, ScmFileSet scmFileSet, CommandParameters commandParameters ) throws ScmException { if ( !PerforceScmProvider.isLive() ) { return null; } try { Commandline command = PerforceScmProvider.createP4Command( (PerforceScmProviderRepository) repo, null ); command.createArg().setValue( "info" ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing: " + command.toString() ) ); } Process proc = command.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); String line; entries = new HashMap(); while ( ( line = br.readLine() ) != null ) { int idx = line.indexOf( ':' ); if ( idx == -1 ) { if ( line.indexOf( "Client unknown." ) == -1 ) { throw new IllegalStateException( "Unexpected results from 'p4 info' command: " + line ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Cannot find client." ); } entries.put( "Client root", "" ); } else { String key = line.substring( 0, idx ); String value = line.substring( idx + 1 ).trim(); entries.put( key, value ); } } } catch ( CommandLineException e ) { throw new ScmException( e.getLocalizedMessage() ); } catch ( IOException e ) { throw new ScmException( e.getLocalizedMessage() ); } return null; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/update/PerforceUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001335411176353307033516 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.update; /* * 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. */ import org.apache.maven.scm.CommandParameter; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.command.changelog.PerforceChangeLogCommand; import org.apache.maven.scm.provider.perforce.command.checkout.PerforceCheckOutCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mike Perham * @version $Id: PerforceUpdateCommand.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceUpdateCommand extends AbstractUpdateCommand implements PerforceCommand { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet files, ScmVersion scmVersion ) throws ScmException { // In Perforce, there is no difference between update and checkout. // Here we just run the checkout command and map the result onto an // UpdateScmResult. PerforceCheckOutCommand command = new PerforceCheckOutCommand(); command.setLogger( getLogger() ); CommandParameters params = new CommandParameters(); params.setScmVersion( CommandParameter.SCM_VERSION, scmVersion ); CheckOutScmResult cosr = (CheckOutScmResult) command.execute( repo, files, params ); if ( !cosr.isSuccess() ) { return new UpdateScmResult( cosr.getCommandLine(), cosr.getProviderMessage(), cosr.getCommandOutput(), false ); } PerforceScmProviderRepository p4repo = (PerforceScmProviderRepository) repo; String clientspec = PerforceScmProvider.getClientspecName( getLogger(), p4repo, files.getBasedir() ); Commandline cl = createCommandLine( p4repo, files.getBasedir(), clientspec ); String location = PerforceScmProvider.getRepoPath( getLogger(), p4repo, files.getBasedir() ); PerforceHaveConsumer consumer = new PerforceHaveConsumer( getLogger() ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return new UpdateScmResultWithRevision( cosr.getCommandLine(), cosr.getCheckedOutFiles(), String.valueOf( consumer.getHave() ) ); } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { PerforceChangeLogCommand command = new PerforceChangeLogCommand(); command.setLogger( getLogger() ); return command; } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, String clientspec ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); if ( clientspec != null ) { command.createArg().setValue( "-c" ); command.createArg().setValue( clientspec ); } command.createArg().setValue( "changes" ); command.createArg().setValue( "-m1" ); command.createArg().setValue( "-ssubmitted" ); command.createArg().setValue( "//" + clientspec + "/...#have" ); return command; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/update/PerforceHaveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000511511176353307033512 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.update; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceHaveConsumer.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceHaveConsumer extends AbstractConsumer { private String have; /** * The regular expression used to match header lines */ private RE revisionRegexp; private static final String PATTERN = "^Change (\\d+) " + // changelist number "on (.*) " + // date "by (.*)@"; // author public PerforceHaveConsumer( ScmLogger logger ) { super( logger ); try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Could not create regexp to parse perforce log file", ignored ); } } } public String getHave() throws ScmException { return have; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if( revisionRegexp.match( line ) ) { have = revisionRegexp.getParen( 1 ); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000003432611176353307033520 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkout; /* * 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. */ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.StringBufferInputStream; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.apache.regexp.RE; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.StringBufferInputStream; /** * @author Mike Perham * @version $Id: PerforceCheckOutCommand.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceCheckOutCommand extends AbstractCheckOutCommand implements PerforceCommand { private String actualLocation; /** * Check out the depot code at repo.getPath() into the target * directory at files.getBasedir. Perforce does not support * arbitrary checkout of versioned source so we need to set up a well-known * clientspec which will hold the required info. *

* 1) A clientspec will be created or updated which holds a temporary * mapping from the repo path to the target directory. * 2) This clientspec is sync'd to pull all the files onto the client * * {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet files, ScmVersion version, boolean recursive ) throws ScmException { PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; File workingDirectory = new File( files.getBasedir().getAbsolutePath() ); actualLocation = PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ); String specname = PerforceScmProvider.getClientspecName( getLogger(), prepo, workingDirectory ); PerforceCheckOutConsumer consumer = new PerforceCheckOutConsumer( specname, actualLocation ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Checkout working directory: " + workingDirectory ); } Commandline cl = null; // Create or update a clientspec so we can checkout the code to a particular location try { // Ahhh, glorious Perforce. Create and update of clientspecs is the exact // same operation so we don't need to distinguish between the two modes. cl = PerforceScmProvider.createP4Command( prepo, workingDirectory ); cl.createArg().setValue( "client" ); cl.createArg().setValue( "-i" ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + PerforceScmProvider.clean( cl.toString() ) ); } String client = PerforceScmProvider.createClientspec( getLogger(), prepo, workingDirectory, actualLocation ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Updating clientspec:\n" + client ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, new StringBufferInputStream(client), consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } boolean clientspecExists = consumer.isSuccess(); // Perform the actual checkout using that clientspec try { if ( clientspecExists ) { try { int lastChangelist = getLastChangelist( prepo, workingDirectory, specname ); cl = createCommandLine( prepo, workingDirectory, version, specname ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + PerforceScmProvider.clean( cl.toString() ) ); } Process proc = cl.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); String line; while ( ( line = br.readLine() ) != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consuming: " + line ); } consumer.consumeLine( line ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Perforce sync complete." ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } catch ( IOException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "IOException " + e.getMessage(), e ); } } } if ( consumer.isSuccess() ) { return new CheckOutScmResult( cl.toString(), consumer.getCheckedout() ); } else { return new CheckOutScmResult( cl.toString(), "Unable to sync. Are you logged in?", consumer .getOutput(), consumer.isSuccess() ); } } finally { // See SCM-113 // Support transient clientspecs as we don't want to create 1000s of permanent clientspecs if ( clientspecExists && !prepo.isPersistCheckout() ) { // Delete the clientspec try { cl = PerforceScmProvider.createP4Command( prepo, workingDirectory ); cl.createArg().setValue( "client" ); cl.createArg().setValue( "-d" ); cl.createArg().setValue( specname ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + PerforceScmProvider.clean( cl.toString() ) ); } Process proc = cl.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); String line; while ( ( line = br.readLine() ) != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consuming: " + line ); } consumer.consumeLine( line ); } br.close(); // Read errors from STDERR BufferedReader brErr = new BufferedReader( new InputStreamReader( proc.getErrorStream() ) ); while ( ( line = brErr.readLine() ) != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consuming stderr: " + line ); } consumer.consumeLine( line ); } brErr.close(); } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } catch ( IOException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "IOException " + e.getMessage(), e ); } } } else if ( clientspecExists ) { // SCM-165 Save clientspec in memory so we can reuse it with further commands in this VM. System.setProperty( PerforceScmProvider.DEFAULT_CLIENTSPEC_PROPERTY, specname ); } } } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmVersion version, String specname ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "-c" + specname ); command.createArg().setValue( "sync" ); // Use a simple heuristic to determine if we should use the Force flag // on sync. Forcing sync is a HUGE performance hit but is required in // rare instances where source is somehow deleted. If the target // directory is completely empty, assume a force is required. If // not empty, we assume a previous checkout was already done and a normal // sync will suffice. // SCM-110 String[] files = workingDirectory.list(); if ( files == null || files.length == 0 ) { // We need to force so checkout to an empty directory will work. command.createArg().setValue( "-f" ); } // Not sure what to do here. I'm unclear whether we should be // sync'ing each file individually to the label or just sync the // entire contents of the workingDir. I'm going to assume the // latter until the exact semantics are clearer. if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { command.createArg().setValue( "@" + version.getName() ); } return command; } private int getLastChangelist( PerforceScmProviderRepository repo, File workingDirectory, String specname ) { int lastChangelist = 0; try { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArgument().setValue( "-c" + specname ); command.createArgument().setValue( "changes" ); command.createArgument().setValue( "-m1" ); command.createArgument().setValue( "-ssubmitted" ); command.createArgument().setValue( "//" + specname + "/..." ); getLogger().debug( "Executing: " + PerforceScmProvider.clean( command.toString() ) ); Process proc = command.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); String line; String lastChangelistStr = ""; while ( ( line = br.readLine() ) != null ) { getLogger().debug( "Consuming: " + line ); RE changeRegexp = new RE( "Change (\\d+)" ); if ( changeRegexp.match( line ) ) { lastChangelistStr = changeRegexp.getParen( 1 ); } } br.close(); // TODO: Read errors from STDERR? try { lastChangelist = Integer.parseInt(lastChangelistStr); } catch( NumberFormatException nfe ) { getLogger().debug("Could not parse changelist from line " + line); } } catch ( IOException e ) { getLogger().error( e ); } catch ( CommandLineException e ) { getLogger().error( e ); } return lastChangelist; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkout/PerforceCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001113311176353307033507 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.maven.scm.provider.perforce.command.PerforceVerbMapper; import org.apache.regexp.RE; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceCheckOutConsumer extends AbstractPerforceConsumer implements StreamConsumer { public static final int STATE_CLIENTSPEC = 0; public static final int STATE_NORMAL = 1; public static final int STATE_ERROR = 2; private int currentState = STATE_CLIENTSPEC; private RE fileRegexp = new RE( "([^#]+)#\\d+ - ([a-z]+)" ); private List checkedout = new ArrayList(); private String repo = null; private String specname = null; public PerforceCheckOutConsumer( String clientspec, String repoPath ) { repo = repoPath; specname = clientspec; } /* * Client mperham-mikeperham-dt-maven saved. */ /* * //depot/modules/cordoba/runtime-ear/.j2ee#1 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\.j2ee * //depot/modules/cordoba/runtime-ear/.project#1 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\.project * //depot/modules/cordoba/runtime-ear/.runtime#1 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\.runtime * //depot/modules/cordoba/runtime-ear/Foo.java#1 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\Foo.java * //depot/modules/cordoba/runtime-ear/META-INF/.modulemaps#1 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\META-INF\.modulemaps * //depot/modules/cordoba/runtime-ear/META-INF/application.xml#1 - deleted * as d:\perforce\depot\modules\cordoba\runtime-ear\META-INF\application.xml * //depot/modules/cordoba/runtime-ear/pom.xml#4 - deleted as * d:\perforce\depot\modules\cordoba\runtime-ear\pom.xml */ /* * Invalid changelist/client/label/date '@somelabel'. */ /** {@inheritDoc} */ public void consumeLine( String line ) { if ( currentState == STATE_CLIENTSPEC && ( line.startsWith( "Client " + specname + " saved." ) || line.startsWith( "Client " + specname + " not changed." ) ) ) { currentState = STATE_NORMAL; return; } // Handle case where the clientspec is current if ( currentState == STATE_NORMAL && line.indexOf( "ile(s) up-to-date" ) != -1 ) { return; } if ( currentState != STATE_ERROR && fileRegexp.match( line ) ) { String location = fileRegexp.getParen( 1 ); if ( location.startsWith( repo ) ) { location = location.substring( repo.length() + 1 ); } ScmFileStatus status = PerforceVerbMapper.toStatus( fileRegexp.getParen( 2 ) ); if ( status != null ) { // there are cases where Perforce prints out something but the file did not // actually change (especially when force syncing). Those files will have // a null status. checkedout.add( new ScmFile( location, status ) ); } return; } error( line ); } private void error( String line ) { currentState = STATE_ERROR; output.println( line ); } public boolean isSuccess() { return currentState == STATE_NORMAL; } public List getCheckedout() { return checkedout; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/status/PerforceStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000463711050561465033517 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.status; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceStatusConsumer extends AbstractPerforceConsumer implements StreamConsumer { static final int STATE_FILES = 1; static final int STATE_ERROR = 2; private int currentState = STATE_FILES; private List depotfiles = new ArrayList(); /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.indexOf( "not opened" ) != -1 ) { // User has no files open at all, just return return; } switch ( currentState ) { /* //depot/sandbox/mperham/scm-test/Foo.java#1 - add default change (text) //depot/sandbox/mperham/scm-test/bar/Bar.xml#1 - add default change (text) */ case STATE_FILES: if ( line.startsWith( "//" ) ) { depotfiles.add( line.trim() ); } break; default: error( line ); break; } } private void error( String line ) { currentState = STATE_ERROR; output.println( line ); } public boolean isSuccess() { return currentState != STATE_ERROR; } public List getDepotfiles() { return depotfiles; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/status/PerforceStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001252311057615201033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.command.PerforceVerbMapper; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.regexp.RE; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceStatusCommand.java 691823 2008-09-03 23:15:13Z vsiveton $ */ public class PerforceStatusCommand extends AbstractStatusCommand implements PerforceCommand { private String actualLocation; /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet files ) throws ScmException { PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; actualLocation = PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ); PerforceStatusConsumer consumer = new PerforceStatusConsumer(); Commandline command = readOpened( prepo, files, consumer ); if ( consumer.isSuccess() ) { List scmfiles = createResults( actualLocation, consumer ); return new StatusScmResult( command.toString(), scmfiles ); } return new StatusScmResult( command.toString(), "Unable to get status", consumer .getOutput(), consumer.isSuccess() ); } public static List createResults( String repoPath, PerforceStatusConsumer consumer ) { List results = new ArrayList(); List files = consumer.getDepotfiles(); RE re = new RE( "([^#]+)#\\d+ - ([^ ]+) .*" ); for ( Iterator it = files.iterator(); it.hasNext(); ) { String filepath = (String) it.next(); if ( !re.match( filepath ) ) { System.err.println( "Skipping " + filepath ); continue; } String path = re.getParen( 1 ); String verb = re.getParen( 2 ); ScmFile scmfile = new ScmFile( path.substring( repoPath.length() + 1 ).trim(), PerforceVerbMapper .toStatus( verb ) ); results.add( scmfile ); } return results; } private Commandline readOpened( PerforceScmProviderRepository prepo, ScmFileSet files, PerforceStatusConsumer consumer ) { Commandline cl = createOpenedCommandLine( prepo, files.getBasedir(), actualLocation ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return cl; } public static Commandline createOpenedCommandLine( PerforceScmProviderRepository repo, File workingDirectory, String location ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "opened" ); command.createArg().setValue( PerforceScmProvider.getCanonicalRepoPath( location ) ); return command; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/unedit/PerforceUnEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000457211050561465033515 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.unedit; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceUnEditConsumer extends AbstractPerforceConsumer implements StreamConsumer { private static final String PATTERN = "^([^#]+)#\\d+ - (.*)"; private static final int STATE_NORMAL = 1; private static final int STATE_ERROR = 2; private int currentState = STATE_NORMAL; private List edits = new ArrayList(); private RE revisionRegexp; public PerforceUnEditConsumer() { try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } public List getEdits() { return edits; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( currentState != STATE_ERROR && revisionRegexp.match( line ) ) { edits.add( revisionRegexp.getParen( 1 ) ); return; } error( line ); } private void error( String line ) { currentState = STATE_ERROR; output.println( line ); } public boolean isSuccess() { return currentState == STATE_NORMAL; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/unedit/PerforceUnEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000740411057615201033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.unedit.AbstractUnEditCommand; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceUnEditCommand.java 691823 2008-09-03 23:15:13Z vsiveton $ */ public class PerforceUnEditCommand extends AbstractUnEditCommand implements PerforceCommand { /** {@inheritDoc} */ protected ScmResult executeUnEditCommand( ScmProviderRepository repo, ScmFileSet files ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), files ); PerforceUnEditConsumer consumer = new PerforceUnEditConsumer(); try { CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } if ( consumer.isSuccess() ) { return new UnEditScmResult( cl.toString(), consumer.getEdits() ); } return new UnEditScmResult( cl.toString(), "Unable to revert", consumer.getOutput(), consumer.isSuccess() ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmFileSet files ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "revert" ); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); command.createArg().setValue( file.getName() ); } return command; } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/remove/PerforceRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000714311057615201033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceRemoveCommand.java 691823 2008-09-03 23:15:13Z vsiveton $ */ public class PerforceRemoveCommand extends AbstractRemoveCommand implements PerforceCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet files, String message ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), files ); PerforceRemoveConsumer consumer = new PerforceRemoveConsumer(); try { CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return new RemoveScmResult( cl.toString(), consumer.getRemovals() ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmFileSet files ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "delete" ); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); command.createArg().setValue( file.getName() ); } return command; } }././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/remove/PerforceRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000466611050561465033521 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.remove; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceRemoveConsumer extends AbstractPerforceConsumer implements StreamConsumer { private static final String FILE_BEGIN_TOKEN = "//"; private static final String PATTERN = "^([^#]+)#\\d+ - (.*)"; private List removals = new ArrayList(); private RE revisionRegexp; private boolean error = false; public PerforceRemoveConsumer() { try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } public List getRemovals() { return removals; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( "... " ) ) { return; } if ( !line.startsWith( FILE_BEGIN_TOKEN ) ) { error( line ); } if ( !revisionRegexp.match( line ) ) { error( line ); } removals.add( revisionRegexp.getParen( 1 ) ); } private void error( String line ) { error = true; output.println( line ); } public boolean isSuccess() { return !error; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000663711050561465033521 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.tag; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceTagConsumer extends AbstractPerforceConsumer implements StreamConsumer { private static final String LABEL_PATTERN = "^Label ([^ ]+) saved.$"; private static final String SYNC_PATTERN = "^([^#]+)#\\d+ - (.*)"; public static final int STATE_CREATE = 1; public static final int STATE_SYNC = 2; public static final int STATE_ERROR = 3; private int currentState = STATE_CREATE; private List tagged = new ArrayList(); private RE syncRegexp; public PerforceTagConsumer() { try { syncRegexp = new RE( SYNC_PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } /** * Return a list of Strings formatted like: *

*

     * //depot/modules/cordoba/runtime-ear/pom.xml
     * //depot/modules/cordoba/runtime-ear/.runtime
     * 
*/ public List getTagged() { return tagged; } /* * We consume the output from 'p4 label -i' and 'p4 labelsync -l * ' */ /* * Label maven-scm-test saved. */ /* * //depot/modules/cordoba/runtime-ear/pom.xml#4 - added * //depot/modules/cordoba/runtime-ear/.runtime#1 - added */ /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( currentState ) { case STATE_CREATE: if ( !new RE( LABEL_PATTERN ).match( line ) ) { error( line ); break; } currentState = STATE_SYNC; break; case STATE_SYNC: if ( !syncRegexp.match( line ) ) { error( line ); break; } tagged.add( syncRegexp.getParen( 1 ) ); break; default: error( line ); break; } } private void error( String line ) { currentState = STATE_ERROR; output.println( line ); } public boolean isSuccess() { return currentState == STATE_SYNC; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/tag/PerforceTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000002260011157300235033477 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.command.PerforceInfoCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceTagCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public class PerforceTagCommand extends AbstractTagCommand implements PerforceCommand { private String actualRepoLocation = null; protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet files, String tag, String message ) throws ScmException { return executeTagCommand( repo, files, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet files, String tag, ScmTagParameters scmTagParameters ) throws ScmException { PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; actualRepoLocation = PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ); PerforceTagConsumer consumer = new PerforceTagConsumer(); createLabel( repo, files, tag, consumer, false ); if ( consumer.isSuccess() ) { syncLabel( repo, files, tag, consumer ); } if ( consumer.isSuccess() ) { // Now update the label if we need to lock it if ( shouldLock() ) { consumer = new PerforceTagConsumer(); createLabel( repo, files, tag, consumer, true ); } } if ( consumer.isSuccess() ) { // Unclear what to pass as the first arg return new TagScmResult( "p4 label -i", consumer.getTagged() ); } // Unclear what to pass as the first arg return new TagScmResult( "p4 label -i", "Tag failed", consumer.getOutput(), false ); } private boolean shouldLock() { return Boolean.valueOf( System.getProperty( "maven.scm.locktag", "true" ) ).booleanValue(); } private void syncLabel( ScmProviderRepository repo, ScmFileSet files, String tag, PerforceTagConsumer consumer ) { Commandline cl = createLabelsyncCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), files, tag ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing: " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } } private void createLabel( ScmProviderRepository repo, ScmFileSet files, String tag, PerforceTagConsumer consumer, boolean lock ) { Commandline cl = createLabelCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir() ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing: " + cl.toString() ) ); } Process proc = cl.execute(); OutputStream out = proc.getOutputStream(); DataOutputStream dos = new DataOutputStream( out ); String label = createLabelSpecification( (PerforceScmProviderRepository) repo, tag, lock ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "LabelSpec: " + NEWLINE + label ); } dos.write( label.getBytes() ); dos.close(); out.close(); // TODO find & use a less naive InputStream multiplexer BufferedReader stdout = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); BufferedReader stderr = new BufferedReader( new InputStreamReader( proc.getErrorStream() ) ); String line; while ( ( line = stdout.readLine() ) != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consuming stdout: " + line ); } consumer.consumeLine( line ); } while ( ( line = stderr.readLine() ) != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consuming stderr: " + line ); } consumer.consumeLine( line ); } stderr.close(); stdout.close(); } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } catch ( IOException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "IOException " + e.getMessage(), e ); } } } public static Commandline createLabelCommandLine( PerforceScmProviderRepository repo, File workingDirectory ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "label" ); command.createArg().setValue( "-i" ); return command; } public static Commandline createLabelsyncCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmFileSet files, String tag ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "labelsync" ); command.createArg().setValue( "-l" ); command.createArg().setValue( tag ); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); command.createArg().setValue( file.getName() ); } return command; } private static final String NEWLINE = "\r\n"; /* * Label: foo-label * View: //depot/path/to/repos/... * Owner: mperham */ public String createLabelSpecification( PerforceScmProviderRepository repo, String tag, boolean lock ) { StringBuffer buf = new StringBuffer(); buf.append( "Label: " ).append( tag ).append( NEWLINE ); buf.append( "View: " ).append( PerforceScmProvider.getCanonicalRepoPath( actualRepoLocation ) ).append( NEWLINE ); String username = repo.getUser(); if ( username == null ) { // I have no idea why but Perforce doesn't default the owner to the current user. // Since the user is not explicitly set, we use 'p4 info' to query for the current user. username = PerforceInfoCommand.getInfo( getLogger(), repo ).getEntry( "User name" ); } buf.append( "Owner: " ).append( username ).append( NEWLINE ); buf.append( "Options: " ).append( lock ? "" : "un" ).append( "locked" ).append( NEWLINE ); return buf.toString(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001232611051357615033512 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkin; /* * 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. */ import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.PrintWriter; import java.io.StringWriter; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceCheckInConsumer implements StreamConsumer { private static final String CREATED_PATTERN = "^Change \\d+ created .+$"; private static final String SUBMITTING_PATTERN = "^Submitting change \\d+\\.$"; private static final String LOCKING_PATTERN = "^Locking \\d+ files \\.\\.\\.$"; private static final String OP_PATTERN = "^[a-z]+ //[^#]+#\\d+$"; // SCM-181 Two possible messages: // "Change 94821 renamed change 94823 and submitted." // "Change 94821 submitted." private static final String COMPLETE_PATTERN = "^Change \\d+ .*submitted.$"; public static final int STATE_CREATED = 1; public static final int STATE_SUBMITTING = 2; public static final int STATE_LOCKING = 3; public static final int STATE_OP = 4; public static final int STATE_COMPLETE = 5; public static final int STATE_ERROR = 6; private StringWriter errors = new StringWriter(); private PrintWriter errorOutput = new PrintWriter( errors ); private int currentState = STATE_CREATED; private RE opRegexp; public PerforceCheckInConsumer() { try { opRegexp = new RE( OP_PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } /* * Change 80835 created with 1 open file(s). Submitting change 80835. * Locking 1 files ... add //depot/modules/cordoba/runtime-ear/foo.xml#1 * Change 80835 submitted. */ /* * Submitting change 80837. Locking 1 files ... edit * //depot/modules/cordoba/runtime-ear/Foo.java#2 Submit validation failed -- * fix problems then use 'p4 submit -c 80837'. 'checkstyle' validation * failed: * * depot/modules/cordoba/runtime-ear/Foo.java:3:1: Got an exception - * expecting EOF, found '}' */ /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( "... " ) ) { //TODO log this somehow? //System.out.println("Perforce: " + line); return; } switch ( currentState ) { case STATE_CREATED: boolean created = new RE( CREATED_PATTERN ).match( line ); if ( created ) { currentState++; break; } error( line ); break; case STATE_SUBMITTING: boolean submitting = new RE( SUBMITTING_PATTERN ).match( line ); if ( submitting ) { currentState++; break; } error( line ); break; case STATE_LOCKING: boolean locked = new RE( LOCKING_PATTERN ).match( line ); if ( locked ) { currentState++; break; } error( line ); break; case STATE_OP: boolean operation = opRegexp.match( line ); if ( operation ) { break; } else if ( new RE( COMPLETE_PATTERN ).match( line ) ) { currentState++; break; } error( line ); break; case STATE_ERROR: error( line ); break; default: } } private void error( String line ) { // if (currentState != STATE_ERROR) { // System.out.println("Unable to match: " + line + " State: " + // currentState); // new Exception().printStackTrace(); // } currentState = STATE_ERROR; errorOutput.println( line ); } public boolean isSuccess() { return currentState == STATE_COMPLETE; } public String getOutput() { errorOutput.flush(); errors.flush(); return errors.toString(); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/checkin/PerforceCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001570711161254775033525 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.checkin; /* * 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. */ import java.io.File; import java.io.IOException; import java.io.StringBufferInputStream; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Mike Perham * @version $Id: PerforceCheckInCommand.java 757024 2009-03-21 21:19:57Z olamy $ */ public class PerforceCheckInCommand extends AbstractCheckInCommand implements PerforceCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet files, String message, ScmVersion version ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir() ); PerforceCheckInConsumer consumer = new PerforceCheckInConsumer(); try { String jobs = System.getProperty( "maven.scm.jobs" ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } PerforceScmProviderRepository prepo = (PerforceScmProviderRepository) repo; String changes = createChangeListSpecification( prepo, files, message, PerforceScmProvider.getRepoPath( getLogger(), prepo, files.getBasedir() ), jobs ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Sending changelist:\n" + changes ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, new StringBufferInputStream(changes), consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return new CheckInScmResult( cl.toString(), consumer.isSuccess() ? "Checkin successful" : "Unable to submit", consumer.getOutput(), consumer.isSuccess() ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "submit" ); command.createArg().setValue( "-i" ); return command; } private static final String NEWLINE = "\r\n"; public static String createChangeListSpecification( PerforceScmProviderRepository repo, ScmFileSet files, String msg, String canonicalPath, String jobs ) { StringBuffer buf = new StringBuffer(); buf.append( "Change: new" ).append( NEWLINE ).append( NEWLINE ); buf.append( "Description:" ).append( NEWLINE ).append( "\t" ).append( msg ).append( NEWLINE ).append( NEWLINE ); if ( jobs != null && jobs.length() != 0 ) { // Multiple jobs are not handled with this implementation buf.append( "Jobs:" ).append( NEWLINE ).append( "\t" ).append( jobs ).append( NEWLINE ).append( NEWLINE ); } buf.append( "Files:" ).append( NEWLINE ); try { Set dupes = new HashSet(); File workingDir = files.getBasedir(); String candir = workingDir.getCanonicalPath(); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); // XXX Submit requires the canonical repository path for each // file. // It is unclear how to get that from a File object. // We assume the repo object has the relative prefix // "//depot/some/project" // and canfile has the relative path "src/foo.xml" to be added // to that prefix. // "//depot/some/project/src/foo.xml" String canfile = file.getCanonicalPath(); if ( dupes.contains( canfile ) ) { // XXX I am seeing duplicate files in the ScmFileSet. // I don't know why this is but we have to weed them out // or Perforce will barf System.err.println( "Skipping duplicate file: " + file ); continue; } dupes.add( canfile ); if ( canfile.startsWith( candir ) ) { canfile = canfile.substring( candir.length() + 1 ); } buf.append( "\t" ).append( canonicalPath ).append( "/" ).append( canfile.replace( '\\', '/' ) ) .append( NEWLINE ); } } catch ( IOException e ) { e.printStackTrace(); } return buf.toString(); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/PerforceWhereCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001305011057621704033504 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; /** * Encapsulates the 'p4 where' command which can be very useful in determining * a file's location within the depot. Use getDepotLocation(String path) to query * the depot location for a particular file. The data from p4 where looks like this: *

*

 * p4 where pom.xml
 * //depot/modules/fabric/trunk/pom.xml //mikeperham-dt/depot/modules/fabric/trunk/pom.xml
 * d:\perforce\depot\modules\fabric\trunk\pom.xml
 * 
* * @author mperham * @version $Id: $ */ public class PerforceWhereCommand { private ScmLogger logger = null; private PerforceScmProviderRepository repo = null; public PerforceWhereCommand( ScmLogger log, PerforceScmProviderRepository repos ) { logger = log; repo = repos; } public String getDepotLocation( File file ) { return getDepotLocation( file.getAbsolutePath() ); } /** * @param filepath an absolute file path * @return the absolute location of the given file within the Perforce repository or null if the file * does not exist in a mapping within the current clientspec. */ public String getDepotLocation( String filepath ) { if ( !PerforceScmProvider.isLive() ) { return null; } try { Commandline command = PerforceScmProvider.createP4Command( repo, null ); command.createArg().setValue( "where" ); command.createArg().setValue( filepath ); if ( logger.isDebugEnabled() ) { logger.debug( PerforceScmProvider.clean( "Executing: " + command.toString() ) ); } Process proc = command.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); BufferedReader brErr = new BufferedReader( new InputStreamReader( proc.getErrorStream() ) ); String line; String path = null; while ( ( line = br.readLine() ) != null ) { if ( line.indexOf( "not in client view" ) != -1 ) { // uh oh, something bad is happening if ( logger.isErrorEnabled() ) { logger.error( line ); } return null; } if ( line.indexOf( "is not under" ) != -1 ) { // uh oh, something bad is happening if ( logger.isErrorEnabled() ) { logger.error( line ); } return null; } if ( logger.isDebugEnabled() ) { logger.debug( line ); } // verify that "//" appears twice in the line path = line.substring( 0, line.lastIndexOf( "//" ) - 1 ); } // Check for errors while ( ( line = brErr.readLine() ) != null ) { if ( line.indexOf( "not in client view" ) != -1 ) { // uh oh, something bad is happening if ( logger.isErrorEnabled() ) { logger.error( line ); } return null; } if ( line.indexOf( "is not under" ) != -1 ) { // uh oh, something bad is happening if ( logger.isErrorEnabled() ) { logger.error( line ); } return null; } if ( logger.isDebugEnabled() ) { logger.debug( line ); } } return path; } catch ( CommandLineException e ) { if ( logger.isErrorEnabled() ) { logger.error( e ); } throw new RuntimeException( e.getLocalizedMessage() ); } catch ( IOException e ) { if ( logger.isErrorEnabled() ) { logger.error( e ); } throw new RuntimeException( e.getLocalizedMessage() ); } } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001114011057615201033475 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.edit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.edit.AbstractEditCommand; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceEditCommand.java 691823 2008-09-03 23:15:13Z vsiveton $ */ public class PerforceEditCommand extends AbstractEditCommand implements PerforceCommand { /** {@inheritDoc} */ protected ScmResult executeEditCommand( ScmProviderRepository repo, ScmFileSet files ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), files ); PerforceEditConsumer consumer = new PerforceEditConsumer(); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } if ( consumer.isSuccess() ) { return new EditScmResult( cl.toString(), consumer.getEdits() ); } return new EditScmResult( cl.toString(), "Unable to edit file(s)", consumer.getErrorMessage(), false ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmFileSet files ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "edit" ); try { String candir = workingDirectory.getCanonicalPath(); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); // I want to use relative paths to add files to make testing // simpler. // Otherwise the absolute path will be different on everyone's // machine // and testing will be a little more painful. String canfile = file.getCanonicalPath(); if ( canfile.startsWith( candir ) ) { canfile = canfile.substring( candir.length() + 1 ); } command.createArg().setValue( canfile ); } } catch ( IOException e ) { e.printStackTrace(); } return command; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/edit/PerforceEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000547311050561465033516 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.edit; /* * 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. */ import org.apache.maven.scm.provider.perforce.command.AbstractPerforceConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceEditConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class PerforceEditConsumer extends AbstractPerforceConsumer implements StreamConsumer { private static final String PATTERN = "^([^#]+)#\\d+ - (.*)"; private static final String FILE_BEGIN_TOKEN = "//"; private List edits = new ArrayList(); private RE revisionRegexp; private boolean errors = false; private StringBuffer errorMessage = new StringBuffer(); public PerforceEditConsumer() { try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } public List getEdits() { return edits; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( "... " ) ) { //Should we log this somehow? //System.out.println("Perforce: " + line); return; } if ( !line.startsWith( FILE_BEGIN_TOKEN ) ) { error( line ); } if ( !revisionRegexp.match( line ) ) { error( line ); } edits.add( revisionRegexp.getParen( 1 ) ); } private void error( String line ) { errors = true; output.println( line ); if ( errorMessage.length() > 0 ) { errorMessage.append( System.getProperty( "line.separator" ) ); } errorMessage.append( line ); } public boolean isSuccess() { return !errors; } public String getErrorMessage() { return errorMessage.toString(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001030211161162004033466 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mike Perham * @version $Id: PerforceDiffCommand.java 756929 2009-03-21 12:56:36Z olamy $ */ public class PerforceDiffCommand extends AbstractDiffCommand implements PerforceCommand { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet files, ScmVersion startRev, ScmVersion endRev ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), startRev, endRev ); PerforceDiffConsumer consumer = new PerforceDiffConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + PerforceScmProvider.clean( cl.toString() ) ); } boolean success = false; try { CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return new DiffScmResult( cl.toString(), success ? "Diff successful" : "Unable to diff", consumer .getOutput(), success ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmVersion startRev, ScmVersion endRev ) { String start = startRev != null && StringUtils.isNotEmpty( startRev.getName() ) ? "@" + startRev.getName() : ""; String end = endRev != null && StringUtils.isNotEmpty( endRev.getName() ) ? endRev.getName() : "now"; Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "diff2" ); command.createArg().setValue( "-u" ); // I'm assuming the "revs" are actually labels command.createArg().setValue( "..." + start ); command.createArg().setValue( "...@" + end ); return command; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/diff/PerforceDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000344711050561465033515 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.diff; /* * 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. */ import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.PrintWriter; import java.io.StringWriter; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceDiffConsumer implements StreamConsumer { private StringWriter out = new StringWriter(); private PrintWriter output = new PrintWriter( out ); /* * I don't see any easy way to distinguish between an error and * normal diff output. I see two possibilities: * * 1) Use the p4 global "-s" parameter * 2) Check for a non-zero code returned by the p4 process * * We'll do the latter as it's simpler to implement. */ /** {@inheritDoc} */ public void consumeLine( String line ) { output.println( line ); } public String getOutput() { output.flush(); out.flush(); return out.toString(); } }././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/PerforceCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000204210535556312033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: PerforceCommand.java 483105 2006-12-06 15:07:54Z evenisse $ */ public interface PerforceCommand { } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceDescribeConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000002077111176353307033517 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; /** * Parse the tagged output from "p4 describe -s [change] [change] [...]". * * @author Emmanuel Venisse * @version $Id: PerforceDescribeConsumer.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceDescribeConsumer extends AbstractConsumer { /** * Date formatter for perforce timestamp */ private static final String PERFORCE_TIMESTAMP_PATTERN = "yyyy/MM/dd HH:mm:ss"; private List entries = new ArrayList(); /** * State machine constant: expecting revision */ private static final int GET_REVISION = 1; /** * State machine constant: eat the first blank line */ private static final int GET_COMMENT_BEGIN = 2; /** * State machine constant: expecting comments */ private static final int GET_COMMENT = 3; /** * State machine constant: expecting "Affected files" */ private static final int GET_AFFECTED_FILES = 4; /** * State machine constant: expecting blank line */ private static final int GET_FILES_BEGIN = 5; /** * State machine constant: expecting files */ private static final int GET_FILE = 6; /** * Current status of the parser */ private int status = GET_REVISION; /** * The current log entry being processed by the parser */ private String currentRevision; /** * The current log entry being processed by the parser */ private ChangeSet currentChange; /** * the current file being processed by the parser */ private String currentFile; /** * The location of files within the Perforce depot that we are processing * e.g. //depot/projects/foo/bar */ private String repoPath; private String userDatePattern; private static final String REVISION_PATTERN = "^Change (\\d+) " + // changelist number "by (.*)@[^ ]+ " + // author "on (.*)"; // date /** * The comment section ends with a blank line */ private static final String COMMENT_DELIMITER = ""; /** * The changelist ends with a blank line */ private static final String CHANGELIST_DELIMITER = ""; private static final String FILE_PATTERN = "^\\.\\.\\. (.*)#(\\d+) "; /** * The regular expression used to match header lines */ private RE revisionRegexp; /** * The regular expression used to match file paths */ private RE fileRegexp; public PerforceDescribeConsumer( String repoPath, String userDatePattern, ScmLogger logger ) { super( logger ); this.repoPath = repoPath; this.userDatePattern = userDatePattern; try { revisionRegexp = new RE( REVISION_PATTERN ); fileRegexp = new RE( FILE_PATTERN ); } catch ( RESyntaxException ignored ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Could not create regexps to parse Perforce descriptions", ignored ); } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getModifications() throws ScmException { return entries; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( status ) { case GET_REVISION: processGetRevision( line ); break; case GET_COMMENT_BEGIN: status = GET_COMMENT; break; case GET_COMMENT: processGetComment( line ); break; case GET_AFFECTED_FILES: processGetAffectedFiles( line ); break; case GET_FILES_BEGIN: status = GET_FILE; break; case GET_FILE: processGetFile( line ); break; default: throw new IllegalStateException( "Unknown state: " + status ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Add a change log entry to the list (if it's not already there) * with the given file. * * @param entry a {@link ChangeSet} to be added to the list if another * with the same key (p4 change number) doesn't exist already. * @param file a {@link ChangeFile} to be added to the entry */ private void addEntry( ChangeSet entry, ChangeFile file ) { entry.addFile( file ); } /** * Each file matches the fileRegexp. * * @param line A line of text from the Perforce log output */ private void processGetFile( String line ) { if ( line.equals( CHANGELIST_DELIMITER ) ) { entries.add( 0, currentChange ); status = GET_REVISION; return; } if ( !fileRegexp.match( line ) ) { return; } currentFile = fileRegexp.getParen( 1 ); // Although Perforce allows files to be submitted anywhere in the // repository in a single changelist, we're only concerned about the // local files. if( currentFile.startsWith( repoPath ) ) { currentFile = currentFile.substring( repoPath.length() + 1 ); addEntry( currentChange, new ChangeFile( currentFile, fileRegexp.getParen( 2 ) ) ); } } /** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { if ( !revisionRegexp.match( line ) ) { return; } currentChange = new ChangeSet(); currentRevision = revisionRegexp.getParen( 1 ); currentChange.setAuthor( revisionRegexp.getParen( 2 ) ); currentChange.setDate( revisionRegexp.getParen( 3 ), userDatePattern ); status = GET_COMMENT_BEGIN; } /** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the perforce log output */ private void processGetComment( String line ) { if ( line.equals( COMMENT_DELIMITER ) ) { status = GET_AFFECTED_FILES; } else { // remove prepended tab currentChange.setComment( currentChange.getComment() + line.substring(1) + "\n" ); } } /** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the perforce log output */ private void processGetAffectedFiles( String line ) { if ( !line.equals( "Affected files ..." ) ) { return; } status = GET_FILES_BEGIN; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangesConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000477011176353307033520 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import java.util.ArrayList; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceChangesConsumer.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceChangesConsumer extends AbstractConsumer { private List entries = new ArrayList(); /** * The regular expression used to match header lines */ private RE revisionRegexp; private static final String PATTERN = "^Change (\\d+) " + // changelist number "on (.*) " + // date "by (.*)@"; // author public PerforceChangesConsumer( ScmLogger logger ) { super( logger ); try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Could not create regexp to parse perforce log file", ignored ); } } } public List getChanges() throws ScmException { return entries; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if( revisionRegexp.match( line ) ) { entries.add( revisionRegexp.getParen( 1 ) ); } } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000002033411161762357033515 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import java.util.ArrayList; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogConsumer.java 757515 2009-03-23 19:37:19Z bentmann $ */ public class PerforceChangeLogConsumer extends AbstractConsumer { /** * Date formatter for perforce timestamp */ private static final String PERFORCE_TIMESTAMP_PATTERN = "yyyy/MM/dd HH:mm:ss"; private List entries = new ArrayList(); /** * State machine constant: expecting revision and/or file information */ private static final int GET_REVISION = 1; /** * State machine constant: eat the first blank line */ private static final int GET_COMMENT_BEGIN = 2; /** * State machine constant: expecting comments */ private static final int GET_COMMENT = 3; /** * The comment section ends with a blank line */ private static final String COMMENT_DELIMITER = ""; /** * A file line begins with two slashes */ private static final String FILE_BEGIN_TOKEN = "//"; /** * Current status of the parser */ private int status = GET_REVISION; /** * The current log entry being processed by the parser */ private ChangeSet currentChange; /** * the current file being processed by the parser */ private String currentFile; /** * The location of files within the Perforce depot that we are processing * e.g. //depot/projects/foo/bar */ private String repoPath; /** * The regular expression used to match header lines */ private RE revisionRegexp; private Date startDate; private Date endDate; private String userDatePattern; private static final String PATTERN = "^\\.\\.\\. #(\\d+) " + // revision number "change (\\d+) .* " + // changelist number "on (.*) " + // date "by (.*)@"; // author public PerforceChangeLogConsumer( String path, Date startDate, Date endDate, String userDatePattern, ScmLogger logger ) { super( logger ); this.startDate = startDate; this.endDate = endDate; this.userDatePattern = userDatePattern; this.repoPath = path; try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Could not create regexp to parse perforce log file", ignored ); } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getModifications() throws ScmException { // Here there are one entry for each couple (changelist,file). We merge // entries to have only one entry per changelist // Date > ChangeSet Map groupedEntries = new LinkedHashMap(); for ( int i = 0; i < entries.size(); i++ ) { ChangeSet cs = (ChangeSet) entries.get( i ); ChangeSet hit = (ChangeSet) groupedEntries.get( cs.getDate() ); if ( hit != null ) { if ( cs.getFiles().size() != 1 ) { throw new ScmException( "Merge of entries failed. Bad entry size: " + cs.getFiles().size() ); } hit.addFile( (ChangeFile) cs.getFiles().get( 0 ) ); } else { groupedEntries.put( cs.getDate(), cs ); } } ArrayList result = new ArrayList(); result.addAll( groupedEntries.values() ); return result; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( status ) { case GET_REVISION: processGetRevision( line ); break; case GET_COMMENT_BEGIN: status = GET_COMMENT; break; case GET_COMMENT: processGetComment( line ); break; default: throw new IllegalStateException( "Unknown state: " + status ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Add a change log entry to the list (if it's not already there) * with the given file. * * @param entry a {@link ChangeSet} to be added to the list if another * with the same key (p4 change number) doesn't exist already. * @param file a {@link ChangeFile} to be added to the entry */ private void addEntry( ChangeSet entry, ChangeFile file ) { // ---------------------------------------------------------------------- // Check that we are inside the requested date range // ---------------------------------------------------------------------- if ( startDate != null && entry.getDate().before( startDate ) ) { return; } if ( endDate != null && entry.getDate().after( endDate ) ) { return; } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- entry.addFile( file ); entries.add( entry ); } /** * Most of the relevant info is on the revision line matching the * 'pattern' string. * * @param line A line of text from the perforce log output */ private void processGetRevision( String line ) { if ( line.startsWith( FILE_BEGIN_TOKEN ) ) { currentFile = line.substring( repoPath.length() + 1 ); return; } if ( !revisionRegexp.match( line ) ) { return; } currentChange = new ChangeSet(); currentChange.setDate( parseDate( revisionRegexp.getParen( 3 ), userDatePattern, PERFORCE_TIMESTAMP_PATTERN ) ); currentChange.setAuthor( revisionRegexp.getParen( 4 ) ); status = GET_COMMENT_BEGIN; } /** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the perforce log output */ private void processGetComment( String line ) { if ( line.equals( COMMENT_DELIMITER ) ) { addEntry( currentChange, new ChangeFile( currentFile, revisionRegexp.getParen( 1 ) ) ); status = GET_REVISION; } else { currentChange.setComment( currentChange.getComment() + line + "\n" ); } } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000002106711176353307033516 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: PerforceChangeLogCommand.java 770320 2009-04-30 16:50:15Z olamy $ */ public class PerforceChangeLogCommand extends AbstractChangeLogCommand implements PerforceCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, null, null, null, datePattern, startVersion, endVersion ); } /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) ) { throw new ScmException( "This SCM doesn't support branches." ); } return executeChangeLogCommand( repo, fileSet, startDate, endDate, branch, datePattern, null, null ); } protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { PerforceScmProviderRepository p4repo = (PerforceScmProviderRepository) repo; String clientspec = PerforceScmProvider.getClientspecName( getLogger(), p4repo, fileSet.getBasedir() ); Commandline cl = createCommandLine( p4repo, fileSet.getBasedir(), clientspec, null, startDate, endDate, startVersion, endVersion ); String location = PerforceScmProvider.getRepoPath( getLogger(), p4repo, fileSet.getBasedir() ); PerforceChangesConsumer consumer = new PerforceChangesConsumer( getLogger() ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } List changes = consumer.getChanges(); cl = PerforceScmProvider.createP4Command( p4repo, fileSet.getBasedir() ); cl.createArg().setValue( "describe" ); cl.createArg().setValue( "-s" ); for( int i = 0; i < changes.size(); i++ ) { cl.createArg().setValue( (String)changes.get(i) ); } PerforceDescribeConsumer describeConsumer = new PerforceDescribeConsumer( location, datePattern, getLogger() ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) ); } CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, describeConsumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } ChangeLogSet cls = new ChangeLogSet( describeConsumer.getModifications(), null, null ); cls.setStartVersion(startVersion); cls.setEndVersion(endVersion); return new ChangeLogScmResult( cl.toString(), cls ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, String clientspec, ScmBranch branch, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion ) { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd:HH:mm:ss"); Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); if ( clientspec != null ) { command.createArg().setValue( "-c" ); command.createArg().setValue( clientspec ); } command.createArg().setValue( "changes" ); command.createArg().setValue( "-t" ); StringBuffer fileSpec = new StringBuffer("..."); if ( startDate != null ) { fileSpec.append( "@" ) .append( dateFormat.format(startDate) ) .append( "," ); if ( endDate != null ) { fileSpec.append( dateFormat.format(endDate) ); } else { fileSpec.append( "now" ); } } if ( startVersion != null ) { fileSpec.append("@").append(startVersion.getName()).append(","); if ( endVersion != null ) { fileSpec.append( endVersion.getName() ); } else { fileSpec.append("now"); } } command.createArg().setValue( fileSpec.toString() ); return command; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/add/PerforceAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000444711050561465033516 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.add; /* * 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. */ import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceChangeLogConsumer.java 331276 2005-11-07 15:04:54Z * evenisse $ */ public class PerforceAddConsumer implements StreamConsumer { private static final String PATTERN = "^([^#]+)#(\\d+) - (.*)"; private static final String FILE_BEGIN_TOKEN = "//"; private List additions = new ArrayList(); private RE revisionRegexp; public PerforceAddConsumer() { try { revisionRegexp = new RE( PATTERN ); } catch ( RESyntaxException ignored ) { ignored.printStackTrace(); } } public List getAdditions() { return additions; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( "... " ) ) { //TODO log this somehow? //System.out.println("Perforce: " + line); return; } if ( !line.startsWith( FILE_BEGIN_TOKEN ) ) { throw new IllegalStateException( "Unknown error: " + line ); } if ( !revisionRegexp.match( line ) ) { throw new IllegalStateException( "Unknown input: " + line ); } additions.add( revisionRegexp.getParen( 1 ) ); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/add/PerforceAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000717111057615201033506 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.PerforceScmProvider; import org.apache.maven.scm.provider.perforce.command.PerforceCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.List; /** * @author Mike Perham * @version $Id: PerforceAddCommand.java 691823 2008-09-03 23:15:13Z vsiveton $ */ public class PerforceAddCommand extends AbstractAddCommand implements PerforceCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet files, String message, boolean binary ) throws ScmException { Commandline cl = createCommandLine( (PerforceScmProviderRepository) repo, files.getBasedir(), files ); PerforceAddConsumer consumer = new PerforceAddConsumer(); try { CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer(); int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err ); if ( exitCode != 0 ) { String cmdLine = CommandLineUtils.toString( cl.getCommandline() ); StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() ); msg.append( '\n' ); msg.append( "Command line was:" + cmdLine ); throw new CommandLineException( msg.toString() ); } } catch ( CommandLineException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "CommandLineException " + e.getMessage(), e ); } } return new AddScmResult( cl.toString(), consumer.getAdditions() ); } public static Commandline createCommandLine( PerforceScmProviderRepository repo, File workingDirectory, ScmFileSet files ) { Commandline command = PerforceScmProvider.createP4Command( repo, workingDirectory ); command.createArg().setValue( "add" ); List fs = files.getFileList(); for ( int i = 0; i < fs.size(); i++ ) { File file = (File) fs.get( i ); command.createArg().setValue( file.getName() ); } return command; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000005002711057610744033513 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.perforce.command.PerforceInfoCommand; import org.apache.maven.scm.provider.perforce.command.PerforceWhereCommand; import org.apache.maven.scm.provider.perforce.command.add.PerforceAddCommand; import org.apache.maven.scm.provider.perforce.command.changelog.PerforceChangeLogCommand; import org.apache.maven.scm.provider.perforce.command.checkin.PerforceCheckInCommand; import org.apache.maven.scm.provider.perforce.command.checkout.PerforceCheckOutCommand; import org.apache.maven.scm.provider.perforce.command.diff.PerforceDiffCommand; import org.apache.maven.scm.provider.perforce.command.edit.PerforceEditCommand; import org.apache.maven.scm.provider.perforce.command.login.PerforceLoginCommand; import org.apache.maven.scm.provider.perforce.command.remove.PerforceRemoveCommand; import org.apache.maven.scm.provider.perforce.command.status.PerforceStatusCommand; import org.apache.maven.scm.provider.perforce.command.tag.PerforceTagCommand; import org.apache.maven.scm.provider.perforce.command.unedit.PerforceUnEditCommand; import org.apache.maven.scm.provider.perforce.command.update.PerforceUpdateCommand; import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.net.InetAddress; import java.net.UnknownHostException; /** * @author Trygve Laugstøl * @author mperham * @version $Id: PerforceScmProvider.java 691810 2008-09-03 22:38:28Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="perforce" */ public class PerforceScmProvider extends AbstractScmProvider { // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- public boolean requiresEditMode() { return true; } public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { String path; int port = 0; String host = null; int i1 = scmSpecificUrl.indexOf( delimiter ); int i2 = scmSpecificUrl.indexOf( delimiter, i1 + 1 ); if ( i1 > 0 ) { int lastDelimiter = scmSpecificUrl.lastIndexOf( delimiter ); path = scmSpecificUrl.substring( lastDelimiter + 1 ); host = scmSpecificUrl.substring( 0, i1 ); // If there is tree parts in the scm url, the second is the port if ( i2 >= 0 ) { try { String tmp = scmSpecificUrl.substring( i1 + 1, lastDelimiter ); port = Integer.parseInt( tmp ); } catch ( NumberFormatException ex ) { throw new ScmRepositoryException( "The port has to be a number." ); } } } else { path = scmSpecificUrl; } String user = null; String password = null; if ( host != null && host.indexOf( "@" ) > 1 ) { user = host.substring( 0, host.indexOf( "@" ) ); host = host.substring( host.indexOf( "@" ) + 1 ); } if ( path.indexOf( "@" ) > 1 ) { if ( host != null ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Username as part of path is deprecated, the new format is " + "scm:perforce:[username@]host:port:path_to_repository" ); } } user = path.substring( 0, path.indexOf( "@" ) ); path = path.substring( path.indexOf( "@" ) + 1 ); } return new PerforceScmProviderRepository( host, port, path, user, password ); } public String getScmType() { return "perforce"; } /** {@inheritDoc} */ protected ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { PerforceChangeLogCommand command = new PerforceChangeLogCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceAddCommand command = new PerforceAddCommand(); command.setLogger( getLogger() ); return (AddScmResult) command.execute( repository, fileSet, params ); } protected RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceRemoveCommand command = new PerforceRemoveCommand(); command.setLogger( getLogger() ); return (RemoveScmResult) command.execute( repository, fileSet, params ); } protected CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceCheckInCommand command = new PerforceCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, params ); } protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceCheckOutCommand command = new PerforceCheckOutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository, fileSet, params ); } protected DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceDiffCommand command = new PerforceDiffCommand(); command.setLogger( getLogger() ); return (DiffScmResult) command.execute( repository, fileSet, params ); } protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceEditCommand command = new PerforceEditCommand(); command.setLogger( getLogger() ); return (EditScmResult) command.execute( repository, fileSet, params ); } protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceLoginCommand command = new PerforceLoginCommand(); command.setLogger( getLogger() ); return (LoginScmResult) command.execute( repository, fileSet, params ); } protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceStatusCommand command = new PerforceStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, params ); } protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceTagCommand command = new PerforceTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, params ); } protected UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceUnEditCommand command = new PerforceUnEditCommand(); command.setLogger( getLogger() ); return (UnEditScmResult) command.execute( repository, fileSet, params ); } protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { PerforceUpdateCommand command = new PerforceUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, params ); } public static Commandline createP4Command( PerforceScmProviderRepository repo, File workingDir ) { Commandline command = new Commandline(); command.setExecutable( "p4" ); if ( workingDir != null ) { // SCM-209 command.createArg().setValue( "-d" ); command.createArg().setValue( workingDir.getAbsolutePath() ); } if ( repo.getHost() != null ) { command.createArg().setValue( "-p" ); String value = repo.getHost(); if ( repo.getPort() != 0 ) { value += ":" + Integer.toString( repo.getPort() ); } command.createArg().setValue( value ); } if ( StringUtils.isNotEmpty( repo.getUser() ) ) { command.createArg().setValue( "-u" ); command.createArg().setValue( repo.getUser() ); } if ( StringUtils.isNotEmpty( repo.getPassword() ) ) { command.createArg().setValue( "-P" ); command.createArg().setValue( repo.getPassword() ); } return command; } public static String clean( String string ) { if ( string.indexOf( " -P " ) == -1 ) { return string; } int idx = string.indexOf( " -P " ) + 4; int end = string.indexOf( ' ', idx ); return string.substring( 0, idx ) + StringUtils.repeat( "*", end - idx ) + string.substring( end ); } /** * Given a path like "//depot/foo/bar", returns the * proper path to include everything beneath it. *

* //depot/foo/bar -> //depot/foo/bar/... * //depot/foo/bar/ -> //depot/foo/bar/... * //depot/foo/bar/... -> //depot/foo/bar/... * * @param repoPath * @return */ public static String getCanonicalRepoPath( String repoPath ) { if ( repoPath.endsWith( "/..." ) ) { return repoPath; } else if ( repoPath.endsWith( "/" ) ) { return repoPath + "..."; } else { return repoPath + "/..."; } } private static final String NEWLINE = "\r\n"; /* * Clientspec name can be overridden with the system property below. I don't * know of any way for this code to get access to maven's settings.xml so this * is the best I can do. * * Sample clientspec: Client: mperham-mikeperham-dt-maven Root: d:\temp\target Owner: mperham View: //depot/sandbox/mperham/tsa/tsa-domain/... //mperham-mikeperham-dt-maven/... Description: Created by maven-scm-provider-perforce */ public static String createClientspec( ScmLogger logger, PerforceScmProviderRepository repo, File workDir, String repoPath ) { String clientspecName = getClientspecName( logger, repo, workDir ); String userName = getUsername( logger, repo ); String rootDir; try { // SCM-184 rootDir = workDir.getCanonicalPath(); } catch ( IOException ex ) { //getLogger().error("Error getting canonical path for working directory: " + workDir, ex); rootDir = workDir.getAbsolutePath(); } StringBuffer buf = new StringBuffer(); buf.append( "Client: " ).append( clientspecName ).append( NEWLINE ); buf.append( "Root: " ).append( rootDir ).append( NEWLINE ); buf.append( "Owner: " ).append( userName ).append( NEWLINE ); buf.append( "View:" ).append( NEWLINE ); buf.append( "\t" ).append( PerforceScmProvider.getCanonicalRepoPath( repoPath ) ); buf.append( " //" ).append( clientspecName ).append( "/..." ).append( NEWLINE ); buf.append( "Description:" ).append( NEWLINE ); buf.append( "\t" ).append( "Created by maven-scm-provider-perforce" ).append( NEWLINE ); return buf.toString(); } public static final String DEFAULT_CLIENTSPEC_PROPERTY = "maven.scm.perforce.clientspec.name"; public static String getClientspecName( ScmLogger logger, PerforceScmProviderRepository repo, File workDir ) { String def = generateDefaultClientspecName( logger, repo, workDir ); // until someone put clearProperty in DefaultContinuumScm.getScmRepository( Project , boolean ) String l = System.getProperty( DEFAULT_CLIENTSPEC_PROPERTY, def ); if ( l == null || "".equals( l.trim() ) ) { return def; } return l; } private static String generateDefaultClientspecName( ScmLogger logger, PerforceScmProviderRepository repo, File workDir ) { String username = getUsername( logger, repo ); String hostname; String path; try { hostname = InetAddress.getLocalHost().getHostName(); // [SCM-370][SCM-351] client specs cannot contain forward slashes, spaces and ~; "-" is okay path = workDir.getCanonicalPath().replaceAll( "[/ ~]", "-" ); } catch ( UnknownHostException e ) { // Should never happen throw new RuntimeException( e ); } catch ( IOException e ) { throw new RuntimeException( e ); } return username + "-" + hostname + "-MavenSCM-" + path; } private static String getUsername( ScmLogger logger, PerforceScmProviderRepository repo ) { String username = PerforceInfoCommand.getInfo( logger, repo ).getEntry( "User name" ); if ( username == null ) { // os user != perforce user username = repo.getUser(); if ( username == null ) { username = System.getProperty( "user.name", "nouser" ); } } return username; } /** * This is a "safe" method which handles cases where repo.getPath() is * not actually a valid Perforce depot location. This is a frequent error * due to branches and directory naming where dir name != artifactId. * * @param log the logging object to use * @param repo the Perforce repo * @param basedir the base directory we are operating in. If pom.xml exists in this directory, * this method will verify

repo.getPath()/pom.xml
==
p4 where basedir/pom.xml
* @return repo.getPath if it is determined to be accurate. The p4 where location otherwise. */ public static String getRepoPath( ScmLogger log, PerforceScmProviderRepository repo, File basedir ) { PerforceWhereCommand where = new PerforceWhereCommand( log, repo ); // Handle an edge case where we release:prepare'd a module with an invalid SCM location. // In this case, the release.properties will contain the invalid URL for checkout purposes // during release:perform. In this case, the basedir is not the module root so we detect that // and remove the trailing target/checkout directory. if ( basedir.toString().replace( '\\', '/' ).endsWith( "/target/checkout" ) ) { String dir = basedir.toString(); basedir = new File( dir.substring( 0, dir.length() - "/target/checkout".length() ) ); log.debug( "Fixing checkout URL: " + basedir ); } File pom = new File( basedir, "pom.xml" ); String loc = repo.getPath(); log.debug( "SCM path in pom: " + loc ); if ( pom.exists() ) { loc = where.getDepotLocation( pom ); if ( loc == null ) { loc = repo.getPath(); log.debug( "cannot find depot => using " + loc ); } else if ( loc.endsWith( "/pom.xml" ) ) { loc = loc.substring( 0, loc.length() - "/pom.xml".length() ); log.debug( "Actual POM location: " + loc ); if ( !repo.getPath().equals( loc ) ) { log.info( "The SCM location in your pom.xml (" + repo.getPath() + ") is not equal to the depot location (" + loc + "). This happens frequently with branches. " + "Ignoring the SCM location." ); } } } return loc; } private static Boolean live = null; public static boolean isLive() { if ( live == null ) { if ( !Boolean.getBoolean( "maven.scm.testing" ) ) { // We are not executing in the tests so we are live. live = Boolean.TRUE; } else { // During unit tests, we need to check the local system // to see if the user has Perforce installed. If not, we mark // the provider as "not live" (or dead, I suppose!) and skip // anything that requires an active server connection. try { Commandline command = new Commandline(); command.setExecutable( "p4" ); Process proc = command.execute(); BufferedReader br = new BufferedReader( new InputStreamReader( proc.getInputStream() ) ); String line; while ( ( line = br.readLine() ) != null ) { //System.out.println(line); } int rc = proc.exitValue(); live = ( rc == 0 ? Boolean.TRUE : Boolean.FALSE ); } catch ( Exception e ) { e.printStackTrace(); live = Boolean.FALSE; } } } return live.booleanValue(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536663033514 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/repository/PerforceScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000332010535556312033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.perforce.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; /** * @author Trygve Laugstøl * @version $Id: PerforceScmProviderRepository.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class PerforceScmProviderRepository extends ScmProviderRepositoryWithHost { private String path; public PerforceScmProviderRepository( String host, int port, String path, String user, String password ) { setHost( host ); setPort( port ); this.path = path; setUser( user ); setPassword( password ); } // ---------------------------------------------------------------------- // ScmProviderRepository Implementation // ---------------------------------------------------------------------- public String getPath() { return path; } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-perforce/pom.xml0000644000175000017500000000472611322611461025746 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-perforce Maven SCM Perforce Provider SCM Provider implementation for Perforce (http://www.perforce.com/). regexp regexp org.codehaus.plexus plexus-maven-plugin descriptor maven-surefire-plugin maven.scm.testing true maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/0000755000175000017500000000000011345536670023621 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/0000755000175000017500000000000011345536670030645 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/0000755000175000017500000000000011345536670031434 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/site/0000755000175000017500000000000011345536670032400 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/site/site.xm0000644000175000017500000000212511051127665033704 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/0000755000175000017500000000000011345536670032413 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/update/cygwin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/update/cygwin/svn-settings.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000000015711015626730034012 0ustar twernertwerner true /mnt ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/checkin/macos/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/checkin/macos/svn-settings.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000000011611053631040033775 0ustar twernertwerner false ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/svnlog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000002521010400307044033776 0ustar twernertwerner------------------------------------------------------------------------ rev 15: kaz | 2002-08-26 14:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml M /poolserver/trunk/project.properties Minor formatting changes. ------------------------------------------------------------------------ rev 14: kaz | 2002-08-26 10:24:58 -0400 (Mon, 26 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml Cleaned up some whitespace. ------------------------------------------------------------------------ rev 13: kaz | 2002-08-24 12:56:37 -0400 (Sat, 24 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/src/java Added an svn:ignore property to ignore the 'tags' file. ------------------------------------------------------------------------ rev 12: kaz | 2002-08-24 12:31:41 -0400 (Sat, 24 Aug 2002) | 3 lines Changed paths: D /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp/.SnmpPhysicalGateway.java.swp Ditching a vim swap file. ------------------------------------------------------------------------ rev 11: kaz | 2002-08-24 00:20:25 -0400 (Sat, 24 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp/SnmpPhysicalGateway.java Did some basic refactoring and just preparing to go-time. ------------------------------------------------------------------------ rev 10: kaz | 2002-08-24 00:19:39 -0400 (Sat, 24 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml Added a ctags target in the event I have to use vim. ------------------------------------------------------------------------ rev 9: kaz | 2002-08-23 11:11:52 -0400 (Fri, 23 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml Testing script out again ... ------------------------------------------------------------------------ rev 8: kaz | 2002-08-23 11:07:46 -0400 (Fri, 23 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml Testing svn commit-email script ... ------------------------------------------------------------------------ rev 7: pete | 2002-08-23 11:03:39 -0400 (Fri, 23 Aug 2002) | 4 lines Changed paths: M /poolserver/trunk/build.xml Reformatted the indentation (really just an excuse to test out subversion). ------------------------------------------------------------------------ rev 6: kaz | 2002-08-23 10:36:23 -0400 (Fri, 23 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/resources/WEB-INF/lib/xerces-1.4.4.jar Replacing the xerces library as it seems to be corrupted. ------------------------------------------------------------------------ rev 5: kaz | 2002-08-22 11:28:22 -0400 (Thu, 22 Aug 2002) | 3 lines Changed paths: A /poolserver/trunk/build.xml A /poolserver/trunk/poolserver.zargo A /poolserver/trunk/project.properties A /poolserver/trunk/resources A /poolserver/trunk/resources/WEB-INF A /poolserver/trunk/resources/WEB-INF/conf A /poolserver/trunk/resources/WEB-INF/conf/Fulcrum.properties A /poolserver/trunk/resources/WEB-INF/conf/TurbineResources.properties A /poolserver/trunk/resources/WEB-INF/conf/demo-pipeline.xml A /poolserver/trunk/resources/WEB-INF/lib A /poolserver/trunk/resources/WEB-INF/lib/JavaGroups-2.0.jar A /poolserver/trunk/resources/WEB-INF/lib/activation-1.0.1.jar A /poolserver/trunk/resources/WEB-INF/lib/antlr.jar A /poolserver/trunk/resources/WEB-INF/lib/avalon-framework.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-beanutils.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-betwixt-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-codec-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-collections-2.0.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-configuration-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-digester-1.1.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-email-0.1-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-fileupload-0.1-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-http.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-io.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-lang-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-logging-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-pool.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-util-1.0-rc2-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/commons-xo-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/dom4j-1.3.jar A /poolserver/trunk/resources/WEB-INF/lib/fulcrum-3.0-b2-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/jakarta-regexp-1.3-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/jcs-1.0-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/jdbc2_0-stdext.jar A /poolserver/trunk/resources/WEB-INF/lib/jta.jar A /poolserver/trunk/resources/WEB-INF/lib/junit-3.7.jar A /poolserver/trunk/resources/WEB-INF/lib/log4j-1.1.3.jar A /poolserver/trunk/resources/WEB-INF/lib/lucene-1.2.jar A /poolserver/trunk/resources/WEB-INF/lib/mail-1.2.jar A /poolserver/trunk/resources/WEB-INF/lib/ojb-0.9.jar A /poolserver/trunk/resources/WEB-INF/lib/postgresql.jar A /poolserver/trunk/resources/WEB-INF/lib/servlet-2.3.jar A /poolserver/trunk/resources/WEB-INF/lib/snmp.jar A /poolserver/trunk/resources/WEB-INF/lib/stratum-1.0-b2-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/torque-3.0-b3-dev.jar A /poolserver/trunk/resources/WEB-INF/lib/turbine-3.0alpha.jar A /poolserver/trunk/resources/WEB-INF/lib/velocity-1.3-rc1.jar A /poolserver/trunk/resources/WEB-INF/lib/xalan-2.1.0.jar A /poolserver/trunk/resources/WEB-INF/lib/xerces-1.4.4.jar A /poolserver/trunk/resources/WEB-INF/web.xml A /poolserver/trunk/resources/css A /poolserver/trunk/resources/css/ns4_only.css A /poolserver/trunk/resources/css/pool.css A /poolserver/trunk/resources/css/print.css A /poolserver/trunk/resources/css/tigris.css A /poolserver/trunk/resources/images A /poolserver/trunk/resources/images/icon_alert.gif A /poolserver/trunk/resources/images/icon_alertsml.gif A /poolserver/trunk/resources/images/icon_confirmsml.gif A /poolserver/trunk/resources/images/nw_min.gif A /poolserver/trunk/resources/images/strich.gif A /poolserver/trunk/resources/images/sw_min.gif A /poolserver/trunk/resources/logs A /poolserver/trunk/resources/logs/services.log A /poolserver/trunk/resources/logs/torque.log A /poolserver/trunk/resources/logs/trace.log A /poolserver/trunk/resources/logs/turbine.log A /poolserver/trunk/resources/logs/velocity.log A /poolserver/trunk/resources/logs/velocity.log.1 A /poolserver/trunk/resources/sampler.html A /poolserver/trunk/resources/scripts A /poolserver/trunk/resources/scripts/tigris.js A /poolserver/trunk/resources/templates A /poolserver/trunk/resources/templates/layouts A /poolserver/trunk/resources/templates/layouts/Default.vm A /poolserver/trunk/resources/templates/navigations A /poolserver/trunk/resources/templates/navigations/Administration.vm A /poolserver/trunk/resources/templates/navigations/Default.vm A /poolserver/trunk/resources/templates/navigations/HowDoI.vm A /poolserver/trunk/resources/templates/navigations/PoolTools.vm A /poolserver/trunk/resources/templates/navigations/ProjectInfo.vm A /poolserver/trunk/resources/templates/screens A /poolserver/trunk/resources/templates/screens/.Pool.vm.swp A /poolserver/trunk/resources/templates/screens/Default.vm A /poolserver/trunk/resources/templates/screens/Error.vm A /poolserver/trunk/resources/templates/screens/Pool.vm A /poolserver/trunk/src A /poolserver/trunk/src/java A /poolserver/trunk/src/java/net A /poolserver/trunk/src/java/net/ibasis A /poolserver/trunk/src/java/net/ibasis/poolserver A /poolserver/trunk/src/java/net/ibasis/poolserver/AbstractPhysicalGateway.java A /poolserver/trunk/src/java/net/ibasis/poolserver/AbstractPool.java A /poolserver/trunk/src/java/net/ibasis/poolserver/CallCounter.java A /poolserver/trunk/src/java/net/ibasis/poolserver/CompositePool.java A /poolserver/trunk/src/java/net/ibasis/poolserver/Gateway.java A /poolserver/trunk/src/java/net/ibasis/poolserver/GatewayAttribute.java A /poolserver/trunk/src/java/net/ibasis/poolserver/PhysicalGateway.java A /poolserver/trunk/src/java/net/ibasis/poolserver/Utilization.java A /poolserver/trunk/src/java/net/ibasis/poolserver/impl A /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp A /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp/.SnmpPhysicalGateway.java.swp A /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp/DialPeerAttribute.java A /poolserver/trunk/src/java/net/ibasis/poolserver/impl/snmp/SnmpPhysicalGateway.java A /poolserver/trunk/src/target A /poolserver/trunk/src/target/.dependency-info A /poolserver/trunk/src/target/.dependency-info/-outtosrc-.i A /poolserver/trunk/src/target/.dependency-info/-timestamp-.i A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.AbstractPhysicalGateway.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.AbstractPool.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.CallCounter.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.CompositePool.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.Gateway.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.GatewayAttribute.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.PhysicalGateway.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.PoolTreeTest.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.Utilization.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver/.UtilizationTest.di A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver.impl.snmp A /poolserver/trunk/src/target/.dependency-info/net.ibasis.poolserver.impl.snmp/.SnmpPhysicalGateway.di A /poolserver/trunk/src/test A /poolserver/trunk/src/test/net A /poolserver/trunk/src/test/net/ibasis A /poolserver/trunk/src/test/net/ibasis/poolserver A /poolserver/trunk/src/test/net/ibasis/poolserver/PoolTreeTest.java A /poolserver/trunk/src/test/net/ibasis/poolserver/UtilizationTest.java Initial import of sources. ------------------------------------------------------------------------ rev 2: kaz | 2002-08-22 11:25:16 -0400 (Thu, 22 Aug 2002) | 1 line Changed paths: A /poolserver/trunk Poolserver Main Trunk ------------------------------------------------------------------------ ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/svnLogInvalidReason.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000000040511304050224033774 0ustar twernertwerner------------------------------------------------------------------------ invalid revision | unconventional author output (somedata) | 2002-08-26 14:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines ------------------------------------------------------------------------././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/svnLogValidOutput.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000000122211304050224033772 0ustar twernertwerner------------------------------------------------------------------------ r15 | unconventional author output (somedata) | 2002-08-26 14:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml M /poolserver/trunk/project.properties Minor formatting changes. ------------------------------------------------------------------------ r15 | unconventional author output (somedata) | 2002-08-26 14:33:26 -0400 (Mon, 26 Aug 2002) | 3 lines Changed paths: M /poolserver/trunk/build.xml M /poolserver/trunk/project.properties Minor formatting changes. ------------------------------------------------------------------------././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/svnlog2.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000036435710400307044034020 0ustar twernertwerner------------------------------------------------------------------------ r328167 | evenisse | 2005-10-25 00:14:48 +0200 (mar., 25 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml Fix new version ------------------------------------------------------------------------ r328110 | evenisse | 2005-10-24 19:48:04 +0200 (lun., 24 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml [maven-release-plugin] prepare for next development iteration ------------------------------------------------------------------------ r328107 | evenisse | 2005-10-24 19:46:43 +0200 (lun., 24 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml [maven-release-plugin] prepare release maven-scm-1.0-alpha-4 ------------------------------------------------------------------------ r328103 | evenisse | 2005-10-24 19:41:46 +0200 (lun., 24 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java ------------------------------------------------------------------------ r306797 | evenisse | 2005-10-06 18:11:15 +0200 (jeu., 06 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml D /maven/scm/trunk/maven-scm-api/release-pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml D /maven/scm/trunk/maven-scm-client/release-pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml D /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/release-pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml D /maven/scm/trunk/maven-scm-managers/release-pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml D /maven/scm/trunk/maven-scm-plugin/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/release-pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml D /maven/scm/trunk/maven-scm-providers/release-pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml D /maven/scm/trunk/maven-scm-test/release-pom.xml M /maven/scm/trunk/pom.xml D /maven/scm/trunk/release-pom.xml [maven-release-plugin] prepare for next development iteration ------------------------------------------------------------------------ r306793 | evenisse | 2005-10-06 18:09:06 +0200 (jeu., 06 oct. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml A /maven/scm/trunk/maven-scm-api/release-pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml A /maven/scm/trunk/maven-scm-client/release-pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml A /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/release-pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml A /maven/scm/trunk/maven-scm-managers/release-pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml A /maven/scm/trunk/maven-scm-plugin/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/release-pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml A /maven/scm/trunk/maven-scm-providers/release-pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml A /maven/scm/trunk/maven-scm-test/release-pom.xml M /maven/scm/trunk/pom.xml A /maven/scm/trunk/release-pom.xml [maven-release-plugin] prepare release maven-scm-1.0-alpha-3 ------------------------------------------------------------------------ r289568 | brett | 2005-09-16 16:50:16 +0200 (ven., 16 sept. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml D /maven/scm/trunk/maven-scm-api/release-pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml D /maven/scm/trunk/maven-scm-client/release-pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml D /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/release-pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml D /maven/scm/trunk/maven-scm-managers/release-pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml D /maven/scm/trunk/maven-scm-plugin/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/release-pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml D /maven/scm/trunk/maven-scm-providers/release-pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml D /maven/scm/trunk/maven-scm-test/release-pom.xml M /maven/scm/trunk/pom.xml D /maven/scm/trunk/release-pom.xml [maven-release-plugin] prepare for next development iteration ------------------------------------------------------------------------ r289566 | brett | 2005-09-16 16:42:25 +0200 (ven., 16 sept. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml A /maven/scm/trunk/maven-scm-api/release-pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml A /maven/scm/trunk/maven-scm-client/release-pom.xml M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/pom.xml A /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/release-pom.xml M /maven/scm/trunk/maven-scm-managers/pom.xml A /maven/scm/trunk/maven-scm-managers/release-pom.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml A /maven/scm/trunk/maven-scm-plugin/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/release-pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/release-pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml A /maven/scm/trunk/maven-scm-providers/release-pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml A /maven/scm/trunk/maven-scm-test/release-pom.xml M /maven/scm/trunk/pom.xml A /maven/scm/trunk/release-pom.xml [maven-release-plugin] prepare release maven-scm-2.0-alpha-2 ------------------------------------------------------------------------ r279254 | brett | 2005-09-07 07:57:38 +0200 (mer., 07 sept. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/remove/SvnRemoveCommand.java not a valid arg to svn remove ------------------------------------------------------------------------ r264804 | evenisse | 2005-08-30 18:09:04 +0200 | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandLineScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AddScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/CheckInScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/RemoveScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/StatusScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/TagScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/login/LoginScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add/LocalAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkin/LocalCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/remove/SvnRemoveCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateScmResult.java Add executed command line to all ScmResult ------------------------------------------------------------------------ r225626 | evenisse | 2005-07-27 22:47:26 +0200 (mer., 27 juil. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java Add message for wrong url ------------------------------------------------------------------------ r225265 | evenisse | 2005-07-26 11:16:45 +0200 (mar., 26 juil. 2005) | 6 lines Changed paths: D /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandNameConstants.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/NoSuchScmProviderException.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/src/main/java/org/apache/maven/scm/manager/plexus/DefaultScmManager.java M /maven/scm/trunk/maven-scm-managers/maven-scm-manager-plexus/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-plugin/pom.xml M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/LocalScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTestCase.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/CheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java M /maven/scm/trunk/pom.xml o [SCM-50]. flesh out the SCM provider interface All commands are accessible in ScmProvider o Remove CommandNameConstants o Commands are now loaded without Plexus ------------------------------------------------------------------------ r224674 | evenisse | 2005-07-25 01:27:38 +0200 (lun., 25 juil. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/AbstractRemoveCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/RemoveScmResult.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/remove/CvsRemoveCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/remove A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/remove/SvnRemoveCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/remove/SvnRemoveConsumer.java Apply remove command for svn and cvs from jdcasey ------------------------------------------------------------------------ r219919 | evenisse | 2005-07-20 16:44:21 +0200 (mer., 20 juil. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/login/CvsLoginCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/repository/PerforceScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/repository/StarteamScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java Share user and password between all providers repositories ------------------------------------------------------------------------ r209900 | evenisse | 2005-07-08 23:53:05 +0200 (ven., 08 juil. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/UnknownRepositoryStructure.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java M /maven/scm/trunk/maven-scm-plugin/pom.xml M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckinMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DiffMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/StatusMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/TagMojo.java M /maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/diff/diff.txt M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/status/status.txt M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/EntriesReader.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/Entry.java M /maven/scm/trunk/maven-scm-site/pom.xml M /maven/scm/trunk/maven-scm-site/src/site/apt/scm-url-format.apt M /maven/scm/trunk/maven-scm-site/src/site/apt/scmtools.apt Fix svn properties ------------------------------------------------------------------------ r209102 | evenisse | 2005-07-04 19:30:26 +0200 (lun., 04 juil. 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/UnknownRepositoryStructure.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Entries A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Entries.Extra A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Entries.Extra.Old A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Entries.Old A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Root A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/CVS/Template A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/resources/checkoutdir/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/EntriesReader.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/Entry.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java M /maven/scm/trunk/pom.xml [SCM-37]. Add ability to find the SCM url from a directory ------------------------------------------------------------------------ r208649 | evenisse | 2005-06-30 19:35:35 +0200 (jeu., 30 juin 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java Add some debug messages ------------------------------------------------------------------------ r201797 | brett | 2005-06-26 01:05:43 +0200 (dim., 26 juin 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java fix problem parsing response of certain svn clients ------------------------------------------------------------------------ r201634 | evenisse | 2005-06-24 17:50:34 +0200 (ven., 24 juin 2005) | 6 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java [SCM-40] Allow username configuration for svn+ssh [SCM-41] username as part of svn+ssh url is now accepted The general format for svn url is scm:(svn_protocol)/[username@]url like scm:svn+ssh://myusername@myserver/path_to_repo ------------------------------------------------------------------------ r191730 | evenisse | 2005-06-21 23:35:52 +0200 (mar., 21 juin 2005) | 3 lines Changed paths: D /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/Command.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/AbstractStatusCommand.java D /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java D /maven/scm/trunk/maven-scm-api/src/main/resources M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ScmFileSetTest.java D /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/manager M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/CvsScmTestUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java M /maven/scm/trunk/maven-scm-test/pom.xml A /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTestCase.java (from /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java:191665) M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/CheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java M /maven/scm/trunk/pom.xml [SCM-36] Decouple from Plexus. ScmManager is now in plexus-components ------------------------------------------------------------------------ r189654 | evenisse | 2005-06-09 00:03:01 +0200 (jeu., 09 juin 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java [SCM-43] Access to the changeSet list from update command. ------------------------------------------------------------------------ r189558 | evenisse | 2005-06-08 10:37:34 +0200 (mer., 08 juin 2005) | 4 lines Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeFile.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ChangeSet.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java D /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogEntry.java D /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogFile.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeFileTest.java A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/ChangeSetTest.java D /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogEntryTest.java D /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogFileTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/test/java/org/apache/maven/scm/provider/perforce/command/changelog/PerforceChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml Refactoring of changes list use by changelog : - use now ChangeSet and ChangeFile instead of ChangeLogEntry and ChangeLogFile. - move this class in org.apache.maven.scm for shared with other commands. - The modifications list contains now a list of ChangeSet without sorting or grouping. Sorting and grouping will be the work of a ChangeSorter. ------------------------------------------------------------------------ r169922 | brett | 2005-05-13 04:59:16 +0200 (ven., 13 mai 2005) | 1 line Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml internal release: alpha-1 ------------------------------------------------------------------------ r162313 | trygvis | 2005-04-06 16:05:04 +0200 (mer., 06 avr. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java o Removing debugging output. ------------------------------------------------------------------------ r162312 | trygvis | 2005-04-06 15:55:50 +0200 (mer., 06 avr. 2005) | 7 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepositoryException.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/manager/ScmManagerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommandTckTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepositoryTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java o Adding ScmManager.validateScmUrl(). This method will return a List of Strings which are human readable. o Changed the delimiter from a String to a char. Added a implementation that delegates to the original version to the AbstractScmProvider so we don't have to change all the providers right now. o Uncommented out a couple of tests. ------------------------------------------------------------------------ r162311 | evenisse | 2005-04-05 21:58:50 +0200 (mar., 05 avr. 2005) | 3 lines Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml - Change groupId to org.apache.maven.scm - Update plexus dependencies ------------------------------------------------------------------------ r162310 | brett | 2005-03-30 14:02:35 +0200 (mer., 30 mars 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java fix SvnUpdateCommandTckTest ------------------------------------------------------------------------ r162306 | trygvis | 2005-03-28 13:17:40 +0200 (lun., 28 mars 2005) | 3 lines Changed paths: D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmProviderTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java o Partially fixing test cases. o Removing empty test case. ------------------------------------------------------------------------ r162305 | evenisse | 2005-03-13 18:44:48 +0100 (dim., 13 mars 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml Update poms ------------------------------------------------------------------------ r162304 | brett | 2005-03-10 20:10:53 +0100 (jeu., 10 mars 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/pom.xml M /maven/scm/trunk/maven-scm-client/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-clearcase/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml M /maven/scm/trunk/maven-scm-providers/pom.xml M /maven/scm/trunk/maven-scm-test/pom.xml M /maven/scm/trunk/pom.xml flip poms ------------------------------------------------------------------------ r162302 | brett | 2005-02-17 02:04:48 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java allow lazy setting of username/password ------------------------------------------------------------------------ r162301 | brett | 2005-02-17 01:52:19 +0100 | 2 lines Changed paths: A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java make --username, --password and --non-interactive global options applied to all ------------------------------------------------------------------------ r162298 | brett | 2005-01-18 09:28:53 +0100 (mar., 18 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileSet.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommand.java directory handling only for now ------------------------------------------------------------------------ r162296 | brett | 2005-01-13 12:28:14 +0100 (jeu., 13 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandNameConstants.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileStatus.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/status A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/AbstractStatusCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/status/StatusScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/status A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/status/CvsStatusCommandTckTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/status A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommandTckTest.java A /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status A /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckTest.java implement status checks ------------------------------------------------------------------------ r162287 | brett | 2005-01-12 12:56:52 +0100 (mer., 12 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.java generate a full patch as well ------------------------------------------------------------------------ r162285 | brett | 2005-01-12 12:17:00 +0100 (mer., 12 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/add/CvsAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffCommandTckTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/diff/CvsDiffConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.java implement diff for CVS, add "-f" to all CVS commands ------------------------------------------------------------------------ r162284 | brett | 2005-01-12 11:30:53 +0100 (mer., 12 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileStatus.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/diff A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.java implement diff for SVN - only testing working copy changes at present ------------------------------------------------------------------------ r162283 | brett | 2005-01-12 09:53:11 +0100 (mer., 12 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java remove getModule() again - no real concept of a module exposed through the API ------------------------------------------------------------------------ r162276 | evenisse | 2005-01-11 10:49:07 +0100 (mar., 11 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java Don't use simplified parameter. ------------------------------------------------------------------------ r162275 | brett | 2005-01-11 10:32:12 +0100 (mar., 11 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java fix subversion add: must not be recursive ------------------------------------------------------------------------ r162269 | brett | 2005-01-10 12:56:23 +0100 (lun., 10 janv. 2005) | 2 lines Changed paths: A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.java A /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff A /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.java add diff skeleton ------------------------------------------------------------------------ r162268 | brett | 2005-01-10 12:51:29 +0100 (lun., 10 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/DiffScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/ScmUpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml start diff implementation ------------------------------------------------------------------------ r162264 | brett | 2005-01-07 13:26:39 +0100 (ven., 07 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommand.java improve message ------------------------------------------------------------------------ r162262 | brett | 2005-01-04 10:44:32 +0100 (mar., 04 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/tag A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/tag A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.java complete tag test for svn ------------------------------------------------------------------------ r162261 | brett | 2005-01-03 07:50:57 +0100 (lun., 03 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/tck.dump M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java add trunk/branches/tags structure to tck repo ------------------------------------------------------------------------ r162260 | brett | 2005-01-03 06:13:06 +0100 (lun., 03 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java consistency with others ------------------------------------------------------------------------ r162256 | brett | 2005-01-03 04:19:56 +0100 (lun., 03 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileSet.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add/LocalAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkin/LocalCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.java check in command now supports partial file sets, and is tested in the TCK ------------------------------------------------------------------------ r162255 | brett | 2005-01-03 03:04:08 +0100 (lun., 03 janv. 2005) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInConsumer.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/checkout.dump A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/tck.dump D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/update.dump svn TCK cleanup and corrections ------------------------------------------------------------------------ r162246 | brett | 2004-12-30 11:05:29 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileSet.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AbstractAddCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add/LocalAddCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommandTckTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/add/SvnAddConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java implement add command ------------------------------------------------------------------------ r162244 | brett | 2004-12-30 06:39:00 +0100 | 3 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java o use SCM commands rather than manually building them o don't assertDirectory for empty - checkout does a prune in local provider ------------------------------------------------------------------------ r162243 | brett | 2004-12-30 05:09:27 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.java make test work in cygwin. Must specify -Dcygwin=true ------------------------------------------------------------------------ r162241 | brett | 2004-12-30 04:40:45 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java tweaks ------------------------------------------------------------------------ r162238 | brett | 2004-12-30 03:41:23 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogEntryTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java refactor date creation into ScmTestCase ------------------------------------------------------------------------ r162235 | brett | 2004-12-24 04:41:11 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java correctly set dates for test ------------------------------------------------------------------------ r162232 | brett | 2004-12-24 04:04:48 +0100 | 4 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileSet.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/Command.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AbstractAddCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/CheckInScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo/AbstractFileInfoCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/listfiles/AbstractListFilesCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock/AbstractLockCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/AbstractRemoveCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/TagScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock/AbstractUnlockCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResult.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogEntryTest.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogFileTest.java M /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/manager/ScmManagerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/CvsScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/CvsTagCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/main/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/changelog/CvsChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkin/CvsCheckInCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/checkout/CvsCheckoutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-cvs/src/test/java/org/apache/maven/scm/provider/cvslib/command/update/CvsUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/ScmUpdateScmResult.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/CheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.java - propogate ScmFileSet to commands - optimize imports - next step: add tests for commands on a partial set of files ------------------------------------------------------------------------ r162230 | brett | 2004-12-24 02:22:17 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java fix subversion test case when there is no space in the path, and note the issue when using cygwin's svn executable ------------------------------------------------------------------------ r162226 | brett | 2004-12-20 18:56:19 +0100 | 4 lines Changed paths: M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepository.java M /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/LocalScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java o remove tab characters o remove scmSpecificUrl from ScmRepository - unused o add getModule() to ScmProviderRepository ------------------------------------------------------------------------ r162223 | trygvis | 2004-12-17 20:53:41 +0100 | 2 lines Changed paths: A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTest.java o Adding checkin support for SVN. ------------------------------------------------------------------------ r162222 | trygvis | 2004-12-17 20:53:15 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java o Removing unused test. ------------------------------------------------------------------------ r162219 | trygvis | 2004-12-13 02:01:19 +0100 | 2 lines Changed paths: A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/ScmUpdateScmResult.java o Forgot this one. ------------------------------------------------------------------------ r162218 | trygvis | 2004-12-12 23:34:24 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java o Adding SVN specific revision parsing. ------------------------------------------------------------------------ r162217 | trygvis | 2004-12-12 23:33:53 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java o Making sure the output directory can be controlled. ------------------------------------------------------------------------ r162216 | trygvis | 2004-12-12 23:32:08 +0100 | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java o Improving the SVN URL checking. ------------------------------------------------------------------------ r162214 | evenisse | 2004-11-10 16:30:46 +0100 (mer., 10 nov. 2004) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java Fix path for windows. ------------------------------------------------------------------------ r162212 | trygvis | 2004-11-09 17:07:17 +0100 (mar., 09 nov. 2004) | 2 lines Changed paths: D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/LICENSE.txt D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/NOTICE.txt D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/checkstyle-license.txt D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/project.properties D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScm.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScmProvider.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommand.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapper.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateConsumer.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnRepository.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmProviderTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommandTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapperTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/TestAbstractSvnCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumerTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java D /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/checkout.dump A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/checkout.dump A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/tck/update.dump o Adapting the SVN provider to the new API. ------------------------------------------------------------------------ r162205 | trygvis | 2004-11-02 23:24:39 +0100 (mar., 02 nov. 2004) | 2 lines Changed paths: M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScm.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapper.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnRepository.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapperTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/TestAbstractSvnCommand.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumerTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java M /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnRepositoryTest.java o Updating the license. ------------------------------------------------------------------------ r162153 | trygvis | 2004-10-20 20:03:37 +0200 (mer., 20 oct. 2004) | 2 lines Changed paths: M /maven/scm/trunk A /maven/scm/trunk/.cvsignore A /maven/scm/trunk/maven-scm-api A /maven/scm/trunk/maven-scm-api/.cvsignore A /maven/scm/trunk/maven-scm-api/LICENSE.txt A /maven/scm/trunk/maven-scm-api/NOTICE.txt A /maven/scm/trunk/maven-scm-api/maven.xml A /maven/scm/trunk/maven-scm-api/pom.xml A /maven/scm/trunk/maven-scm-api/src A /maven/scm/trunk/maven-scm-api/src/main A /maven/scm/trunk/maven-scm-api/src/main/java A /maven/scm/trunk/maven-scm-api/src/main/java/org A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandLineScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandNameConstants.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameters.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/NoSuchCommandScmException.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmException.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFile.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmFileStatus.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTestCase.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/AbstractCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/Command.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/CommandLineUtils.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/add A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/add/AbstractAddCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/branch/AbstractBranchCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/AbstractChangeLogCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogConsumer.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogEntry.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogFile.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/changelog/ChangeLogScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/AbstractCheckInCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkin/CheckInScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/AbstractCheckOutCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/checkout/CheckOutScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/diff/AbstractDiffCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/fileinfo/AbstractFileInfoCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/listfiles A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/listfiles/AbstractListFilesCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/lock/AbstractLockCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/remove/AbstractRemoveCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/tag/AbstractTagCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/unlock/AbstractUnlockCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/AbstractUpdateCommand.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/update/UpdateScmResult.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/DefaultScmManager.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/NoSuchScmProviderException.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProviderRepository.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepository.java A /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/repository/ScmRepositoryException.java A /maven/scm/trunk/maven-scm-api/src/main/resources A /maven/scm/trunk/maven-scm-api/src/main/resources/META-INF A /maven/scm/trunk/maven-scm-api/src/main/resources/META-INF/plexus A /maven/scm/trunk/maven-scm-api/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-api/src/test A /maven/scm/trunk/maven-scm-api/src/test/java A /maven/scm/trunk/maven-scm-api/src/test/java/org A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogEntryTest.java A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/command/changelog/ChangeLogFileTest.java A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/manager A /maven/scm/trunk/maven-scm-api/src/test/java/org/apache/maven/scm/manager/ScmManagerTest.java A /maven/scm/trunk/maven-scm-providers A /maven/scm/trunk/maven-scm-providers/.cvsignore A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/.cvsignore A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/LocalScmProvider.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/LocalCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutScmResult.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/repository/LocalScmProviderRepository.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources/META-INF A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources/META-INF/plexus A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/AbstractLocalScmTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckoutCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/repository/LocalRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/readme.txt A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/java/Test.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/.cvsignore A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/LICENSE.txt A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/NOTICE.txt A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/checkstyle-license.txt A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/project.properties A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/SvnScm.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapper.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumer.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnRepository.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/resources/META-INF/plexus/components.xml A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/SvnScmTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/AbstractSvnCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/SvnCommandWrapperTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/TestAbstractSvnCommand.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/changelog/SvnChangeLogConsumerTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnRepositoryTest.java A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/svn A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/svn/changelog A /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/test/resources/svn/changelog/svnlog.txt A /maven/scm/trunk/maven-scm-providers/pom.xml A /maven/scm/trunk/pom.xml Initial revision ------------------------------------------------------------------------ ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resources/svn/changelog/svnLogInvalidDate.txtmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/resourc0000644000175000017500000000033011304050224033771 0ustar twernertwerner------------------------------------------------------------------------ r15 | unconventional author output (somedata) | invalid date | 3 lines ------------------------------------------------------------------------maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/0000755000175000017500000000000011345536670033334 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/info/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/info/SvnInfoCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000227211131635724033673 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.info; import java.io.File; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; public class SvnInfoCommandTest extends ScmTestCase { public void testGetInfoOnEmptyFileSet() throws Exception { ScmFileSet fileSet = new ScmFileSet( new File( getBasedir() ) ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", fileSet, "svn --non-interactive info" ); } private void testCommandLine( String scmUrl, ScmFileSet fileSet, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = SvnInfoCommand.createCommandLine( svnRepository, fileSet, false, null ); assertCommandLine( commandLine, fileSet.getBasedir(), cl ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/branch/SvnExeBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000001206111313217053033661 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.branch; /* * 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. */ import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.provider.svn.command.branch.SvnBranchCommandTckTest; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * This test tests the branch command. * * @author Emmanuel Venisse * @version $Id: SvnExeBranchCommandTckTest.java 892494 2009-12-19 18:40:43Z olamy $ */ public class SvnExeBranchCommandTckTest extends SvnBranchCommandTckTest { public void testBranchUserNameSvnHttpsRemoteBranchingWithRev() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); ScmBranchParameters scmBranchParameters = new ScmBranchParameters(); scmBranchParameters.setRemoteBranching( true ); scmBranchParameters.setScmRevision( "2" ); testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " --revision 2 https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch", scmBranchParameters ); } public void testBranchUserNameSvnHttpsRemoteBranchingNoRev() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); ScmBranchParameters scmBranchParameters = new ScmBranchParameters(); scmBranchParameters.setRemoteBranching( true ); testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch", scmBranchParameters ); } public void testBranchUserNameSvnHttps() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " . https://foo.com/svn/branches/svnbranch", null ); } public void testBranchUserNameSvnSsh() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); testCommandLine( "scm:svn:svn+ssh://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " . svn+ssh://user@foo.com/svn/branches/svnbranch" ); } private void testCommandLine( String scmUrl, String branch, File messageFile, String user, String commandLine, ScmBranchParameters scmBranchParameters ) throws Exception { File workingDirectory = getTestFile( "target/svn-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); svnRepository.setUser( user ); Commandline cl = null; if ( scmBranchParameters == null ) { cl = SvnBranchCommand.createCommandLine( svnRepository, workingDirectory, branch, messageFile ); } else { cl = SvnBranchCommand.createCommandLine( svnRepository, workingDirectory, branch, messageFile, scmBranchParameters ); } assertCommandLine( commandLine, workingDirectory, cl ); } private void testCommandLine( String scmUrl, String branch, File messageFile, String user, String commandLine ) throws Exception { testCommandLine( scmUrl, branch, messageFile, user, commandLine, null ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000001740311046440455033675 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.update; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.util.SvnUtil; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnUpdateCommandTest.java 683453 2008-08-07 00:26:21Z bentmann $ */ public class SvnUpdateCommandTest extends ScmTestCase { public void testCommandLineWithEmptyTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmTag( "" ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithEmptyBranch() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "" ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithEmptyVersion() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( "" ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithWhitespaceTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmTag( " " ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithWhitespaceBranch() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( " " ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithWhitespaceRevision() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision( " " ), "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithoutTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, "svn --non-interactive update " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", new ScmRevision( "10" ), "svn --username anonymous --non-interactive update -r 10 " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithUsernameAndTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", new ScmRevision( "10" ), "svn --username anonymous --non-interactive update -r 10 " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithCygwinProperty() throws Exception { if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { SvnUtil.setSettingsDirectory( getTestFile( "src/test/resources/svn/update/cygwin" ) ); try { assertTrue( SvnUtil.getSettings().isUseCygwinPath() ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, "svn --non-interactive update /mnt/c/my_working_directory", new File( "c:\\my_working_directory" ) ); } finally { SvnUtil.setSettingsDirectory( SvnUtil.DEFAULT_SETTINGS_DIRECTORY ); } } } public void testCommandLineWithRelativeURLTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "branches/my-test-branch" ), "svn --non-interactive switch http://foo.com/svn/branches/my-test-branch " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithAbsoluteURLTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "http://foo.com/svn/branches/my-test-branch" ), "svn --non-interactive switch http://foo.com/svn/branches/my-test-branch " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithNonDeterminantBase() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/some-project", new ScmBranch( "branches/my-test-branch" ), "svn --non-interactive switch http://foo.com/svn/some-project/branches/my-test-branch " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithNonDeterminantBaseTrailingSlash() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/some-project/", new ScmBranch( "branches/my-test-branch" ), "svn --non-interactive switch http://foo.com/svn/some-project/branches/my-test-branch " + getUpdateTestFile().getAbsolutePath() ); } public void testCommandLineWithBranchSameAsBase() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/tags/my-tag", new ScmTag( "tags/my-tag" ), "svn --non-interactive switch http://foo.com/svn/tags/my-tag " + getUpdateTestFile().getAbsolutePath() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private File getUpdateTestFile() { return getTestFile( "target/svn-update-command-test" ); } private SvnScmProviderRepository getSvnRepository( String scmUrl ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); return (SvnScmProviderRepository) repository.getProviderRepository(); } private void testCommandLine( String scmUrl, ScmVersion version, String commandLine ) throws Exception { File workingDirectory = getUpdateTestFile(); testCommandLine( scmUrl, version, commandLine, workingDirectory ); } private void testCommandLine( String scmUrl, ScmVersion version, String commandLine, File workingDirectory ) throws Exception { Commandline cl = SvnUpdateCommand.createCommandLine( getSvnRepository( scmUrl ), workingDirectory, version ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnExeUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000226310535556312033675 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.update; /* * 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. */ import org.apache.maven.scm.provider.svn.command.update.SvnUpdateCommandTckTest; /** * @author Trygve Laugstøl * @version $Id: SvnExeUpdateCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeUpdateCommandTckTest extends SvnUpdateCommandTckTest { } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000027600000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnExeCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000227410535556312033677 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.svn.command.checkout.SvnCheckOutCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: SvnExeCheckOutCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeCheckOutCommandTckTest extends SvnCheckOutCommandTckTest { } ././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000001052211057056660033673 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnCheckOutCommandTest.java 691064 2008-09-01 21:25:04Z olamy $ */ public class SvnCheckOutCommandTest extends ScmTestCase { private File workingDirectory; private boolean recursive; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void setUp() throws Exception { super.setUp(); recursive = true; workingDirectory = getTestFile( "target/svn-checkout-command-test" ); if ( workingDirectory != null && workingDirectory.isDirectory() ) { FileUtils.deleteDirectory( workingDirectory ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void testCommandLineWithoutRevision() throws Exception { testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", null, "svn --non-interactive checkout http://foo.com/svn/trunk " + workingDirectory.getAbsolutePath() ); } public void testCommandLineWithEmptyRevision() throws Exception { testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "", "svn --non-interactive checkout http://foo.com/svn/trunk " + workingDirectory.getAbsolutePath() ); } public void testCommandLineWithRevision() throws Exception { testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "10", "svn --non-interactive checkout -r 10 http://foo.com/svn/trunk " + workingDirectory.getAbsolutePath() ); } public void testRecursiveCheckOutCommandLine() throws Exception { recursive = false; testCommandLine( getScmManager(), "scm:svn:http://foo.com/svn/trunk", "10", "svn --non-interactive checkout -N -r 10 http://foo.com/svn/trunk " + workingDirectory.getAbsolutePath() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( ScmManager scmManager, String scmUrl, String revision, String commandLine ) throws Exception { ScmRepository repository = scmManager.makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = cl = SvnCheckOutCommand.createCommandLine( svnRepository, workingDirectory, new ScmRevision( revision ), svnRepository.getUrl(), recursive ); assertCommandLine( commandLine, workingDirectory.getParentFile(), cl ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/status/SvnExeStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000225110535556312033672 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.status; /* * 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. */ import org.apache.maven.scm.provider.svn.command.status.SvnStatusCommandTckTest; /** * @author Brett Porter * @version $Id: SvnExeStatusCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeStatusCommandTckTest extends SvnStatusCommandTckTest { } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/export/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/export/SvnExportCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000340611132445262033670 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.export; import java.io.File; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; public class SvnExportCommandTest extends ScmTestCase { public void testGetExportCommandLineWithImplicitExportDirectory() throws Exception { File exportDirectory = new File( getBasedir() ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", exportDirectory, null, "svn --non-interactive export --force scm:svn:http://foo.com/svn/trunk" ); } public void testGetExportCommandLineWithExplicitExportDirectory() throws Exception { File exportDirectory = new File( getBasedir() ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", exportDirectory, exportDirectory, "svn --non-interactive export --force scm:svn:http://foo.com/svn/trunk " + exportDirectory ); } private void testCommandLine( String scmUrl, File workingDirectory, File exportDirectory, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = SvnExeExportCommand.createCommandLine( svnRepository, exportDirectory, null, scmUrl, exportDirectory != null?exportDirectory.getAbsolutePath():null ); assertCommandLine( commandLine, exportDirectory, cl ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000773411305052514033674 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.tag; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.provider.svn.command.tag.SvnTagCommandTckTest; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; /** * This test tests the tag command. * * @author Brett Porter * @version $Id: SvnExeTagCommandTckTest.java 885618 2009-11-30 23:29:16Z olamy $ */ public class SvnExeTagCommandTckTest extends SvnTagCommandTckTest { public void testTagUserNameSvnSsh() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); testCommandLine( "scm:svn:svn+ssh://foo.com/svn/trunk", "svntag", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " . svn+ssh://user@foo.com/svn/tags/svntag", null ); } public void testTagRemoteTagHttps() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); ScmTagParameters scmTagParameters = new ScmTagParameters(); scmTagParameters.setRemoteTagging( true ); testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " https://foo.com/svn/trunk https://foo.com/svn/tags/svntag", scmTagParameters ); } public void testTagRemoteTagHttpsWithRevision() throws Exception { File messageFile = File.createTempFile( "maven-scm", "commit" ); messageFile.deleteOnExit(); ScmTagParameters scmTagParameters = new ScmTagParameters(); scmTagParameters.setRemoteTagging( true ); scmTagParameters.setScmRevision( "12" ); testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user", "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath() + " --revision 12 https://foo.com/svn/trunk https://foo.com/svn/tags/svntag", scmTagParameters ); } private void testCommandLine( String scmUrl, String tag, File messageFile, String user, String commandLine, ScmTagParameters scmTagParameters ) throws Exception { File workingDirectory = getTestFile( "target/svn-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); svnRepository.setUser( user ); Commandline cl = null; cl = SvnTagCommand.createCommandLine( svnRepository, workingDirectory, tag, messageFile, scmTagParameters ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/SvnCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000765211053631040033670 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.util.SvnUtil; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Trygve Laugstøl * @version $Id: SvnCheckInCommandTest.java 688200 2008-08-22 21:39:44Z olamy $ */ public class SvnCheckInCommandTest extends ScmTestCase { private File messageFile; private String messageFileString; public void setUp() throws Exception { super.setUp(); messageFile = new File( "commit-message" ); String path = messageFile.getAbsolutePath(); if ( path.indexOf( ' ' ) >= 0 ) { path = "\"" + path + "\""; } messageFileString = "--file " + path; } public void testCommandLineWithEmptyTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", "svn --non-interactive commit " + messageFileString ); } public void testCommandLineWithoutTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", "svn --non-interactive commit " + messageFileString ); } public void testCommandLineTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", "svn --username anonymous --non-interactive commit " + messageFileString ); } public void testCommandLineWithUsernameAndTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", "svn --username anonymous --non-interactive commit " + messageFileString ); } public void testCommandLineWithUsernameWithoutNonInteractive() throws Exception { try { SvnUtil.setSettingsDirectory( getTestFile( "src/test/resources/svn/checkin/macos" ) ); testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", "svn --username anonymous commit " + messageFileString ); } finally { SvnUtil.setSettingsDirectory( SvnUtil.DEFAULT_SETTINGS_DIRECTORY ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/svn-checkin-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = SvnCheckInCommand.createCommandLine( svnRepository, new ScmFileSet( workingDirectory ), messageFile ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/SvnExeCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000225710535556312033700 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.svn.command.checkin.SvnCheckInCommandTckTest; /** * @author Brett Porter * @version $Id: SvnExeCheckInCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeCheckInCommandTckTest extends SvnCheckInCommandTckTest { } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnExeListCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000224010535556312033670 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.list; /* * 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. */ import org.apache.maven.scm.provider.svn.command.list.SvnListCommandTckTest; /** * @author Carlos Sanchez * @version $Id: SvnExeListCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeListCommandTckTest extends SvnListCommandTckTest { } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000714111015073323033663 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Carlos Sanchez * @version $Id: SvnListCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class SvnListCommandTest extends ScmTestCase { public void testCommandLineWithEmptyTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", true, "svn --non-interactive list --recursive" ); } public void testCommandLineWithWhitespaceTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", false, "svn --non-interactive list" ); } public void testCommandLineWithoutTag() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", false, "svn --non-interactive list" ); } public void testCommandLineTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", false, "10", "svn --username anonymous --non-interactive list -r 10" ); } public void testCommandLineWithUsernameAndTag() throws Exception { testCommandLine( "scm:svn:http://anonymous@foo.com/svn/trunk", false, "10", "svn --username anonymous --non-interactive list -r 10" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private SvnScmProviderRepository getSvnRepository( String scmUrl ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); return (SvnScmProviderRepository) repository.getProviderRepository(); } private void testCommandLine( String scmUrl, boolean recursive, String commandLine ) throws Exception { testCommandLine( scmUrl, recursive, null, commandLine ); } private void testCommandLine( String scmUrl, boolean recursive, String revision, String commandLine ) throws Exception { ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) ); Commandline cl = SvnListCommand.createCommandLine( getSvnRepository( scmUrl ), fileSet, recursive, new ScmRevision( revision ) ); assertCommandLine( commandLine + " http://foo.com/svn/trunk/.", new File( System.getProperty( "java.io.tmpdir" ) ), cl ); } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtilsTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000442611015073323033666 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnCommandLineUtilsTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class SvnCommandLineUtilsTest extends ScmTestCase { public void testCryptPassword() { SvnScmProviderRepository repo = new SvnScmProviderRepository( "https://svn.apache.org/repos/asf/maven/scm/trunk", "username", "password" ); String clString = SvnCommandLineUtils.cryptPassword( SvnCommandLineUtils.getBaseSvnCommandLine( new File( "." ), repo ) ); Commandline expectedCmd = new Commandline( "svn --username username --password ***** --non-interactive" ); expectedCmd.setWorkingDirectory( new File( "." ).getAbsolutePath() ); assertEquals( expectedCmd.toString(), clString ); repo = new SvnScmProviderRepository( "https://svn.apache.org/repos/asf/maven/scm/trunk", "username", null ); clString = SvnCommandLineUtils.cryptPassword( SvnCommandLineUtils.getBaseSvnCommandLine( new File( "." ), repo ) ); assertCommandLine( "svn --username username --non-interactive", new File( "." ), SvnCommandLineUtils.getBaseSvnCommandLine( new File( "." ), repo ) ); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/SvnExeDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000000223510535556312033674 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.diff; /* * 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. */ import org.apache.maven.scm.provider.svn.command.diff.SvnDiffCommandTckTest; /** * @author Brett Porter * @version $Id: SvnExeDiffCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnExeDiffCommandTckTest extends SvnDiffCommandTckTest { } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000001713711015073323033671 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Calendar; import java.util.Date; /** * @author Emmanuel Venisse * @version $Id: SvnChangeLogCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class SvnChangeLogCommandTest extends ScmTestCase { public void testCommandLineNoDates() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, null, null, "svn --non-interactive log -v http://foo.com/svn/trunk" ); } public void testCommandLineWithDates() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, GMT_TIME_ZONE ); Date endDate = getDate( 2003, Calendar.OCTOBER, 10, GMT_TIME_ZONE ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, startDate, endDate, "svn --non-interactive log -v -r \"{2003-09-10 00:00:00 +0000}:{2003-10-10 00:00:00 +0000}\" http://foo.com/svn/trunk" ); } public void testCommandLineStartDateOnly() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, startDate, null, "svn --non-interactive log -v -r \"{2003-09-10 01:01:01 +0000}:HEAD\" http://foo.com/svn/trunk" ); } public void testCommandLineDateFormat() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, startDate, endDate, "svn --non-interactive log -v -r \"{2003-09-10 01:01:01 +0000}:{2005-11-13 23:23:23 +0000}\" http://foo.com/svn/trunk" ); } public void testCommandLineEndDateOnly() throws Exception { Date endDate = getDate( 2003, Calendar.NOVEMBER, 10, GMT_TIME_ZONE ); // Only specifying end date should print no dates at all testCommandLine( "scm:svn:http://foo.com/svn/trunk", null, null, endDate, "svn --non-interactive log -v http://foo.com/svn/trunk" ); } public void testCommandLineWithBranchNoDates() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "my-test-branch" ), null, null, "svn --non-interactive log -v http://foo.com/svn/branches/my-test-branch http://foo.com/svn/trunk" ); } public void testCommandLineWithBranchStartDateOnly() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "my-test-branch" ), startDate, null, "svn --non-interactive log -v -r \"{2003-09-10 01:01:01 +0000}:HEAD\" http://foo.com/svn/branches/my-test-branch http://foo.com/svn/trunk" ); } public void testCommandLineWithBranchEndDateOnly() throws Exception { Date endDate = getDate( 2003, Calendar.OCTOBER, 10, 1, 1, 1, GMT_TIME_ZONE ); // Only specifying end date should print no dates at all testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "my-test-branch" ), null, endDate, "svn --non-interactive log -v http://foo.com/svn/branches/my-test-branch http://foo.com/svn/trunk" ); } public void testCommandLineWithBranchBothDates() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, GMT_TIME_ZONE ); Date endDate = getDate( 2003, Calendar.OCTOBER, 10, GMT_TIME_ZONE ); testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmBranch( "my-test-branch" ), startDate, endDate, "svn --non-interactive log -v -r \"{2003-09-10 00:00:00 +0000}:{2003-10-10 00:00:00 +0000}\" http://foo.com/svn/branches/my-test-branch http://foo.com/svn/trunk" ); } public void testCommandLineWithStartVersion() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision("1"), null, "svn --non-interactive log -v -r 1:HEAD http://foo.com/svn/trunk" ); } public void testCommandLineWithStartVersionAndEndVersion() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision("1"), new ScmRevision("10"), "svn --non-interactive log -v -r 1:10 http://foo.com/svn/trunk" ); } public void testCommandLineWithStartVersionAndEndVersionEquals() throws Exception { testCommandLine( "scm:svn:http://foo.com/svn/trunk", new ScmRevision("1"), new ScmRevision("1"), "svn --non-interactive log -v -r 1 http://foo.com/svn/trunk" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, ScmBranch branch, Date startDate, Date endDate, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/svn-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = SvnChangeLogCommand.createCommandLine( svnRepository, workingDirectory, branch, startDate, endDate, null, null ); assertCommandLine( commandLine, workingDirectory, cl ); } private void testCommandLine( String scmUrl, ScmVersion startVersion, ScmVersion endVersion, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/svn-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository(); Commandline cl = SvnChangeLogCommand.createCommandLine( svnRepository, workingDirectory, null, null, null, startVersion, endVersion ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000027300000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/or0000644000175000017500000001667411304175555033711 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.changelog; /* * 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. */ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.logging.Logger; /** * @author Emmanuel Venisse * @version $Id: SvnChangeLogConsumerTest.java 885082 2009-11-28 10:29:01Z olamy $ */ public class SvnChangeLogConsumerTest extends PlexusTestCase { Logger logger; SvnChangeLogConsumer consumer; protected void setUp() throws Exception { super.setUp(); logger = getContainer().getLogger(); consumer = new SvnChangeLogConsumer( new DefaultLog(), null ); } /** * Initial modifications should be empty. */ public void testGetModifications_Initial() { assertTrue("Initial modifications should be empty", consumer.getModifications().isEmpty()); } /** * Valid svn log output should have expected values. * * @throws Exception if any problem occurs. */ public void testConsumeLine_ValidOutput() throws Exception { final File svnLog = getTestFile( "/src/test/resources/svn/changelog/svnLogValidOutput.txt" ); consumeLog( svnLog ); final ChangeSet entry = (ChangeSet) consumer.getModifications().get( 0 ); final List changedFiles = entry.getFiles(); final String revision = ( (ChangeFile) changedFiles.get( 0 ) ).getRevision(); assertEquals( "Valid revision expected", "15", revision ); assertEquals( "Valid num changed files expected", 2, changedFiles.size() ); assertEquals( "Valid name expected", "unconventional author output (somedata)", entry.getAuthor() ); assertEquals( "Valid date expected", "2002-08-26", entry.getDateFormatted() ); assertEquals( "Valid comment expected", "Minor formatting changes.\n", entry.getComment() ); } /** * Svn log output with an invalid reason should throw an IllegalOutputException. * * @throws Exception */ public void testConsumeLine_InvalidReason() throws Exception { final File svnLog = getTestFile( "/src/test/resources/svn/changelog/svnLogInvalidReason.txt" ); try { consumeLog( svnLog ); fail( "Svn log output with an invalid reason should throw IllegalOutputException" ); } catch ( final IllegalOutputException e ) { assertTrue( true ); } } /** * Svn log output with an invalid date should throw an IllegalOutputException. * * @throws Exception */ public void testConsumeLine_InvalidDate() throws Exception { final File svnLog = getTestFile( "/src/test/resources/svn/changelog/svnLogInvalidDate.txt" ); try { consumeLog( svnLog ); fail( "Svn log output with an invalid date should throw IllegalOutputException" ); } catch ( final IllegalOutputException e ) { assertTrue( true ); } } /** * Consumes change log information stored in a file. * * @param logFile the file. * @throws IOException if a problem occurs. */ private void consumeLog( final File logFile ) throws IOException { final BufferedReader reader = new BufferedReader( new FileReader( logFile ) ); String line = reader.readLine(); while ( line != null ) { consumer.consumeLine( line ); line = reader.readLine(); } } public void testConsumerWithPattern1() throws Exception { StringBuffer out = new StringBuffer(); File f = getTestFile( "/src/test/resources/svn/changelog/svnlog.txt" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List modifications = consumer.getModifications(); out.append( "Text format:" ); out.append( "nb modifications : " + modifications.size() ); for ( Iterator i = modifications.iterator(); i.hasNext(); ) { ChangeSet entry = (ChangeSet) i.next(); out.append( "Author:" + entry.getAuthor() ); out.append( "Date:" + entry.getDate() ); out.append( "Comment:" + entry.getComment() ); List files = entry.getFiles(); for ( Iterator it = files.iterator(); it.hasNext(); ) { ChangeFile file = (ChangeFile) it.next(); out.append( "File:" + file.getName() ); } out.append( "==============================" ); } out.append( "XML format:" ); out.append( "nb modifications : " + modifications.size() ); for ( Iterator i = modifications.iterator(); i.hasNext(); ) { ChangeSet entry = (ChangeSet) i.next(); out.append( entry.toXML() ); out.append( "==============================" ); } if ( logger.isDebugEnabled() ) { logger.debug( out.toString() ); } } public void testConsumerWithPattern2() throws Exception { StringBuffer out = new StringBuffer(); File f = getTestFile( "/src/test/resources/svn/changelog/svnlog2.txt" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List modifications = consumer.getModifications(); out.append( "nb modifications : " + modifications.size() ); for ( Iterator i = modifications.iterator(); i.hasNext(); ) { ChangeSet entry = (ChangeSet) i.next(); out.append( "Author:" + entry.getAuthor() ); out.append( "Date:" + entry.getDate() ); out.append( "Comment:" + entry.getComment() ); List files = entry.getFiles(); for ( Iterator it = files.iterator(); it.hasNext(); ) { ChangeFile file = (ChangeFile) it.next(); out.append( "File:" + file.getName() ); } out.append( "==============================" ); } if ( logger.isDebugEnabled() ) { logger.debug( out.toString() ); } } }maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/0000755000175000017500000000000011345536670032360 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/0000755000175000017500000000000011345536670033301 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/info/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/info/SvnInfoConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000637111050561465033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.info; /* * 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. */ import org.apache.maven.scm.provider.svn.command.info.SvnInfoItem; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Kenney Westerhof * @version $Id: SvnInfoConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnInfoConsumer implements StreamConsumer { private List infoItems = new ArrayList(); private SvnInfoItem currentItem = new SvnInfoItem(); /** {@inheritDoc} */ public void consumeLine( String s ) { if ( s.equals( "" ) ) { if ( currentItem != null ) { infoItems.add( currentItem ); } currentItem = new SvnInfoItem(); } else if ( s.startsWith( "Path: " ) ) { currentItem.setPath( getValue( s ) ); } else if ( s.startsWith( "URL: " ) ) { currentItem.setURL( getValue( s ) ); } else if ( s.startsWith( "Repository Root: " ) ) { currentItem.setRepositoryRoot( getValue( s ) ); } else if ( s.startsWith( "Repository UUID: " ) ) { currentItem.setRepositoryUUID( getValue( s ) ); } else if ( s.startsWith( "Revision: " ) ) { currentItem.setRevision( getValue( s ) ); } else if ( s.startsWith( "Node Kind: " ) ) { currentItem.setNodeKind( getValue( s ) ); } else if ( s.startsWith( "Schedule: " ) ) { currentItem.setSchedule( getValue( s ) ); } else if ( s.startsWith( "Last Changed Author: " ) ) { currentItem.setLastChangedAuthor( getValue( s ) ); } else if ( s.startsWith( "Last Changed Rev: " ) ) { currentItem.setLastChangedRevision( getValue( s ) ); } else if ( s.startsWith( "Last Changed Date: " ) ) { currentItem.setLastChangedDate( getValue( s ) ); } } private static String getValue( String s ) { int idx = s.indexOf( ": " ); if ( idx < 0 ) { // FIXME: Can't throw any exceptions in consumeLine.. return null; } else { return s.substring( idx + 2 ); } } public List getInfoItems() { return infoItems; } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/info/SvnInfoCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001113111131635724033632 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.info; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.AbstractCommand; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.command.info.SvnInfoScmResult; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Iterator; /** * @author Kenney Westerhof * @version $Id: SvnInfoCommand.java 733015 2009-01-09 11:58:12Z dantran $ */ public class SvnInfoCommand extends AbstractCommand implements SvnCommand { /** {@inheritDoc} */ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return executeInfoCommand( (SvnScmProviderRepository) repository, fileSet, parameters, false, null ); } public SvnInfoScmResult executeInfoCommand( SvnScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters, boolean recursive, String revision ) throws ScmException { Commandline cl = createCommandLine( repository, fileSet, recursive, revision ); SvnInfoConsumer consumer = new SvnInfoConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new SvnInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new SvnInfoScmResult( cl.toString(), consumer.getInfoItems() ); } //set scope to protected to allow test to call it directly protected static Commandline createCommandLine( SvnScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, String revision ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet.getBasedir(), repository ); cl.createArg().setValue( "info" ); if ( recursive ) { cl.createArg().setValue( "--recursive" ); } if ( StringUtils.isNotEmpty( revision ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( revision ); } Iterator it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { File file = (File) it.next(); if ( repository == null ) { cl.createArg().setValue( file.getPath() ); } else { cl.createArg().setValue( repository.getUrl() + "/" + file.getPath().replace( '\\', '/' ) ); } } return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/branch/SvnBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001656711313217053033645 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.branch; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.branch.AbstractBranchCommand; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnCommandUtils; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: SvnBranchCommand.java 892494 2009-12-19 18:40:43Z olamy $ * @todo since this is just a copy, use that instead. */ public class SvnBranchCommand extends AbstractBranchCommand implements SvnCommand { public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet, String branch, ScmBranchParameters scmBranchParameters ) throws ScmException { if ( branch == null || StringUtils.isEmpty( branch.trim() ) ) { throw new ScmException( "branch name must be specified" ); } if ( fileSet.getFiles().length != 0 ) { throw new ScmException( "This provider doesn't support branching subsets of a directory" ); } SvnScmProviderRepository repository = (SvnScmProviderRepository) repo; File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null ); try { FileUtils.fileWrite( messageFile.getAbsolutePath(), scmBranchParameters.getMessage() ); } catch ( IOException ex ) { return new BranchScmResult( null, "Error while making a temporary file for the commit message: " + ex.getMessage(), null, false ); } Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch, messageFile, scmBranchParameters ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } if ( exitCode != 0 ) { return new BranchScmResult( cl.toString(), "The svn branch command failed.", stderr.getOutput(), false ); } List fileList = new ArrayList(); List files = null; try { files = FileUtils.getFiles( fileSet.getBasedir(), "**", "**/.svn/**", false ); } catch ( IOException e ) { throw new ScmException( "Error while executing command.", e ); } for ( Iterator i = files.iterator(); i.hasNext(); ) { File f = (File) i.next(); fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) ); } return new BranchScmResult( cl.toString(), fileList ); } /** {@inheritDoc} */ public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet, String branch, String message ) throws ScmException { ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message ); return executeBranchCommand( repo, fileSet, branch, scmBranchParameters ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, String branch, File messageFile ) { ScmBranchParameters scmBranchParameters = new ScmBranchParameters(); scmBranchParameters.setRemoteBranching( false ); return createCommandLine( repository, workingDirectory, branch, messageFile, scmBranchParameters ); } public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, String branch, File messageFile, ScmBranchParameters scmBranchParameters ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "copy" ); cl.createArg().setValue( "--file" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); if ( scmBranchParameters != null && scmBranchParameters.isRemoteBranching() ) { if (StringUtils.isNotBlank( scmBranchParameters.getScmRevision() ) ) { cl.createArg().setValue( "--revision" ); cl.createArg().setValue( scmBranchParameters.getScmRevision() ); } cl.createArg().setValue( repository.getUrl() ); } else { cl.createArg().setValue( "." ); } // Note: this currently assumes you have the branch base checked out too String branchUrl = SvnTagBranchUtils.resolveBranchUrl( repository, new ScmBranch( branch ) ); cl.createArg().setValue( SvnCommandUtils.fixUrl( branchUrl, repository.getUser() ) ); return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001402311057610744033637 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.update; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.apache.maven.scm.provider.svn.svnexe.command.changelog.SvnChangeLogCommand; import org.apache.maven.scm.provider.svn.util.SvnUtil; import org.apache.maven.scm.providers.svn.settings.Settings; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnUpdateCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnUpdateCommand extends AbstractUpdateCommand implements SvnCommand { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet.getBasedir(), version ); SvnUpdateConsumer consumer = new SvnUpdateConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new UpdateScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new UpdateScmResultWithRevision( cl.toString(), consumer.getUpdatedFiles(), String.valueOf( consumer.getRevision() ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmVersion version ) { Settings settings = SvnUtil.getSettings(); String workingDir = workingDirectory.getAbsolutePath(); if ( settings.isUseCygwinPath() ) { workingDir = settings.getCygwinMountPath() + "/" + workingDir; workingDir = StringUtils.replace( workingDir, ":", "" ); workingDir = StringUtils.replace( workingDir, "\\", "/" ); } if ( version != null && StringUtils.isEmpty( version.getName() ) ) { version = null; } Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); if ( version == null || SvnTagBranchUtils.isRevisionSpecifier( version ) ) { cl.createArg().setValue( "update" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } cl.createArg().setValue( workingDir ); } else { if ( version instanceof ScmBranch ) { // The tag specified does not appear to be numeric, so assume it refers // to a branch/tag url and perform a switch operation rather than update cl.createArg().setValue( "switch" ); if ( version instanceof ScmTag ) { cl.createArg().setValue( SvnTagBranchUtils.resolveTagUrl( repository, (ScmTag) version ) ); } else { cl.createArg().setValue( SvnTagBranchUtils.resolveBranchUrl( repository, (ScmBranch) version ) ); } cl.createArg().setValue( workingDir ); } } return cl; } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { SvnChangeLogCommand command = new SvnChangeLogCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/update/SvnUpdateConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000770311050561465033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.update; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.svn.svnexe.command.AbstractFileCheckingConsumer; import java.io.File; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: SvnUpdateConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnUpdateConsumer extends AbstractFileCheckingConsumer { private static final String UPDATED_TO_REVISION_TOKEN = "Updated to revision"; private static final String AT_REVISION_TOKEN = "At revision"; private static final String EXPORTED_REVISION_TOKEN = "Exported revision"; private static final String RESTORED_TOKEN = "Restored"; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnUpdateConsumer( ScmLogger logger, File workingDirectory ) { super( logger, workingDirectory ); } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ protected void parseLine( String line ) { line = line.trim(); String statusString = line.substring( 0, 1 ); String file = line.substring( 3 ).trim(); //[SCM-368] if ( file.startsWith( workingDirectory.getAbsolutePath() ) ) { file = file.substring( this.workingDirectory.getAbsolutePath().length() + 1 ); } ScmFileStatus status; if ( line.startsWith( UPDATED_TO_REVISION_TOKEN ) ) { String revisionString = line.substring( UPDATED_TO_REVISION_TOKEN.length() + 1, line.length() - 1 ); revision = parseInt( revisionString ); return; } else if ( line.startsWith( AT_REVISION_TOKEN ) ) { String revisionString = line.substring( AT_REVISION_TOKEN.length() + 1, line.length() - 1 ); revision = parseInt( revisionString ); return; } else if ( line.startsWith( EXPORTED_REVISION_TOKEN ) ) { String revisionString = line.substring( EXPORTED_REVISION_TOKEN.length() + 1, line.length() - 1 ); revision = parseInt( revisionString ); return; } else if ( line.startsWith( RESTORED_TOKEN ) ) { return; } else if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else if ( statusString.equals( "U" ) || statusString.equals( "M" ) ) { status = ScmFileStatus.UPDATED; } else if ( statusString.equals( "D" ) ) { status = ScmFileStatus.DELETED; } else { //Do nothing return; } addFile( new ScmFile( file, status ) ); } public List getUpdatedFiles() { return getFiles(); } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001701011132335440033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.util.SvnUtil; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.util.Iterator; import java.util.List; /** * Command line construction utility. * * @author Brett Porter * @version $Id: SvnCommandLineUtils.java 733437 2009-01-11 09:25:52Z dantran $ */ public class SvnCommandLineUtils { public static void addTarget( Commandline cl, List/**/ files ) throws IOException { if ( files == null || files.isEmpty() ) { return; } StringBuffer sb = new StringBuffer(); String ls = System.getProperty( "line.separator" ); for ( Iterator i = files.iterator(); i.hasNext(); ) { File f = (File) i.next(); sb.append( f.getPath().replace( '\\', '/' ) ); sb.append( ls ); } File targets = File.createTempFile( "maven-scm-", "-targets" ); PrintStream out = new PrintStream( new FileOutputStream( targets ) ); out.print( sb.toString() ); out.flush(); out.close(); cl.createArg().setValue( "--targets" ); cl.createArg().setValue( targets.getAbsolutePath() ); targets.deleteOnExit(); } public static Commandline getBaseSvnCommandLine( File workingDirectory, SvnScmProviderRepository repository ) { Commandline cl = new Commandline(); cl.setExecutable( "svn" ); try { cl.addSystemEnvironment(); cl.addEnvironment( "LC_MESSAGES", "C" ); } catch ( Exception e ) { //Do nothing } if ( workingDirectory != null ) { cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); } if ( !StringUtils.isEmpty( System.getProperty( "maven.scm.svn.config_directory" ) ) ) { cl.createArg().setValue( "--config-dir" ); cl.createArg().setValue( System.getProperty( "maven.scm.svn.config_directory" ) ); } else if ( !StringUtils.isEmpty( SvnUtil.getSettings().getConfigDirectory() ) ) { cl.createArg().setValue( "--config-dir" ); cl.createArg().setValue( SvnUtil.getSettings().getConfigDirectory() ); } if ( repository != null && !StringUtils.isEmpty( repository.getUser() ) ) { cl.createArg().setValue( "--username" ); cl.createArg().setValue( repository.getUser() ); } if ( repository != null && !StringUtils.isEmpty( repository.getPassword() ) ) { cl.createArg().setValue( "--password" ); cl.createArg().setValue( repository.getPassword() ); } if ( SvnUtil.getSettings().isUseNonInteractive() ) { cl.createArg().setValue( "--non-interactive" ); } return cl; } public static int execute( Commandline cl, StreamConsumer consumer, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws CommandLineException { int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); exitCode = checkIfCleanUpIsNeeded( exitCode, cl, consumer, stderr, logger ); return exitCode; } public static int execute( Commandline cl, CommandLineUtils.StringStreamConsumer stdout, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws CommandLineException { int exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr ); exitCode = checkIfCleanUpIsNeeded( exitCode, cl, stdout, stderr, logger ); return exitCode; } private static int checkIfCleanUpIsNeeded( int exitCode, Commandline cl, StreamConsumer consumer, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws CommandLineException { if ( exitCode != 0 && stderr.getOutput() != null && stderr.getOutput().indexOf( "'svn cleanup'" ) > 0 && stderr.getOutput().indexOf( "'svn help cleanup'" ) > 0 ) { if ( logger.isInfoEnabled() ) { logger.info( "Svn command failed due to some locks in working copy. We try to run a 'svn cleanup'." ); } if ( executeCleanUp( cl.getWorkingDirectory(), consumer, stderr, logger ) == 0 ) { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } } return exitCode; } public static int executeCleanUp( File workinDirectory, StreamConsumer stdout, StreamConsumer stderr ) throws CommandLineException { return executeCleanUp( workinDirectory, stdout, stderr, null ); } public static int executeCleanUp( File workinDirectory, StreamConsumer stdout, StreamConsumer stderr, ScmLogger logger ) throws CommandLineException { Commandline cl = new Commandline(); cl.setExecutable( "svn" ); cl.setWorkingDirectory( workinDirectory.getAbsolutePath() ); if ( logger != null ) { if ( logger.isInfoEnabled() ) { logger.info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); logger.info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } } return CommandLineUtils.executeCommandLine( cl, stdout, stderr ); } public static String cryptPassword( Commandline cl ) { String clString = cl.toString(); int pos = clString.indexOf( "--password" ); if ( pos > 0 ) { String beforePassword = clString.substring( 0, pos + "--password ".length() ); String afterPassword = clString.substring( pos + "--password ".length() ); afterPassword = afterPassword.substring( afterPassword.indexOf( " " ) ); if ( Os.isFamily( Os.FAMILY_WINDOWS ) ) { clString = beforePassword + "*****" + afterPassword; } else { clString = beforePassword + "'*****'" + afterPassword; } } return clString; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000635111203353634033637 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.svn.svnexe.command.AbstractFileCheckingConsumer; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: SvnCheckOutConsumer.java 775336 2009-05-15 20:59:08Z olamy $ */ public class SvnCheckOutConsumer extends AbstractFileCheckingConsumer { private static final String CHECKED_OUT_REVISION_TOKEN = "Checked out revision"; private List files = new ArrayList(); public SvnCheckOutConsumer( ScmLogger logger, File workingDirectory ) { super( logger, workingDirectory ); } /** {@inheritDoc} */ protected void parseLine( String line ) { String statusString = line.substring( 0, 1 ); String file = line.substring( 3 ).trim(); ScmFileStatus status; if ( line.startsWith( CHECKED_OUT_REVISION_TOKEN ) ) { String revisionString = line.substring( CHECKED_OUT_REVISION_TOKEN.length() + 1, line.length() - 1 ); revision = parseInt( revisionString ); return; } else if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else if ( statusString.equals( "U" ) ) { status = ScmFileStatus.UPDATED; } else { //Do nothing return; } addFile( new ScmFile( file, status ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getCheckedOutFiles() { return getFiles(); } protected void addFile( ScmFile file ) { files.add( file ); } protected List getFiles() { List onlyFiles = new ArrayList(); for ( Iterator it = files.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); if (!( !file.getStatus().equals( ScmFileStatus.DELETED ) && !new File( file.getPath() ).isFile() )) { onlyFiles.add( file ); } } return onlyFiles; } } ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkout/SvnCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001417011057610744033642 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnCommandUtils; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnCheckOutCommand extends AbstractCheckOutCommand implements SvnCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { SvnScmProviderRepository repository = (SvnScmProviderRepository) repo; String url = repository.getUrl(); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmTag ) { url = SvnTagBranchUtils.resolveTagUrl( repository, (ScmTag) version ); } else if ( version instanceof ScmBranch ) { url = SvnTagBranchUtils.resolveBranchUrl( repository, (ScmBranch) version ); } } url = SvnCommandUtils.fixUrl( url, repository.getUser() ); Commandline cl = createCommandLine( repository, fileSet.getBasedir(), version, url, recursive ); SvnCheckOutConsumer consumer = new SvnCheckOutConsumer( getLogger(), fileSet.getBasedir().getParentFile() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new CheckOutScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Create SVN check out command line in a recursive way. * * @param repository not null * @param workingDirectory not null * @param version not null * @param url not null * @return the SVN command line for the SVN check out. * @see #createCommandLine(SvnScmProviderRepository, File, ScmVersion, String, boolean) */ public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmVersion version, String url ) { return createCommandLine( repository, workingDirectory, version, url, true ); } /** * Create SVN check out command line. * * @param repository not null * @param workingDirectory not null * @param version not null * @param url not null * @param recursive true if recursive check out is wanted, false otherwise. * @return the SVN command line for the SVN check out. * @since 1.1.1 */ public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmVersion version, String url, boolean recursive ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory.getParentFile(), repository ); cl.createArg().setValue( "checkout" ); // add non recursive option if ( !recursive ) { cl.createArg().setValue( "-N" ); } if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmRevision ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } } cl.createArg().setValue( url ); cl.createArg().setValue( workingDirectory.getAbsolutePath() ); return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/status/SvnStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001512111300616371033630 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: SvnStatusConsumer.java 881560 2009-11-17 22:00:25Z struberg $ */ public class SvnStatusConsumer implements StreamConsumer { private ScmLogger logger; private File workingDirectory; private List changedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnStatusConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( StringUtils.isEmpty( line.trim() ) ) { return; } if ( line.length() <= 7 ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unexpected input, the line must be at least seven characters long. Line: '" + line + "'." ); } return; } String statusString = line.substring( 0, 1 ); String file = line.substring( 7 ).trim(); ScmFileStatus status; // The first six columns in the output are each one character wide: // First column: Says if item was added, deleted, or otherwise changed // ' ' no modifications // 'A' Added // 'C' Conflicted // 'D' Deleted // 'I' Ignored // 'M' Modified // 'R' Replaced // 'X' item is unversioned, but is used by an externals definition // '?' item is not under version control // '!' item is missing (removed by non-svn command) or incomplete // '~' versioned item obstructed by some item of a different kind // Second column: Modifications of a file's or directory's properties // ' ' no modifications // 'C' Conflicted // 'M' Modified // Third column: Whether the working copy directory is locked // ' ' not locked // 'L' locked // Fourth column: Scheduled commit will contain addition-with-history // ' ' no history scheduled with commit // '+' history scheduled with commit // Fifth column: Whether the item is switched relative to its parent // ' ' normal // 'S' switched // Sixth column: Repository lock token // (without -u) // ' ' no lock token // 'K' lock token present // (with -u) // ' ' not locked in repository, no lock token // 'K' locked in repository, lock toKen present // 'O' locked in repository, lock token in some Other working copy // 'T' locked in repository, lock token present but sTolen // 'B' not locked in repository, lock token present but Broken // // The out-of-date information appears in the eighth column (with -u): // '*' a newer revision exists on the server // ' ' the working copy is up to date if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else if ( statusString.equals( "M" ) || statusString.equals( "R" ) || statusString.equals( "~" ) ) { status = ScmFileStatus.MODIFIED; } else if ( statusString.equals( "D" ) ) { status = ScmFileStatus.DELETED; } else if ( statusString.equals( "?" ) ) { status = ScmFileStatus.UNKNOWN; } else if ( statusString.equals( "!" ) ) { status = ScmFileStatus.MISSING; } else if ( statusString.equals( "C" ) ) { status = ScmFileStatus.CONFLICT; } else if ( statusString.equals( "L" ) ) { status = ScmFileStatus.LOCKED; } else if ( statusString.equals( "X" ) ) { //skip svn:external entries return; } else if ( statusString.equals( "I" ) ) { //skip svn:external entries return; } else { //Parse the second column statusString = line.substring( 1, 1 ); if ( statusString.equals( "M" ) ) { status = ScmFileStatus.MODIFIED; } else if ( statusString.equals( "C" ) ) { status = ScmFileStatus.CONFLICT; } else { //The line isn't a status line, ie something like 'Performing status on external item at...' //or a status defined in next columns return; } } // If the file isn't a file; don't add it. if ( !status.equals( ScmFileStatus.DELETED ) && !new File( workingDirectory, file ).isFile() ) { return; } changedFiles.add( new ScmFile( file, status ) ); } public List getChangedFiles() { return changedFiles; } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/status/SvnStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000656711057610744033655 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: SvnStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnStatusCommand extends AbstractStatusCommand implements SvnCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet ); SvnStatusConsumer consumer = new SvnStatusConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, ScmFileSet fileSet ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet.getBasedir(), repository ); cl.createArg().setValue( "status" ); return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/export/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/export/SvnExeExportCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001304311132445262033633 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.export; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.export.AbstractExportCommand; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.export.ExportScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnCommandUtils; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.apache.maven.scm.provider.svn.svnexe.command.update.SvnUpdateConsumer; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Emmanuel Venisse * @version $Id: SvnExeExportCommand.java 733500 2009-01-11 19:38:26Z dantran $ */ public class SvnExeExportCommand extends AbstractExportCommand implements SvnCommand { /** {@inheritDoc} */ protected ExportScmResult executeExportCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException { SvnScmProviderRepository repository = (SvnScmProviderRepository) repo; String url = repository.getUrl(); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmTag ) { url = SvnTagBranchUtils.resolveTagUrl( repository, (ScmTag) version ); } else if ( version instanceof ScmBranch ) { url = SvnTagBranchUtils.resolveBranchUrl( repository, (ScmBranch) version ); } } url = SvnCommandUtils.fixUrl( url, repository.getUser() ); Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet.getBasedir(), version, url, outputDirectory ); SvnUpdateConsumer consumer = new SvnUpdateConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); if ( cl.getWorkingDirectory() != null ) { getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new ExportScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new ExportScmResultWithRevision( cl.toString(), consumer.getUpdatedFiles(), String.valueOf( consumer.getRevision() ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmVersion version, String url, String outputSirectory ) { if ( version != null && StringUtils.isEmpty( version.getName() ) ) { version = null; } Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "export" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmRevision ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } } //support exporting to an existing directory cl.createArg().setValue( "--force" ); cl.createArg().setValue( url ); if ( StringUtils.isNotEmpty( outputSirectory ) ) { cl.createArg().setValue( outputSirectory ); } return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/remove/SvnRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000532111057621704033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: SvnRemoveConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SvnRemoveConsumer implements StreamConsumer { private ScmLogger logger; private List removedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnRemoveConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.length() <= 3 ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unexpected input, the line must be at least three characters long. Line: '" + line + "'." ); } return; } String statusString = line.substring( 0, 1 ); String file = line.substring( 3 ); ScmFileStatus status; if ( statusString.equals( "D" ) ) { status = ScmFileStatus.DELETED; } else { if ( logger.isInfoEnabled() ) { logger.info( "Unknown file status: '" + statusString + "'." ); } return; } removedFiles.add( new ScmFile( file, status ) ); } public List getRemovedFiles() { return removedFiles; } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/remove/SvnRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000745711057610744033654 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; import java.util.List; /** * @author Brett Porter * @version $Id: SvnRemoveCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnRemoveCommand extends AbstractRemoveCommand implements SvnCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message ) throws ScmException { if ( fileSet.getFiles().length == 0 ) { throw new ScmException( "You must provide at least one file/directory to remove" ); } Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); SvnRemoveConsumer consumer = new SvnRemoveConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new RemoveScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new RemoveScmResult( cl.toString(), consumer.getRemovedFiles() ); } private static Commandline createCommandLine( File workingDirectory, List/*File*/ files ) throws ScmException { // Base command line doesn't make sense here - username/password not needed, and non-interactive/non-recusive is not valid Commandline cl = new Commandline(); cl.setExecutable( "svn" ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); cl.createArg().setValue( "remove" ); try { SvnCommandLineUtils.addTarget( cl, files ); } catch ( IOException e ) { throw new ScmException( "Can't create the targets file", e ); } return cl; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000002234011305052514033627 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.tag; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnCommandUtils; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: SvnTagCommand.java 885618 2009-11-30 23:29:16Z olamy $ * @todo since this is just a copy, use that instead. */ public class SvnTagCommand extends AbstractTagCommand implements SvnCommand { public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, String message ) throws ScmException { ScmTagParameters scmTagParameters = new ScmTagParameters( message ); // force false to preserve backward comp scmTagParameters.setRemoteTagging( false ); return executeTagCommand( repo, fileSet, tag, scmTagParameters ); } /** {@inheritDoc} */ public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { // NPE free if (scmTagParameters == null) { getLogger().debug( "SvnTagCommand :: scmTagParameters is null create an empty one" ); scmTagParameters = new ScmTagParameters(); scmTagParameters.setRemoteTagging( false ); } else { getLogger().debug( "SvnTagCommand :: scmTagParameters.remoteTagging : " + scmTagParameters.isRemoteTagging() ); } if ( tag == null || StringUtils.isEmpty( tag.trim() ) ) { throw new ScmException( "tag must be specified" ); } if ( fileSet.getFiles().length != 0 ) { throw new ScmException( "This provider doesn't support tagging subsets of a directory" ); } SvnScmProviderRepository repository = (SvnScmProviderRepository) repo; File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null ); try { FileUtils.fileWrite( messageFile.getAbsolutePath(), scmTagParameters == null ? "" : scmTagParameters .getMessage() ); } catch ( IOException ex ) { return new TagScmResult( null, "Error while making a temporary file for the commit message: " + ex.getMessage(), null, false ); } Commandline cl = createCommandLine( repository, fileSet.getBasedir(), tag, messageFile, scmTagParameters ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } if ( exitCode != 0 ) { // TODO: Improve this error message return new TagScmResult( cl.toString(), "The svn tag command failed.", stderr.getOutput(), false ); } List fileList = new ArrayList(); List files = null; try { if ( StringUtils.isNotEmpty( fileSet.getExcludes() ) ) { files = FileUtils.getFiles( fileSet.getBasedir(), ( StringUtils.isEmpty( fileSet.getIncludes() ) ? "**" : fileSet.getIncludes() ), fileSet.getExcludes() + ",**/.svn/**", false ); } else { files = FileUtils.getFiles( fileSet.getBasedir(), ( StringUtils.isEmpty( fileSet.getIncludes() ) ? "**" : fileSet.getIncludes() ), "**/.svn/**", false ); } } catch ( IOException e ) { throw new ScmException( "Error while executing command.", e ); } for ( Iterator i = files.iterator(); i.hasNext(); ) { File f = (File) i.next(); fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) ); } return new TagScmResult( cl.toString(), fileList ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * @deprecated * @param repository * @param workingDirectory * @param tag * @param messageFile * @return */ public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, String tag, File messageFile ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "copy" ); cl.createArg().setValue( "--file" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); cl.createArg().setValue( "." ); // Note: this currently assumes you have the tag base checked out too String tagUrl = SvnTagBranchUtils.resolveTagUrl( repository, new ScmTag( tag ) ); cl.createArg().setValue( SvnCommandUtils.fixUrl( tagUrl, repository.getUser() ) ); return cl; } public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, String tag, File messageFile, ScmTagParameters scmTagParameters ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "copy" ); cl.createArg().setValue( "--file" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); // SCM-487 olamy : this need a svn 1.5 cli //cl.createArg().setValue( "--parents" ); if ( scmTagParameters != null && scmTagParameters.getScmRevision() != null ) { cl.createArg().setValue( "--revision" ); cl.createArg().setValue( scmTagParameters.getScmRevision() ); } if ( scmTagParameters != null && scmTagParameters.isRemoteTagging() ) { cl.createArg().setValue( repository.getUrl() ); } else { cl.createArg().setValue( "." ); } // Note: this currently assumes you have the tag base checked out too String tagUrl = SvnTagBranchUtils.resolveTagUrl( repository, new ScmTag( tag ) ); cl.createArg().setValue( SvnCommandUtils.fixUrl( tagUrl, repository.getUser() ) ); return cl; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/SvnCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000710111057621704033634 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.svn.svnexe.command.AbstractFileCheckingConsumer; import java.io.File; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: SvnCheckInConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SvnCheckInConsumer extends AbstractFileCheckingConsumer { private static final String SENDING_TOKEN = "Sending "; private static final String ADDING_TOKEN = "Adding "; private static final String ADDING_BIN_TOKEN = "Adding (bin) "; private static final String DELETING_TOKEN = "Deleting "; private static final String TRANSMITTING_TOKEN = "Transmitting file data"; private static final String COMMITTED_REVISION_TOKEN = "Committed revision"; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnCheckInConsumer( ScmLogger logger, File workingDirectory ) { super( logger, workingDirectory ); } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ protected void parseLine( String line ) { String file; if ( line.startsWith( COMMITTED_REVISION_TOKEN ) ) { String revisionString = line.substring( COMMITTED_REVISION_TOKEN.length() + 1, line.length() - 1 ); revision = parseInt( revisionString ); return; } else if ( line.startsWith( SENDING_TOKEN ) ) { file = line.substring( SENDING_TOKEN.length() ); } else if ( line.startsWith( ADDING_TOKEN ) ) { file = line.substring( ADDING_TOKEN.length() ); } else if ( line.startsWith( ADDING_BIN_TOKEN ) ) { file = line.substring( ADDING_BIN_TOKEN.length() ); } else if ( line.startsWith( DELETING_TOKEN ) ) { file = line.substring( DELETING_TOKEN.length() ); } else if ( line.startsWith( TRANSMITTING_TOKEN ) ) { // ignore return; } else { if ( logger.isInfoEnabled() ) { logger.info( "Unknown line: '" + line + "'" ); } return; } addFile( new ScmFile( file, ScmFileStatus.CHECKED_IN ) ); } public List getCheckedInFiles() { return getFiles(); } } ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/checkin/SvnCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001167011157547031033643 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; /** * @author Trygve Laugstøl * @version $Id: SvnCheckInCommand.java 755019 2009-03-16 22:09:29Z olamy $ */ public class SvnCheckInCommand extends AbstractCheckInCommand implements SvnCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { throw new ScmException( "This provider command can't handle tags." ); } File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null ); try { FileUtils.fileWrite( messageFile.getAbsolutePath(), message ); } catch ( IOException ex ) { return new CheckInScmResult( null, "Error while making a temporary file for the commit message: " + ex.getMessage(), null, false ); } Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet, messageFile ); SvnCheckInConsumer consumer = new SvnCheckInConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } if ( exitCode != 0 ) { return new CheckInScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles(), Integer.toString( consumer.getRevision() ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, ScmFileSet fileSet, File messageFile ) throws ScmException { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet.getBasedir(), repository ); cl.createArg().setValue( "commit" ); cl.createArg().setValue( "--file" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); try { SvnCommandLineUtils.addTarget( cl, fileSet.getFileList() ); } catch ( IOException e ) { throw new ScmException( "Can't create the targets file", e ); } return cl; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001043111057610744033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.list.AbstractListCommand; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Iterator; /** * Command to list files in SVN ( svn list command ) * * @author Carlos Sanchez * @version $Id: SvnListCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnListCommand extends AbstractListCommand implements SvnCommand { private static final File TMP_DIR = new File( System.getProperty( "java.io.tmpdir" ) ); /** {@inheritDoc} */ protected ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException { Commandline cl = createCommandLine( (SvnScmProviderRepository) repository, fileSet, recursive, version ); SvnListConsumer consumer = new SvnListConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new ListScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new ListScmResult( cl.toString(), consumer.getFiles() ); } static Commandline createCommandLine( SvnScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( TMP_DIR, repository ); cl.createArg().setValue( "list" ); if ( recursive ) { cl.createArg().setValue( "--recursive" ); } if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmRevision ) { cl.createArg().setValue( "-r" ); cl.createArg().setValue( version.getName() ); } } Iterator it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { File file = (File) it.next(); cl.createArg().setValue( repository.getUrl() + "/" + file.getPath().replace( '\\', '/' ) ); } return cl; } } ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/list/SvnListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000326511050561465033643 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Carlos Sanchez * @version $Id: SvnListConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnListConsumer implements StreamConsumer { private List files = new ArrayList(); // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { files.add( new ScmFile( line, ScmFileStatus.CHECKED_IN ) ); } public List getFiles() { return files; } } ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/AbstractFileCheckingConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000566111203353342033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Kenney Westerhof * @version $Id: AbstractFileCheckingConsumer.java 775331 2009-05-15 20:56:02Z olamy $ */ public abstract class AbstractFileCheckingConsumer implements StreamConsumer { protected ScmLogger logger; protected File workingDirectory; private List files = new ArrayList(); protected int revision; private boolean filtered; public AbstractFileCheckingConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; } /** {@inheritDoc} */ public final void consumeLine( String line ) { if ( line.length() <= 3 ) { return; } if ( logger.isDebugEnabled() ) { logger.debug( line ); } parseLine( line ); } protected abstract void parseLine( String line ); protected List getFiles() { if ( !filtered ) { for ( Iterator it = files.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); if ( !file.getStatus().equals( ScmFileStatus.DELETED ) && !new File( workingDirectory, file.getPath() ).isFile() ) { it.remove(); } } filtered = true; } return files; } protected final int parseInt( String revisionString ) { try { return Integer.parseInt( revisionString ); } catch ( NumberFormatException ex ) { return 0; } } protected void addFile( ScmFile file ) { files.add( file ); } public final int getRevision() { return revision; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/diff/SvnDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001045711057610744033646 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.command.diff.SvnDiffConsumer; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Brett Porter * @version $Id: SvnDiffCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnDiffCommand extends AbstractDiffCommand implements SvnCommand { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet.getBasedir(), startVersion, endVersion ); SvnDiffConsumer consumer = new SvnDiffConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new DiffScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmVersion startVersion, ScmVersion endVersion ) { Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "diff" ); if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) ) { cl.createArg().setValue( "-r" ); if ( endVersion != null && StringUtils.isNotEmpty( endVersion.getName() ) ) { cl.createArg().setValue( startVersion.getName() + ":" + endVersion.getName() ); } else { cl.createArg().setValue( startVersion.getName() ); } } return cl; } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000002144711304536546033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.changelog; /* * 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. */ import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.svn.SvnChangeSet; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; /** * @author Emmanuel Venisse * @version $Id: SvnChangeLogConsumer.java 885254 2009-11-29 18:28:54Z olamy $ */ public class SvnChangeLogConsumer extends AbstractConsumer { /** * Date formatter for svn timestamp (after a little massaging) */ private static final String SVN_TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss zzzzzzzzz"; /** * State machine constant: expecting header */ private static final int GET_HEADER = 1; /** * State machine constant: expecting file information */ private static final int GET_FILE = 2; /** * State machine constant: expecting comments */ private static final int GET_COMMENT = 3; /** * A file line begins with a space character */ private static final String FILE_BEGIN_TOKEN = " "; /** * The file section ends with a blank line */ private static final String FILE_END_TOKEN = ""; /** * The filename starts after 5 characters */ private static final int FILE_START_INDEX = 5; /** * The comment section ends with a dashed line */ private static final String COMMENT_END_TOKEN = "------------------------------------" + "------------------------------------"; /** * Current status of the parser */ private int status = GET_HEADER; /** * List of change log entries */ private List entries = new ArrayList(); /** * The current log entry being processed by the parser */ private SvnChangeSet currentChange; /** * The current revision of the entry being processed by the parser */ private String currentRevision; /** * The current comment of the entry being processed by the parser */ private StringBuffer currentComment; /** * The regular expression used to match header lines */ private static final RE HEADER_REG_EXP = new RE("^(.+) \\| (.+) \\| (.+) \\|.*$"); private static final int REVISION_GROUP = 1; private static final int AUTHOR_GROUP = 2; private static final int DATE_GROUP = 3; private static final RE REVISION_REG_EXP1 = new RE("rev (\\d+):"); private static final RE REVISION_REG_EXP2 = new RE("r(\\d+)"); private static final RE DATE_REG_EXP = new RE( "(\\d+-\\d+-\\d+ " + // date 2002-08-24 "\\d+:\\d+:\\d+) " + // time 16:01:00 "([\\-+])(\\d\\d)(\\d\\d)"); // gmt offset -0400);) private final String userDateFormat; /** * Default constructor. */ public SvnChangeLogConsumer( ScmLogger logger, String userDateFormat ) { super( logger ); this.userDateFormat = userDateFormat; } public List getModifications() { return entries; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( status ) { case GET_HEADER: processGetHeader( line ); break; case GET_FILE: processGetFile( line ); break; case GET_COMMENT: processGetComment( line ); break; default: throw new IllegalStateException( "Unknown state: " + status ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Process the current input line in the GET_HEADER state. The * author, date, and the revision of the entry are gathered. Note, * Subversion does not have per-file revisions, instead, the entire * repository is given a single revision number, which is used for * the revision number of each file. * * @param line A line of text from the svn log output */ private void processGetHeader( String line ) { if ( !HEADER_REG_EXP.match(line) ) { // The header line is not found. Intentionally do nothing. return; } currentRevision = getRevision(HEADER_REG_EXP.getParen( REVISION_GROUP )); currentChange = new SvnChangeSet(); currentChange.setAuthor( HEADER_REG_EXP.getParen( AUTHOR_GROUP ) ); currentChange.setDate( getDate(HEADER_REG_EXP.getParen( DATE_GROUP )) ); currentChange.setRevision( currentRevision ); status = GET_FILE; } /** * Gets the svn revision, from the svn log revision output. * * @param revisionOutput * @return the svn revision */ private String getRevision(final String revisionOutput) { if (REVISION_REG_EXP1.match(revisionOutput)) { return REVISION_REG_EXP1.getParen(1); } else if (REVISION_REG_EXP2.match(revisionOutput)) { return REVISION_REG_EXP2.getParen(1); } else { throw new IllegalOutputException(revisionOutput); } } /** * Process the current input line in the GET_FILE state. This state * adds each file entry line to the current change log entry. Note, * the revision number for the entire entry is used for the revision * number of each file. * * @param line A line of text from the svn log output */ private void processGetFile( String line ) { if ( line.startsWith( FILE_BEGIN_TOKEN ) ) { // Skip the status flags and just get the name of the file String name = line.substring( FILE_START_INDEX ); currentChange.addFile( new ChangeFile( name, currentRevision ) ); status = GET_FILE; } else if ( line.equals( FILE_END_TOKEN ) ) { // Create a buffer for the collection of the comment now // that we are leaving the GET_FILE state. currentComment = new StringBuffer(); status = GET_COMMENT; } } /** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the svn log output */ private void processGetComment( String line ) { if ( line.equals( COMMENT_END_TOKEN ) ) { currentChange.setComment( currentComment.toString() ); entries.add( currentChange ); status = GET_HEADER; } else { currentComment.append( line ).append( '\n' ); } } /** * Converts the date time stamp from the svn output into a date * object. * * @param dateOutput The date output from an svn log command. * @return A date representing the time stamp of the log entry. */ private Date getDate( final String dateOutput ) { if ( !DATE_REG_EXP.match( dateOutput ) ) { throw new IllegalOutputException( dateOutput ); } final StringBuffer date = new StringBuffer(); date.append( DATE_REG_EXP.getParen( 1 ) ); date.append( " GMT" ); date.append( DATE_REG_EXP.getParen( 2 ) ); date.append( DATE_REG_EXP.getParen( 3 ) ); date.append( ':' ); date.append( DATE_REG_EXP.getParen( 4 ) ); return parseDate( date.toString(), userDateFormat, SVN_TIMESTAMP_PATTERN ); } } ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/SvnChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001700511057610744033642 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; /** * @author Emmanuel Venisse * @version $Id: SvnChangeLogCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnChangeLogCommand extends AbstractChangeLogCommand implements SvnCommand { private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z"; /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, null, null, null, datePattern, startVersion, endVersion ); } /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, startDate, endDate, branch, datePattern, null, null ); } protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { Commandline cl = createCommandLine( (SvnScmProviderRepository) repo, fileSet.getBasedir(), branch, startDate, endDate, startVersion, endVersion ); SvnChangeLogConsumer consumer = new SvnChangeLogConsumer( getLogger(), datePattern ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing svn command.", ex ); } if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate ); changeLogSet.setStartVersion( startVersion ); changeLogSet.setEndVersion( endVersion ); return new ChangeLogScmResult( cl.toString(), changeLogSet ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( SvnScmProviderRepository repository, File workingDirectory, ScmBranch branch, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion ) { SimpleDateFormat dateFormat = new SimpleDateFormat( DATE_FORMAT ); dateFormat.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine( workingDirectory, repository ); cl.createArg().setValue( "log" ); cl.createArg().setValue( "-v" ); // TODO: May want to add some kind of support for --stop-on-copy and --limit NUM if ( startDate != null ) { cl.createArg().setValue( "-r" ); if ( endDate != null ) { cl.createArg().setValue( "{" + dateFormat.format( startDate ) + "}" + ":" + "{" + dateFormat.format( endDate ) + "}" ); } else { cl.createArg().setValue( "{" + dateFormat.format( startDate ) + "}:HEAD" ); } } if ( startVersion != null ) { cl.createArg().setValue( "-r" ); if ( endVersion != null ) { if ( startVersion.getName().equals( endVersion.getName() ) ) { cl.createArg().setValue( startVersion.getName() ); } else { cl.createArg().setValue( startVersion.getName() + ":" + endVersion.getName() ); } } else { cl.createArg().setValue( startVersion.getName() + ":HEAD" ); } } if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) ) { // By specifying a branch and this repository url below, subversion should show // the changelog of that branch, but limit it to paths that also occur in this repository. if ( branch instanceof ScmTag ) { cl.createArg().setValue( SvnTagBranchUtils.resolveTagUrl( repository, (ScmTag) branch ) ); } else { cl.createArg().setValue( SvnTagBranchUtils.resolveBranchUrl( repository, branch ) ); } } cl.createArg().setValue( repository.getUrl() ); return cl; } } ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/changelog/IllegalOutputException.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000232211304050436033625 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.changelog; /* * 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 when the output of an svn log command isn't recognized. * @since 1.3 */ public class IllegalOutputException extends RuntimeException { /** * Create the exception with a message. * * @param message the message. */ public IllegalOutputException( final String message ) { super( message ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/add/SvnAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001002611057610744033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; import java.util.List; /** * @author Brett Porter * @version $Id: SvnAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SvnAddCommand extends AbstractAddCommand implements SvnCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { // TODO: could do this with propset? if ( binary ) { throw new ScmException( "This provider does not yet support binary files" ); } if ( fileSet.getFiles().length == 0 ) { throw new ScmException( "You must provide at least one file/directory to add" ); } Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); SvnAddConsumer consumer = new SvnAddConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } if ( exitCode != 0 ) { return new AddScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false ); } return new AddScmResult( cl.toString(), consumer.getAddedFiles() ); } private static Commandline createCommandLine( File workingDirectory, List/*File*/ files ) throws ScmException { // Base command line doesn't make sense here - username/password not needed, and non-interactive is not valid Commandline cl = new Commandline(); cl.setExecutable( "svn" ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); cl.createArg().setValue( "add" ); cl.createArg().setValue( "--non-recursive" ); try { SvnCommandLineUtils.addTarget( cl, files ); } catch ( IOException e ) { throw new ScmException( "Can't create the targets file", e ); } return cl; } } ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/add/SvnAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000000527311057621704033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe.command.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: SvnAddConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SvnAddConsumer implements StreamConsumer { private ScmLogger logger; private List addedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnAddConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.length() <= 3 ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unexpected input, the line must be at least three characters long. Line: '" + line + "'." ); } return; } String statusString = line.substring( 0, 1 ); String file = line.substring( 3 ); ScmFileStatus status; if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else { if ( logger.isInfoEnabled() ) { logger.info( "Unknown file status: '" + statusString + "'." ); } return; } addedFiles.add( new ScmFile( file, status ) ); } public List getAddedFiles() { return addedFiles; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/SvnExeScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/or0000644000175000017500000001143111051357615033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.svnexe; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.provider.svn.AbstractSvnScmProvider; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.command.info.SvnInfoItem; import org.apache.maven.scm.provider.svn.command.info.SvnInfoScmResult; import org.apache.maven.scm.provider.svn.svnexe.command.add.SvnAddCommand; import org.apache.maven.scm.provider.svn.svnexe.command.branch.SvnBranchCommand; import org.apache.maven.scm.provider.svn.svnexe.command.changelog.SvnChangeLogCommand; import org.apache.maven.scm.provider.svn.svnexe.command.checkin.SvnCheckInCommand; import org.apache.maven.scm.provider.svn.svnexe.command.checkout.SvnCheckOutCommand; import org.apache.maven.scm.provider.svn.svnexe.command.diff.SvnDiffCommand; import org.apache.maven.scm.provider.svn.svnexe.command.export.SvnExeExportCommand; import org.apache.maven.scm.provider.svn.svnexe.command.info.SvnInfoCommand; import org.apache.maven.scm.provider.svn.svnexe.command.list.SvnListCommand; import org.apache.maven.scm.provider.svn.svnexe.command.remove.SvnRemoveCommand; import org.apache.maven.scm.provider.svn.svnexe.command.status.SvnStatusCommand; import org.apache.maven.scm.provider.svn.svnexe.command.tag.SvnTagCommand; import org.apache.maven.scm.provider.svn.svnexe.command.update.SvnUpdateCommand; import org.apache.maven.scm.repository.ScmRepositoryException; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnExeScmProvider.java 686352 2008-08-15 19:57:01Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="svn" */ public class SvnExeScmProvider extends AbstractSvnScmProvider { /** {@inheritDoc} */ protected SvnCommand getAddCommand() { return new SvnAddCommand(); } /** {@inheritDoc} */ protected SvnCommand getBranchCommand() { return new SvnBranchCommand(); } /** {@inheritDoc} */ protected SvnCommand getChangeLogCommand() { return new SvnChangeLogCommand(); } /** {@inheritDoc} */ protected SvnCommand getCheckInCommand() { return new SvnCheckInCommand(); } /** {@inheritDoc} */ protected SvnCommand getCheckOutCommand() { return new SvnCheckOutCommand(); } /** {@inheritDoc} */ protected SvnCommand getDiffCommand() { return new SvnDiffCommand(); } /** {@inheritDoc} */ protected SvnCommand getExportCommand() { return new SvnExeExportCommand(); } /** {@inheritDoc} */ protected SvnCommand getRemoveCommand() { return new SvnRemoveCommand(); } /** {@inheritDoc} */ protected SvnCommand getStatusCommand() { return new SvnStatusCommand(); } /** {@inheritDoc} */ protected SvnCommand getTagCommand() { return new SvnTagCommand(); } /** {@inheritDoc} */ protected SvnCommand getUpdateCommand() { return new SvnUpdateCommand(); } /** {@inheritDoc} */ protected SvnCommand getListCommand() { return new SvnListCommand(); } public SvnCommand getInfoCommand() { return new SvnInfoCommand(); } /** {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. SvnInfoScmResult result = info( null, new ScmFileSet( new File( "" ), path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return ( (SvnInfoItem) result.getInfoItems().get( 0 ) ).getURL(); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/pom.xml0000644000175000017500000000434611322611461032154 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-svn 1.3 maven-scm-provider-svnexe Maven SCM Subversion Provider - SVN Executable Impl. Executable library for SCM SVN Provider. org.apache.maven.scm maven-scm-provider-svn-commons regexp regexp org.apache.maven.scm maven-scm-provider-svntest test org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/0000755000175000017500000000000011345536670031614 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/0000755000175000017500000000000011345536670032403 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/site/0000755000175000017500000000000011345536670033347 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/site/si0000644000175000017500000000212211051127665033674 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/0000755000175000017500000000000011345536670033362 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/re0000755000175000017500000000000011345536670033711 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/resources/META-INF/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/re0000755000175000017500000000000011345536670033711 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/resources/META-INF/plexus/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/re0000755000175000017500000000000011345536670033711 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/resources/META-INF/plexus/components.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/re0000644000175000017500000000212610535556312033707 0ustar twernertwerner org.apache.maven.scm.provider.ScmProvider svn org.apache.maven.scm.provider.svn.TestSvnScmProvider ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtilsTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000644000175000017500000003506411052533075033676 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; /** * @author Emmanuel Venisse * @version $Id: SvnTagBranchUtilsTest.java 687028 2008-08-19 12:02:05Z vsiveton $ */ public class SvnTagBranchUtilsTest extends ScmTestCase { // ---------------------------------------------------------------------- // appendPath // ---------------------------------------------------------------------- public void testAppendPath() throws Exception { assertEquals( "http://foo.com/svn/myproject/tags/foo", SvnTagBranchUtils.appendPath( "http://foo.com/svn", "myproject/tags/foo" ) ); } public void testAppendPathNullAddlPath() throws Exception { assertEquals( "http://foo.com/svn", SvnTagBranchUtils.appendPath( "http://foo.com/svn", null ) ); } public void testAppendPathNullAddlTrailingSlash() throws Exception { assertEquals( "http://foo.com/svn", SvnTagBranchUtils.appendPath( "http://foo.com/svn/", null ) ); } public void testAppendPathTrailingSlash() throws Exception { assertEquals( "http://foo.com/svn/myproject/tags/foo", SvnTagBranchUtils.appendPath( "http://foo.com/svn/", "myproject/tags/foo" ) ); } public void testAppendPathLeadingAndTrailingSlash() throws Exception { assertEquals( "http://foo.com/svn/myproject/tags/foo", SvnTagBranchUtils.appendPath( "http://foo.com/svn/", "/myproject/tags/foo" ) ); } // ---------------------------------------------------------------------- // resolveTagBase // ---------------------------------------------------------------------- public void testResolveTagBase() { assertEquals( "http://foo.com/svn/myproject/tags", SvnTagBranchUtils.resolveTagBase( "http://foo.com/svn/myproject/trunk" ) ); assertEquals( "http://foo.com/svn/myproject/tags", SvnTagBranchUtils.resolveTagBase( "http://foo.com/svn/myproject/trunk/" ) ); } // ---------------------------------------------------------------------- // getProjectRoot // ---------------------------------------------------------------------- public void testGetProjectRootTagBranchTrunk() throws Exception { // All of these should equate to the same project root String[] paths = new String[]{"scm:svn:http://foo.com/svn/tags/my-tag", "scm:svn:http://foo.com/svn/tags", "scm:svn:http://foo.com/svn/branches/my-branch", "scm:svn:http://foo.com/svn/branches", "scm:svn:http://foo.com/svn/trunk", "scm:svn:http://foo.com/svn/trunk/some/path/to/some/file"}; for ( int i = 0; i < paths.length; i++ ) { testGetProjectRoot( paths[i], "http://foo.com/svn" ); } } public void testGetProjectRootNoRootSpecifier() throws Exception { testGetProjectRoot( "scm:svn:http://foo.com/svn/", "http://foo.com/svn" ); testGetProjectRoot( "scm:svn:http://foo.com/svn", "http://foo.com/svn" ); testGetProjectRoot( "scm:svn:http://foo.com/svn/ntags", "http://foo.com/svn/ntags" ); testGetProjectRoot( "scm:svn:http://foo.com/svn/nbranches", "http://foo.com/svn/nbranches" ); } public void testGetProjectRootLooksLikeRootSpecifier() throws Exception { testGetProjectRoot( "scm:svn:http://foo.com/svn/tagst", "http://foo.com/svn/tagst" ); testGetProjectRoot( "scm:svn:http://foo.com/svn/tagst/tags", "http://foo.com/svn/tagst" ); testGetProjectRoot( "scm:svn:http://foo.com/svn/branchess", "http://foo.com/svn/branchess" ); } public void testGetProjectRootDoubleProjectRoots() throws Exception { testGetProjectRoot( "scm:svn:http://foo.com/svn/tags/my-tag/tags/another-tag/", "http://foo.com/svn/tags/my-tag" ); testGetProjectRoot( "scm:svn:http://foo.com/svn/trunk/a_directory/trunk/", "http://foo.com/svn/trunk/a_directory" ); } // ---------------------------------------------------------------------- // resolveTagUrl // ---------------------------------------------------------------------- public void testResolveTagRelative() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "my-tag", "http://foo.com/svn/tags/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/trunk", "my-tag", "http://foo.com/svn/tags/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/trunk/", "my-tag", "http://foo.com/svn/tags/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/branches", "my-tag", "http://foo.com/svn/tags/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/tags", "my-tag", "http://foo.com/svn/tags/my-tag" ); } public void testResolveTagAbsolute() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "http://foo.com/svn/branches/my-tag", "http://foo.com/svn/branches/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/", "file://C://svn/some/crazy/path/my-tag", "file://C://svn/some/crazy/path/my-tag" ); } public void testResolveTagViewCVS() throws Exception { assertEquals( "http://foo.com/cgi-bin/viewcvs.cgi/svn/tags/my-tag?root=test", SvnTagBranchUtils.resolveTagUrl( "http://foo.com/cgi-bin/viewcvs.cgi/svn/trunk/?root=test", new ScmTag( "/my-tag/" ) ) ); } public void testResolveTagWithSlashes() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "/my-tag/", "http://foo.com/svn/tags/my-tag" ); testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "/my-branch/", "http://foo.com/svn/branches/my-branch" ); testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "http://foo.com/svn/myproject/branches/", "/my-branch/", "http://foo.com/svn/myproject/branches/my-branch" ); } public void testResolveTagWithTagOverwritingBase() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "branches/my-tag", "http://foo.com/svn/branches/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/", "tags/my-tag", "http://foo.com/svn/tags/my-tag" ); // Not sure why you would ever specify a tag of /trunk/foo, // but create the test case to assure consistent behavior in the future testResolveTagUrl( "scm:svn:http://foo.com/svn/", "trunk/my-tag", "http://foo.com/svn/trunk/my-tag" ); testResolveTagUrl( "scm:svn:svn+ssh://foo.com/svn/trunk/my_path/to/my_dir", "my-tag", "svn+ssh://foo.com/svn/tags/my-tag" ); testResolveTagUrl( "scm:svn:svn+ssh://foo.com/svn/trunk/my_path/to/my_dir/trunk/mydir", "my-tag", "svn+ssh://foo.com/svn/trunk/my_path/to/my_dir/tags/my-tag" ); testResolveTagUrl( "scm:svn:file://localhost/C:/mydir/myproject/trunk/my-module/target/scm-src/trunk", "my-tag", "file://localhost/C:/mydir/myproject/trunk/my-module/target/scm-src/tags/my-tag" ); } public void testResolveTagWithTagBaseSpecified() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "../tags", "my-tag", "../tags/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/", "http://foo.com/svn/non-standard/tag/dir/", "my-tag", "http://foo.com/svn/non-standard/tag/dir/my-tag" ); } public void testResolveTagLooksLikeOverwriteTagBase() throws Exception { testResolveTagUrl( "scm:svn:http://foo.com/svn/", "tagst/my-tag", "http://foo.com/svn/tags/tagst/my-tag" ); testResolveTagUrl( "scm:svn:http://foo.com/svn/", "metatags/my-tag", "http://foo.com/svn/tags/metatags/my-tag" ); } public void testResolveBranchSimple() throws Exception { testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "my-branch", "http://foo.com/svn/branches/my-branch" ); testResolveBranchUrl( "scm:svn:svn+ssh://foo.com/svn/trunk", "my-branch", "svn+ssh://foo.com/svn/branches/my-branch" ); testResolveBranchUrl( "scm:svn:svn+ssh://foo.com/svn/trunk/my_path/to/my_dir", "my-branch", "svn+ssh://foo.com/svn/branches/my-branch" ); testResolveBranchUrl( "scm:svn:http://foo.com/svn/trunk", "branches/my-branch", "http://foo.com/svn/branches/my-branch" ); testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "subbranches/my-branch", "http://foo.com/svn/branches/subbranches/my-branch" ); } public void testResolveBranchTagBase() throws Exception { testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "../branches", "my-branch", "../branches/my-branch" ); testResolveBranchUrl( "scm:svn:http://foo.com/svn/", "http://foo.com/svn/non-standard/branch/dir", "my-branch", "http://foo.com/svn/non-standard/branch/dir/my-branch" ); } // ---------------------------------------------------------------------- // revisionArgument // ---------------------------------------------------------------------- public void testIsRevisionArgumentSimple() { assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "12345" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "hEaD" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "bAsE" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "cOmMiTtEd" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "pReV" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "{2005-1-1}" ) ) ); } public void testIsRevisionArgumentRange() { assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "12345:12345" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "1:2" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "hEaD:bAsE" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "BaSe:CoMmItTeD" ) ) ); assertTrue( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "{2004-1-1}:{2005-1-1}" ) ) ); assertFalse( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( "BASE:" ) ) ); assertFalse( SvnTagBranchUtils.isRevisionSpecifier( new ScmRevision( ":BASE" ) ) ); } /** * Test SCM-379 * * @throws Exception if any */ public void testResolveUrlWithQuery() throws Exception { String url = "https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk?root=myproj"; SvnScmProviderRepository repo = new SvnScmProviderRepository( url ); assertEquals( "https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk/tags/mytag-1?root=myproj", SvnTagBranchUtils.resolveTagUrl( repo, new ScmTag( "mytag-1" ) ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private SvnScmProviderRepository getSvnRepository( String scmUrl ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); return (SvnScmProviderRepository) repository.getProviderRepository(); } private void testGetProjectRoot( String scmUrl, String expected ) throws Exception { assertEquals( expected, SvnTagBranchUtils.getProjectRoot( getSvnRepository( scmUrl ).getUrl() ) ); } private void testResolveTagUrl( String scmUrl, String tag, String expected ) throws Exception { testResolveTagUrl( scmUrl, null, tag, expected ); } private void testResolveTagUrl( String scmUrl, String tagBase, String tag, String expected ) throws Exception { SvnScmProviderRepository repository = getSvnRepository( scmUrl ); if ( tagBase != null ) { repository.setTagBase( tagBase ); } if ( tagBase != null ) { assertEquals( repository.getTagBase(), tagBase ); } else { assertEquals( repository.getTagBase(), SvnTagBranchUtils.resolveTagBase( repository.getUrl() ) ); } assertEquals( expected, SvnTagBranchUtils.resolveTagUrl( repository, new ScmTag( tag ) ) ); } private void testResolveBranchUrl( String scmUrl, String branch, String expected ) throws Exception { testResolveBranchUrl( scmUrl, null, branch, expected ); } private void testResolveBranchUrl( String scmUrl, String branchBase, String branch, String expected ) throws Exception { SvnScmProviderRepository repository = getSvnRepository( scmUrl ); if ( branchBase != null ) { repository.setBranchBase( branchBase ); } if ( branchBase != null ) { assertEquals( repository.getBranchBase(), branchBase ); } else { assertEquals( repository.getBranchBase(), SvnTagBranchUtils.resolveBranchBase( repository.getUrl() ) ); } assertEquals( expected, SvnTagBranchUtils.resolveBranchUrl( repository, new ScmBranch( branch ) ) ); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/SvnCommandUtilsTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000644000175000017500000000607310535556312033700 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.ScmTestCase; /** * @author Jerome Lacoste * @version $Id: SvnCommandUtilsTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class SvnCommandUtilsTest extends ScmTestCase { // ---------------------------------------------------------------------- // appendPath // ---------------------------------------------------------------------- public void testFixUrlHttpUrlsAreIgnored() throws Exception { String unchanged = "http://foo.com/svn/myproject/tags/foo"; assertEquals( unchanged, SvnCommandUtils.fixUrl( unchanged, null ) ); assertEquals( unchanged, SvnCommandUtils.fixUrl( unchanged, "" ) ); assertEquals( unchanged, SvnCommandUtils.fixUrl( unchanged, "user" ) ); } public void testFixUrlNPEifNullURL() throws Exception { try { SvnCommandUtils.fixUrl( null, "user" ); fail( "expected NPE" ); } catch ( NullPointerException e ) { assertTrue( true ); // expected } } public void testFixUrlSvnSshUrlsUsernameIsAddedWhenUserSpecified() throws Exception { assertEquals( "svn+ssh://foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://foo.com/svn/myproject", null ) ); assertEquals( "svn+ssh://foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://foo.com/svn/myproject", "" ) ); assertEquals( "svn+ssh://user@foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://foo.com/svn/myproject", "user" ) ); } public void testFixUrlSvnSshUrlsUsernameIsOverridenWhenUserSpecified() throws Exception { assertEquals( "svn+ssh://user1@foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://user1@foo.com/svn/myproject", null ) ); assertEquals( "svn+ssh://user1@foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://user1@foo.com/svn/myproject", "" ) ); assertEquals( "svn+ssh://user2@foo.com/svn/myproject", SvnCommandUtils.fixUrl( "svn+ssh://user1@foo.com/svn/myproject", "user2" ) ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000755000175000017500000000000011345536670033675 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000644000175000017500000002223110617634502033671 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.repository; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @author Emmanuel Venisse * @version $Id: SvnScmProviderRepositoryTest.java 535886 2007-05-07 14:35:46Z evenisse $ */ public class SvnScmProviderRepositoryTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } // ---------------------------------------------------------------------- // Testing legal URLs // ---------------------------------------------------------------------- public void testLegalFileURL() throws Exception { testUrl( "scm:svn:file:///tmp/repo", "file:///tmp/repo", null, null, null ); } public void testLegalLocalhostFileURL() throws Exception { testUrl( "scm:svn:file://localhost/tmp/repo", "file://localhost/tmp/repo", null, null, null ); } public void testLegalHistnameFileURL() throws Exception { testUrl( "scm:svn:file://my_server/tmp/repo", "file://my_server/tmp/repo", null, null, null ); } public void testLegalHttpURL() throws Exception { testUrl( "scm:svn:http://subversion.tigris.org", "http://subversion.tigris.org", null, null, "subversion.tigris.org" ); } public void testLegalHttpURLWithUser() throws Exception { testUrl( "scm:svn:http://user@subversion.tigris.org", "http://subversion.tigris.org", "user", null, "subversion.tigris.org" ); } public void testLegalHttpURLWithUserPassword() throws Exception { testUrl( "scm:svn:http://user:password@subversion.tigris.org", "http://subversion.tigris.org", "user", "password", "subversion.tigris.org" ); } public void testLegalHttpsURL() throws Exception { testUrl( "scm:svn:https://subversion.tigris.org", "https://subversion.tigris.org", null, null, "subversion.tigris.org" ); } public void testLegalHttpsURLWithUser() throws Exception { testUrl( "scm:svn:https://user@subversion.tigris.org", "https://subversion.tigris.org", "user", null, "subversion.tigris.org" ); } public void testLegalHttpsURLWithUserPassword() throws Exception { testUrl( "scm:svn:https://user:password@subversion.tigris.org", "https://subversion.tigris.org", "user", "password", "subversion.tigris.org" ); } public void testLegalSvnURL() throws Exception { testUrl( "scm:svn:svn://subversion.tigris.org", "svn://subversion.tigris.org", null, null, "subversion.tigris.org" ); } public void testLegalSvnPlusUsernameURL() throws Exception { testUrl( "scm:svn:svn://username@subversion.tigris.org", "svn://subversion.tigris.org", "username", null, "subversion.tigris.org" ); } public void testLegalSvnPlusUsernamePasswordURL() throws Exception { testUrl( "scm:svn:svn://username:password@subversion.tigris.org", "svn://subversion.tigris.org", "username", "password", "subversion.tigris.org" ); } public void testLegalSvnPlusSshURL() throws Exception { testUrl( "scm:svn:svn+ssh://subversion.tigris.org", "svn+ssh://subversion.tigris.org", null, null, "subversion.tigris.org" ); } /* This test require a specific subversion config file public void testLegalSvnPlusXxxURL() throws Exception { testUrl( "scm:svn:svn+something://subversion.tigris.org", "svn+something://subversion.tigris.org", null, "subversion.tigris.org" ); }*/ public void testLegalSvnPlusSshPlusUsernameURL() throws Exception { testUrl( "scm:svn:svn+ssh://username@subversion.tigris.org", "svn+ssh://username@subversion.tigris.org", null, null, "username@subversion.tigris.org" ); } /* This test require a specific subversion config file public void testLegalSvnPlusXxxPlusUsernameURL() throws Exception { testUrl( "scm:svn:svn+something://username@subversion.tigris.org", "svn+something://username@subversion.tigris.org", null, "username@subversion.tigris.org" ); }*/ public void testLegalSvnPortUrl() throws Exception { testUrl( "scm:svn:http://username@subversion.tigris.org:8800/pmgt/trunk", "http://subversion.tigris.org:8800/pmgt/trunk", "username", "subversion.tigris.org", 8800 ); testUrl( "scm:svn:https://username@subversion.tigris.org:8080/pmgt/trunk", "https://subversion.tigris.org:8080/pmgt/trunk", "username", "subversion.tigris.org", 8080 ); testUrl( "scm:svn:svn://username@subversion.tigris.org:8800/pmgt/trunk", "svn://subversion.tigris.org:8800/pmgt/trunk", "username", "subversion.tigris.org", 8800 ); testUrl( "scm:svn:svn+ssh://username@subversion.tigris.org:8080/pmgt/trunk", "svn+ssh://username@subversion.tigris.org:8080/pmgt/trunk", null, "username@subversion.tigris.org", 8080 ); } // ---------------------------------------------------------------------- // Testing illegal URLs // ---------------------------------------------------------------------- public void testIllegalFileUrl() throws Exception { testIllegalUrl( "file:/tmp/svn" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testUrl( String scmUrl, String expectedUrl, String expectedUser, String expectedPassword, String expectedHost ) throws Exception { ScmRepository repository = scmManager.makeScmRepository( scmUrl ); assertNotNull( "ScmManager.makeScmRepository() returned null", repository ); assertNotNull( "The provider repository was null.", repository.getProviderRepository() ); assertTrue( "The SCM Repository isn't a " + SvnScmProviderRepository.class.getName() + ".", repository.getProviderRepository() instanceof SvnScmProviderRepository ); SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository(); assertEquals( "url is incorrect", expectedUrl, providerRepository.getUrl() ); assertEquals( "url string is incorrect", "svn:" + expectedUrl, repository.toString() ); assertEquals( "User is incorrect", expectedUser, providerRepository.getUser() ); assertEquals( "Password is incorrect", expectedPassword, providerRepository.getPassword() ); assertEquals( "Host is incorrect", expectedHost, ( (SvnScmProviderRepository) repository.getProviderRepository() ).getHost() ); } private void testUrl( String scmUrl, String expectedUrl, String expectedUser, String expectedHost, int expectedPort ) throws Exception { testUrl( scmUrl, expectedUrl, expectedUser, null, expectedHost ); } private void testUrl( String scmUrl, String expectedUrl, String expectedUser, String expectedPassword, String expectedHost, int expectedPort ) throws Exception { testUrl( scmUrl, expectedUrl, expectedUser, expectedPassword, expectedHost ); ScmRepository repository = scmManager.makeScmRepository( scmUrl ); assertEquals( "Port is incorrect", expectedPort, ( (SvnScmProviderRepository) repository.getProviderRepository() ).getPort() ); } private void testIllegalUrl( String url ) throws Exception { try { scmManager.makeScmRepository( "scm:svn:" + url ); fail( "Expected a ScmRepositoryException while testing the url '" + url + "'." ); } catch ( ScmRepositoryException e ) { // expected } } public void testGetParent() { new SvnScmProviderRepository( "http://subversion.tigris.org" ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/java/org/apache/maven/scm/provider/svn/TestSvnScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/test/ja0000644000175000017500000000406210606723477033703 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.provider.svn.command.SvnCommand; import java.io.File; public class TestSvnScmProvider extends AbstractSvnScmProvider { protected SvnCommand getAddCommand() { return null; } protected SvnCommand getBranchCommand() { return null; } protected SvnCommand getChangeLogCommand() { return null; } protected SvnCommand getCheckInCommand() { return null; } protected SvnCommand getCheckOutCommand() { return null; } protected SvnCommand getDiffCommand() { return null; } protected SvnCommand getExportCommand() { return null; } protected SvnCommand getRemoveCommand() { return null; } protected SvnCommand getStatusCommand() { return null; } protected SvnCommand getTagCommand() { return null; } protected SvnCommand getUpdateCommand() { return null; } protected SvnCommand getListCommand() { return null; } protected SvnCommand getInfoCommand() { return null; } protected String getRepositoryURL( File path ) { return null; } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/0000755000175000017500000000000011345536670033327 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/mdo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/md0000755000175000017500000000000011345536670033650 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/mdo/svn-settings.mdomaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/md0000644000175000017500000000557611315117331033651 0ustar twernertwerner svn Svn SVN Provider Model. package org.apache.maven.scm.providers.svn.settings Settings 1.0.0+ configDirectory 1.0.0+ String useCygwinPath 1.1.0+ boolean false cygwinMountPath 1.1.0+ String /cygwin useNonInteractive 1.1.0+ boolean true ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/info/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/info/SvnInfoScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000337411050561465033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.info; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.ArrayList; import java.util.List; /** * @author Kenney Westerhof * @version $Id: SvnInfoScmResult.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnInfoScmResult extends ScmResult { private List infoItems; public SvnInfoScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); infoItems = new ArrayList( 0 ); } public SvnInfoScmResult( String commandLine, List files ) { super( commandLine, null, null, true ); this.infoItems = files; } public SvnInfoScmResult( List files, ScmResult result ) { super( result ); this.infoItems = files; } public List getInfoItems() { return infoItems; } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/info/SvnInfoItem.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000616611050561465033646 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.info; /* * 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. */ /** * @author Kenney Westerhof * @version $Id: SvnInfoItem.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnInfoItem { private String path; private String url; private String repositoryRoot; private String repositoryUUID; private String revision; private String nodeKind; private String schedule; private String lastChangedAuthor; private String lastChangedRevision; private String lastChangedDate; public String getPath() { return path; } public void setPath( String path ) { this.path = path; } public String getURL() { return url; } public void setURL( String url ) { this.url = url; } public String getRepositoryRoot() { return repositoryRoot; } public void setRepositoryRoot( String repositoryRoot ) { this.repositoryRoot = repositoryRoot; } public String getRepositoryUUID() { return repositoryUUID; } public void setRepositoryUUID( String repositoryUUID ) { this.repositoryUUID = repositoryUUID; } public String getRevision() { return revision; } public void setRevision( String revision ) { this.revision = revision; } public String getNodeKind() { return nodeKind; } public void setNodeKind( String nodeKind ) { this.nodeKind = nodeKind; } public String getSchedule() { return schedule; } public void setSchedule( String schedule ) { this.schedule = schedule; } public String getLastChangedAuthor() { return lastChangedAuthor; } public void setLastChangedAuthor( String lastChangedAuthor ) { this.lastChangedAuthor = lastChangedAuthor; } public String getLastChangedRevision() { return lastChangedRevision; } public void setLastChangedRevision( String lastChangedRevision ) { this.lastChangedRevision = lastChangedRevision; } public String getLastChangedDate() { return lastChangedDate; } public void setLastChangedDate( String lastChangedDate ) { this.lastChangedDate = lastChangedDate; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000254710535556312033647 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.update; /* * 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. */ import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: SvnUpdateScmResult.java 483105 2006-12-06 15:07:54Z evenisse $ * @deprecated */ public class SvnUpdateScmResult extends UpdateScmResultWithRevision { public SvnUpdateScmResult( String commandLine, List updatedFiles, int revision ) { super( commandLine, updatedFiles, String.valueOf( revision ) ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000213711157300235033632 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command; /* * 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. */ import org.apache.maven.scm.command.Command; /** * @author Trygve Laugstøl * @version $Id: SvnCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public interface SvnCommand extends Command { // no-op } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000001213311057621704033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Brett Porter * @version $Id: SvnDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SvnDiffConsumer implements StreamConsumer { // // Index: plugin.jelly // =================================================================== // --- plugin.jelly (revision 124799) // +++ plugin.jelly (working copy) // private static final String INDEX_TOKEN = "Index: "; private static final String FILE_SEPARATOR_TOKEN = "==="; private static final String START_REVISION_TOKEN = "---"; private static final String END_REVISION_TOKEN = "+++"; private static final String ADDED_LINE_TOKEN = "+"; private static final String REMOVED_LINE_TOKEN = "-"; private static final String UNCHANGED_LINE_TOKEN = " "; private static final String CHANGE_SEPARATOR_TOKEN = "@@"; private static final String NO_NEWLINE_TOKEN = "\\ No newline at end of file"; private ScmLogger logger; private String currentFile; private StringBuffer currentDifference; private List changedFiles = new ArrayList(); private Map differences = new HashMap(); private StringBuffer patch = new StringBuffer(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public SvnDiffConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( INDEX_TOKEN ) ) { // start a new file currentFile = line.substring( INDEX_TOKEN.length() ); changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) ); currentDifference = new StringBuffer(); differences.put( currentFile, currentDifference ); patch.append( line ).append( "\n" ); return; } if ( currentFile == null ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); return; } if ( line.startsWith( FILE_SEPARATOR_TOKEN ) ) { // skip patch.append( line ).append( "\n" ); } else if ( line.startsWith( START_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, start revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( END_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, end revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) || line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) || line.equals( NO_NEWLINE_TOKEN ) ) { // add to buffer currentDifference.append( line ).append( "\n" ); patch.append( line ).append( "\n" ); } else { // TODO: handle property differences if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); // skip to next file currentFile = null; currentDifference = null; } } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch.toString(); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnConfigFileReader.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000001012011057215000033613 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: SvnConfigFileReader.java 691192 2008-09-02 10:48:32Z vsiveton $ */ public class SvnConfigFileReader { private File configDirectory; public File getConfigDirectory() { if ( configDirectory == null ) { if ( Os.isFamily( "windows" ) ) { configDirectory = new File( System.getProperty( "user.home" ), "Application Data/Subversion" ); } else { configDirectory = new File( System.getProperty( "user.home" ), ".subversion" ); } } return configDirectory; } public void setConfigDirectory( File configDirectory ) { this.configDirectory = configDirectory; } public String getProperty( String group, String propertyName ) { List lines = getConfLines(); boolean inGroup = false; for ( Iterator i = lines.iterator(); i.hasNext(); ) { String line = ( (String) i.next() ).trim(); if ( !inGroup ) { if ( ( "[" + group + "]" ).equals( line ) ) { inGroup = true; } } else { if ( line.startsWith( "[" ) && line.endsWith( "]" ) ) { //a new group start return null; } if ( line.startsWith( "#" ) ) { continue; } if ( line.indexOf( '=' ) < 0 ) { continue; } String property = line.substring( 0, line.indexOf( '=' ) ).trim(); if ( !property.equals( propertyName ) ) { continue; } String value = line.substring( line.indexOf( '=' ) + 1 ); return value.trim(); } } return null; } /** * Load the svn config file * * @return the list of all lines */ private List getConfLines() { List lines = new ArrayList(); BufferedReader reader = null; try { if ( getConfigDirectory().exists() ) { reader = new BufferedReader( new FileReader( new File( getConfigDirectory(), "config" ) ) ); String line; while ( ( line = reader.readLine() ) != null ) { if ( !line.startsWith( "#" ) && StringUtils.isNotEmpty( line ) ) { lines.add( line ); } } } } catch ( IOException e ) { lines.clear(); } finally { IOUtil.close( reader ); reader = null; } return lines; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/util/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000514711051372533033641 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.util; /* * 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. */ import org.apache.maven.scm.providers.svn.settings.Settings; import org.apache.maven.scm.providers.svn.settings.io.xpp3.SvnXpp3Reader; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; /** * @author Emmanuel Venisse * @version $Id: SvnUtil.java 686374 2008-08-15 21:30:03Z vsiveton $ */ public class SvnUtil { protected static final String SVN_SETTINGS_FILENAME = "svn-settings.xml"; public static final File DEFAULT_SETTINGS_DIRECTORY = new File( System.getProperty( "user.home" ), ".scm" ); private static File settingsDirectory = DEFAULT_SETTINGS_DIRECTORY; private SvnUtil() { } public static Settings getSettings() { File scmUserDir = settingsDirectory; File settingsFile = new File( scmUserDir, SVN_SETTINGS_FILENAME ); if ( settingsFile.exists() ) { SvnXpp3Reader reader = new SvnXpp3Reader(); try { return reader.read( ReaderFactory.newXmlReader( settingsFile ) ); } catch ( FileNotFoundException e ) { //Nothing to do } catch ( IOException e ) { //Nothing to do } catch ( XmlPullParserException e ) { String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage(); System.err.println( message ); } } return new Settings(); } public static void setSettingsDirectory( File directory ) { settingsDirectory = directory; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnChangeSet.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000511111051357615033634 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: SvnChangeSet.java 686352 2008-08-15 19:57:01Z vsiveton $ */ public class SvnChangeSet extends ChangeSet { public SvnChangeSet() { super(); } public SvnChangeSet( String strDate, String userDatePattern, String comment, String author, List/**/files ) { super( strDate, userDatePattern, comment, author, files ); } public SvnChangeSet( Date date, String comment, String author, List/**/ files ) { super( date, comment, author, files ); } /** {@inheritDoc} */ public boolean containsFilename( String filename, ScmProviderRepository repository ) { SvnScmProviderRepository repo = (SvnScmProviderRepository) repository; String url = repo.getUrl(); if ( !url.endsWith( "/" ) ) { url += "/"; } String currentFile = url + StringUtils.replace( filename, "\\", "/" ); if ( getFiles() != null ) { for ( Iterator i = getFiles().iterator(); i.hasNext(); ) { ChangeFile file = (ChangeFile) i.next(); if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) ) { return true; } } } return false; } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/AbstractSvnScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000003201511053114502033623 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.svn.command.SvnCommand; import org.apache.maven.scm.provider.svn.command.info.SvnInfoScmResult; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.apache.maven.scm.provider.svn.util.SvnUtil; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.List; /** * SCM Provider for Subversion * * @author Emmanuel Venisse * @version $Id: AbstractSvnScmProvider.java 687490 2008-08-20 22:22:58Z olamy $ */ public abstract class AbstractSvnScmProvider extends AbstractScmProvider { // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private static class ScmUrlParserResult { private List messages = new ArrayList(); private ScmProviderRepository repository; } // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public String getScmSpecificFilename() { return ".svn"; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null ) { throw new NullPointerException( "Path argument is null" ); } if ( !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } if ( !new File( path, ".svn" ).exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a svn checkout directory." ); } try { return makeProviderScmRepository( getRepositoryURL( path ), ':' ); } catch ( ScmException e ) { // XXX We should allow throwing of SCMException. throw new ScmRepositoryException( "Error executing info command", e ); } } protected abstract String getRepositoryURL( File path ) throws ScmException; /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { List messages = new ArrayList(); try { makeProviderScmRepository( scmSpecificUrl, delimiter ); } catch ( ScmRepositoryException e ) { messages = e.getValidationMessages(); } return messages; } /** {@inheritDoc} */ public String getScmType() { return "svn"; } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private ScmUrlParserResult parseScmUrl( String scmSpecificUrl ) { ScmUrlParserResult result = new ScmUrlParserResult(); String url = scmSpecificUrl; // ---------------------------------------------------------------------- // Do some sanity checking of the SVN url // ---------------------------------------------------------------------- if ( url.startsWith( "file" ) ) { if ( !url.startsWith( "file://" ) ) { result.messages.add( "A svn 'file' url must be on the form 'file://[hostname]/'." ); return result; } } else if ( url.startsWith( "https" ) ) { if ( !url.startsWith( "https://" ) ) { result.messages.add( "A svn 'http' url must be on the form 'https://'." ); return result; } } else if ( url.startsWith( "http" ) ) { if ( !url.startsWith( "http://" ) ) { result.messages.add( "A svn 'http' url must be on the form 'http://'." ); return result; } } // Support of tunnels: svn+xxx with xxx defined in subversion conf file else if ( url.startsWith( "svn+" ) ) { if ( url.indexOf( "://" ) < 0 ) { result.messages.add( "A svn 'svn+xxx' url must be on the form 'svn+xxx://'." ); return result; } else { String tunnel = url.substring( "svn+".length(), url.indexOf( "://" ) ); //ssh is always an allowed tunnel if ( !"ssh".equals( tunnel ) ) { SvnConfigFileReader reader = new SvnConfigFileReader(); if ( SvnUtil.getSettings().getConfigDirectory() != null ) { reader.setConfigDirectory( new File( SvnUtil.getSettings().getConfigDirectory() ) ); } if ( StringUtils.isEmpty( reader.getProperty( "tunnels", tunnel ) ) ) { result.messages.add( "The tunnel '" + tunnel + "' isn't defined in your subversion configuration file." ); return result; } } } } else if ( url.startsWith( "svn" ) ) { if ( !url.startsWith( "svn://" ) ) { result.messages.add( "A svn 'svn' url must be on the form 'svn://'." ); return result; } } else { result.messages.add( url + " url isn't a valid svn URL." ); return result; } result.repository = new SvnScmProviderRepository( url ); return result; } protected abstract SvnCommand getAddCommand(); /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (AddScmResult) executeCommand( getAddCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getBranchCommand(); /** {@inheritDoc} */ protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (BranchScmResult) executeCommand( getBranchCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getChangeLogCommand(); /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ChangeLogScmResult) executeCommand( getChangeLogCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getCheckInCommand(); /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckInScmResult) executeCommand( getCheckInCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getCheckOutCommand(); /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckOutScmResult) executeCommand( getCheckOutCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getDiffCommand(); /** {@inheritDoc} */ public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (DiffScmResult) executeCommand( getDiffCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getExportCommand(); /** {@inheritDoc} */ protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ExportScmResult) executeCommand( getExportCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getRemoveCommand(); /** {@inheritDoc} */ public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (RemoveScmResult) executeCommand( getRemoveCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getStatusCommand(); /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) executeCommand( getStatusCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getTagCommand(); /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (TagScmResult) executeCommand( getTagCommand(), repository, fileSet, parameters ); } protected abstract SvnCommand getUpdateCommand(); /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet, parameters ); } protected ScmResult executeCommand( SvnCommand command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { command.setLogger( getLogger() ); return command.execute( repository, fileSet, parameters ); } protected abstract SvnCommand getListCommand(); /** {@inheritDoc} */ public ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { SvnCommand cmd = getListCommand(); return (ListScmResult) executeCommand( cmd, repository, fileSet, parameters ); } protected abstract SvnCommand getInfoCommand(); public SvnInfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { SvnCommand cmd = getInfoCommand(); return (SvnInfoScmResult) executeCommand( cmd, repository, fileSet, parameters ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000002576111052533075033646 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * @version $Id: SvnTagBranchUtils.java 687028 2008-08-19 12:02:05Z vsiveton $ */ public class SvnTagBranchUtils { public static final String[] REVISION_SPECIFIERS = new String[]{"HEAD", "BASE", "COMMITTED", "PREV"}; public static final String SVN_TRUNK = "trunk"; public static final String SVN_BRANCHES = "branches"; public static final String SVN_TAGS = "tags"; public static final String[] SVN_BASE_DIRS = new String[]{SVN_TRUNK, SVN_BRANCHES, SVN_TAGS}; /** * Simple helper function to concatenate two paths together with a "/". * Handles trailing / on basePath. * Returns no trailing "/" if the addlPath is null */ static String appendPath( String basePath, String addlPath ) { basePath = StringUtils.stripEnd( basePath, "/" ); if ( StringUtils.isEmpty( addlPath ) ) { return basePath; } else { return basePath + "/" + StringUtils.stripStart( addlPath, "/" ); } } /** * Returns the project root for the given repository url, * where "project root" is the root of the /trunk, /branches, /tags * directories * * @param repoPath Repository path/url to be searched * @return */ public static String getProjectRoot( String repoPath ) { for ( int i = 0; i < SVN_BASE_DIRS.length; i++ ) { String base = "/" + SVN_BASE_DIRS[i]; int pos = repoPath.lastIndexOf( base + "/" ); if ( repoPath.endsWith( base ) ) { return repoPath.substring( 0, repoPath.length() - base.length() ); } else if ( pos >= 0 ) { return repoPath.substring( 0, pos ); } } // At this point we were unable to locate the project root of this url // so assume that the repository url specified is the project root return appendPath( repoPath, null ); } public static String resolveTagBase( SvnScmProviderRepository repository ) { return resolveTagBase( repository.getUrl() ); } public static String resolveTagBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_TAGS ); } public static String resolveBranchBase( SvnScmProviderRepository repository ) { return resolveBranchBase( repository.getUrl() ); } public static String resolveBranchBase( String repositoryUrl ) { return appendPath( getProjectRoot( repositoryUrl ), SVN_BRANCHES ); } /** * Resolves a tag to a repository url. * By supplying the repository to this function (rather than calling {@link #resolveTagUrl(String,ScmTag)} * the resolution can use the repository's tagBase to override the default tag location. * * @param repository the repository to use as a base for tag resolution * @param tag tag name * @return * @see #resolveUrl(String,String,String,ScmBranch) */ public static String resolveTagUrl( SvnScmProviderRepository repository, ScmTag tag ) { return resolveUrl( repository.getUrl(), repository.getTagBase(), SVN_TAGS, tag ); } /** * Resolves a tag to a repository url. * Will not use the {@link SvnScmProviderRepository#getTagBase()} during resolution. * * @param repositoryUrl string url for the repository * @param tag tag name * @return * @see #resolveUrl(String,String,String,ScmBranch) */ public static String resolveTagUrl( String repositoryUrl, ScmTag tag ) { return resolveUrl( repositoryUrl, null, SVN_TAGS, tag ); } /** * Resolves a branch name to a repository url. * By supplying the repository to this function (rather than calling {@link #resolveBranchUrl(String,ScmBranch)} * the resolution can use the repository's tagBase to override the default tag location. * * @param repository the repository to use as a base for tag resolution * @param branch tag name * @return * @see #resolveUrl(String,String,String,ScmBranch) */ public static String resolveBranchUrl( SvnScmProviderRepository repository, ScmBranch branch ) { return resolveUrl( repository.getUrl(), repository.getBranchBase(), SVN_BRANCHES, branch ); } /** * Resolves a branch name to a repository url. * Will not use the {@link SvnScmProviderRepository#getTagBase()} during resolution. * * @param repositoryUrl string url for the repository * @param branch branch name * @return * @see #resolveUrl(String,String,String,ScmBranch) */ public static String resolveBranchUrl( String repositoryUrl, ScmBranch branch ) { return resolveUrl( repositoryUrl, resolveBranchBase( repositoryUrl ), SVN_BRANCHES, branch ); } private static String addSuffix( String baseString, String suffix ) { return ( suffix != null ) ? baseString + suffix : baseString; } /** * Resolves a tag or branch name to a repository url.
* If the branchTagName is an absolute URL, that value is returned. * (i.e. http://foo.com/svn/myproject/tags/my-tag)
*

* If the repository has a {@link SvnScmProviderRepository#getTagBase()} specified, * the tag is simply appended to the tagBase value. Note that at this time, we are using * the tagBase as a base for both branches and tags.
*

* If the branchTagName contains a branch/tag specifier (i.e. "/branches", "/tags", "/trunk"), * the branchTagName is appended to the projectRoot without adding the subdir.
* Else, the result is in the format of projectRoot/subdir/branchTagName directory.
* * @param repositoryUrl string url for the repository * @param tagBase tagBase to use. * @param subdir Subdirectory to append to the project root * (for branching use "branches", tags use "tags") * @param branchTag Name of the actual branch or tag. Can be an absolute url, simple tag/branch name, * or even contain a relative path to the root like "branches/my-branch" * @return */ public static String resolveUrl( String repositoryUrl, String tagBase, String subdir, ScmBranch branchTag ) { String branchTagName = branchTag.getName(); String projectRoot = getProjectRoot( repositoryUrl ); branchTagName = StringUtils.strip( branchTagName, "/" ); if ( StringUtils.isEmpty( branchTagName ) ) { return null; } // Look for a query string as in ViewCVS urls String queryString = null; if ( repositoryUrl.indexOf( "?" ) >= 0 ) { queryString = repositoryUrl.substring( repositoryUrl.indexOf( "?" ) ); // if repositoryUrl contains a query string, remove it from repositoryUrlRoot; will be re-appended later projectRoot = StringUtils.replace( projectRoot, queryString, "" ); } if ( branchTagName.indexOf( "://" ) >= 0 ) { // branch/tag is already an absolute url so just return it. return branchTagName; } // User has a tagBase specified so just return the name appended to the tagBase if ( StringUtils.isNotEmpty( tagBase ) && !tagBase.equals( resolveTagBase( repositoryUrl ) ) && !tagBase.equals( resolveBranchBase( repositoryUrl ) ) ) { return appendPath( tagBase, branchTagName ); } // Look for any "branches/" or "tags/" specifiers in the branchTagName. If one occurs, // don't append the subdir to the projectRoot when appending the name for ( int i = 0; i < SVN_BASE_DIRS.length; i++ ) { if ( branchTagName.startsWith( SVN_BASE_DIRS[i] + "/" ) ) { return addSuffix( appendPath( projectRoot, branchTagName ), queryString ); } } return addSuffix( appendPath( appendPath( projectRoot, subdir ), branchTagName ), queryString ); } /* Helper function that does the checking for {@link #isRevisionSpecifier} */ private static boolean checkRevisionArg( String arg ) { if ( StringUtils.isNumeric( arg ) || ( arg.startsWith( "{" ) && arg.endsWith( "}" ) ) ) { return true; } for ( int i = 0; i < REVISION_SPECIFIERS.length; i++ ) { if ( REVISION_SPECIFIERS[i].equalsIgnoreCase( arg ) ) { return true; } } return false; } /** * Returns whether the supplied tag refers to an actual revision or * is specifying a tag/branch url in the repository. * According to the subversion documentation, the following are valid revision specifiers: * NUMBER revision number * "{" DATE "}" revision at start of the date * "HEAD" latest in repository * "BASE" base rev of item's working copy * "COMMITTED" last commit at or before BASE * "PREV" *

* For command such as diff, the revision argument can be in the format of: * IDENTIFIER:IDENTIFIER where IDENTIFIER is one of the args listed above */ public static boolean isRevisionSpecifier( ScmVersion version ) { if ( version == null ) { return false; } String versionName = version.getName(); if ( StringUtils.isEmpty( versionName ) ) { return false; } if ( checkRevisionArg( versionName ) ) { return true; } String[] parts = StringUtils.split( versionName, ":" ); if ( parts.length == 2 && StringUtils.isNotEmpty( parts[0] ) && StringUtils.isNotEmpty( parts[1] ) ) { return checkRevisionArg( parts[0] ) && checkRevisionArg( parts[1] ); } return false; } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000755000175000017500000000000011345536670033642 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000001654611050561465033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; import org.apache.maven.scm.provider.svn.SvnTagBranchUtils; /** * @author Emmanuel Venisse * @version $Id: SvnScmProviderRepository.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnScmProviderRepository extends ScmProviderRepositoryWithHost { /** */ private String url; private String protocol; /** * The base directory for any tags. Can be relative to the repository URL or an absolute URL. */ private String tagBase; /** * The base directory for any branches. Can be relative to the repository URL or an absolute URL. */ private String branchBase; public SvnScmProviderRepository( String url ) { parseUrl( url ); tagBase = SvnTagBranchUtils.resolveTagBase( url ); branchBase = SvnTagBranchUtils.resolveBranchBase( url ); } public SvnScmProviderRepository( String url, String user, String password ) { this( url ); setUser( user ); setPassword( password ); } public String getUrl() { return url; } /** * Returns the url/directory to be used when tagging this repository. */ public String getTagBase() { return tagBase; } /** * Sets the url/directory to be used when tagging this repository. * The TagBase is a way to override the default tag location for the * repository. The default tag location is automatically determined * for repositories in the standard subversion layout (with /tags /branches /trunk). * Specify this value only if the repository is using a directory other than "/tags" for tagging. * * @param tagBase an absolute or relative url to the base directory to create tags in. * URL should be in a format that svn client understands, not the scm url format. */ public void setTagBase( String tagBase ) { this.tagBase = tagBase; } /** * Returns the url/directory to be used when tagging this repository. */ public String getBranchBase() { return branchBase; } /** * Sets the url/directory to be used when branching this repository. * The BranchBase is a way to override the default branch location for the * repository. The default branch location is automatically determined * for repositories in the standard subversion layout (with /tags /branches /trunk). * Specify this value only if the repository is using a directory other than "/branches" for branching. * * @param branchBase an absolute or relative url to the base directory to create branch in. * URL should be in a format that svn client understands, not the scm url format. */ public void setBranchBase( String branchBase ) { this.branchBase = branchBase; } private void setProtocol( String protocol ) { this.protocol = protocol; } /** * Get the protocol used in this repository (file://, http://, https://,...) * * @return the protocol */ public String getProtocol() { return protocol; } private void parseUrl( String url ) { if ( url.startsWith( "file" ) ) { setProtocol( "file://" ); } else if ( url.startsWith( "https" ) ) { setProtocol( "https://" ); } else if ( url.startsWith( "http" ) ) { setProtocol( "http://" ); } else if ( url.startsWith( "svn+" ) ) { setProtocol( url.substring( 0, url.indexOf( "://" ) + 3 ) ); } else if ( url.startsWith( "svn" ) ) { setProtocol( "svn://" ); } if ( getProtocol() == null ) { return; } String urlPath = url.substring( getProtocol().length() ); int indexAt = urlPath.indexOf( "@" ); if ( indexAt > 0 && !getProtocol().startsWith( "svn+" ) ) { String userPassword = urlPath.substring( 0, indexAt ); if ( userPassword.indexOf( ":" ) < 0 ) { setUser( userPassword ); } else { setUser( userPassword.substring( 0, userPassword.indexOf( ":" ) ) ); setPassword( userPassword.substring( userPassword.indexOf( ":" ) + 1 ) ); } urlPath = urlPath.substring( indexAt + 1 ); this.url = getProtocol() + urlPath; } else { this.url = getProtocol() + urlPath; } if ( !"file://".equals( getProtocol() ) ) { int indexSlash = urlPath.indexOf( "/" ); String hostPort = urlPath; if ( indexSlash > 0 ) { hostPort = urlPath.substring( 0, indexSlash ); } int indexColon = hostPort.indexOf( ":" ); if ( indexColon > 0 ) { setHost( hostPort.substring( 0, indexColon ) ); setPort( Integer.parseInt( hostPort.substring( indexColon + 1 ) ) ); } else { setHost( hostPort ); } } } /** {@inheritDoc} */ public ScmProviderRepository getParent() { String newUrl = getUrl().substring( getProtocol().length() ); while ( newUrl.endsWith( "/." ) ) { newUrl = newUrl.substring( 0, newUrl.length() - 1 ); } while ( newUrl.endsWith( "/" ) ) { newUrl = newUrl.substring( 0, newUrl.length() ); } int i = newUrl.lastIndexOf( "/" ); if ( i < 0 ) { return null; } newUrl = newUrl.substring( 0, i ); return new SvnScmProviderRepository( getProtocol() + newUrl, getUser(), getPassword() ); } /** {@inheritDoc} */ public String getRelativePath( ScmProviderRepository ancestor ) { if ( ancestor instanceof SvnScmProviderRepository ) { SvnScmProviderRepository svnAncestor = (SvnScmProviderRepository) ancestor; String path = getUrl().replaceFirst( svnAncestor.getUrl() + "/", "" ); if ( !path.equals( getUrl() ) ) { return path; } } return null; } /** {@inheritDoc} */ public String toString() { return getUrl(); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnCommandUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/ja0000644000175000017500000000453311132335440033633 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import org.codehaus.plexus.util.StringUtils; /** * Command utilities for svn commands. * * @author Jerome Lacoste * @version $Id: SvnCommandUtils.java 733437 2009-01-11 09:25:52Z dantran $ */ public class SvnCommandUtils { /** * Add or overrides the username into a url with a svn+ssh scheme. *

* Svn 1.3.1 doesn't use the username information specified by --username when the url * uses the svn+ssh scheme. This allows to fix it. See MRELEASE-35. *

* Convert file url which derived from windows file path to unix path. *

* @param url the url, not null * @param username the username, may be null * @return the fixed url * @throws NullPointerException if url is null */ public static String fixUrl( String url, String username ) { if ( !StringUtils.isEmpty( username ) && url.startsWith( "svn+ssh://" ) ) { // is there a username to override ? If so we cut after int idx = url.indexOf( '@' ); int cutIdx = idx < 0 ? "svn+ssh://".length() : idx + 1; url = "svn+ssh://" + username + "@" + url.substring( cutIdx ); } else if ( url.startsWith( "file://" ) ) { //some svn commands does not understand windows path separator in file URL derived from windows file path url = url.replace( '\\', '/' ); } return url; } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/pom.xml0000644000175000017500000000400311322611461033111 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-svn 1.3 maven-scm-provider-svn-commons Maven SCM Subversion Provider - Common library Common library for SCM SVN Provider. org.codehaus.modello modello-maven-plugin java xpp3-reader xsd 1.1.0 src/main/mdo/svn-settings.mdo maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/src/0000755000175000017500000000000011345536670024410 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/src/site/0000755000175000017500000000000011345536670025354 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/src/site/site.xml0000644000175000017500000000215711051127665027041 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/0000755000175000017500000000000011345536670031043 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/0000755000175000017500000000000011345536670031632 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/site/0000755000175000017500000000000011345536670032576 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/site/site.x0000644000175000017500000000212011051127665033720 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/0000755000175000017500000000000011345536670032556 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resour0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resources/tck/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resour0000755000175000017500000000000011345536670034016 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resources/tck/tck.dumpmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/resour0000644000175000017500000001432310400605362034005 0ustar twernertwernerSVN-fs-dump-format-version: 2 UUID: 32329737-c6e7-0310-acdd-fde163f827b2 Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2004-10-31T22:57:32.330365Z PROPS-END Revision-number: 1 Prop-content-length: 101 Content-length: 101 K 7 svn:log V 0 K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-10-31T23:00:31.108377Z PROPS-END Node-path: file Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 0 Text-content-md5: d41d8cd98f00b204e9800998ecf8427e Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 101 Content-length: 101 K 7 svn:log V 0 K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-10-31T23:01:07.427469Z PROPS-END Node-path: file_2 Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 0 Text-content-md5: d41d8cd98f00b204e9800998ecf8427e Content-length: 10 PROPS-END Revision-number: 3 Prop-content-length: 101 Content-length: 101 K 7 svn:log V 0 K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-10-31T23:01:47.729957Z PROPS-END Node-path: file_1 Node-kind: file Node-action: add Node-copyfrom-rev: 1 Node-copyfrom-path: file Node-path: file_2 Node-kind: file Node-action: change Text-content-length: 17 Text-content-md5: 53adcdeed5651fafe46fbba6b5e87d02 Content-length: 17 adding some crap Node-path: file Node-action: delete Revision-number: 4 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 o My log message K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-11-01T07:34:03.254229Z PROPS-END Node-path: file_2 Node-kind: file Node-action: change Text-content-length: 102 Text-content-md5: 12db6e90dbaccb1e1c793465d0cd2573 Content-length: 102 adding some crap adding some crap adding some crap adding some crap adding some crap adding some crap Revision-number: 5 Prop-content-length: 127 Content-length: 127 K 7 svn:log V 25 o Making TCK update dump. K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-11-03T09:40:38.812597Z PROPS-END Node-path: pom.xml Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 8 Text-content-md5: bb4d26f6cff04ea8d4453055155aa4ae Content-length: 18 PROPS-END pom.xml Node-path: readme.txt Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 11 Text-content-md5: 2f4e912cdd8e4daf724d86c85100c234 Content-length: 21 PROPS-END readme.txt Node-path: src Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: src/main Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: src/main/java Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: src/main/java/Application.java Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 17 Text-content-md5: f9c80174d0aceb15241396719d3d8ee0 Content-length: 27 PROPS-END Application.java Node-path: src/test Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: src/test/java Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: src/test/java/Test.java Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 10 Text-content-md5: 2b67cb187cfebc6556a9ff00dd2a73c9 Content-length: 20 PROPS-END Test.java Node-path: src/test/resources Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: file_1 Node-action: delete Node-path: file_2 Node-action: delete Revision-number: 6 Prop-content-length: 135 Content-length: 135 K 7 svn:log V 33 o Making TCK update dump, take 2. K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-11-03T09:55:45.739689Z PROPS-END Node-path: pom.xml Node-kind: file Node-action: change Text-content-length: 9 Text-content-md5: ab43bf43c516ba05e7ea14237861c101 Content-length: 9 /pom.xml Node-path: readme.txt Node-kind: file Node-action: change Text-content-length: 12 Text-content-md5: 2c15d78f5fc4223fccc94031588aee97 Content-length: 12 /readme.txt Node-path: src/main/java/Application.java Node-kind: file Node-action: change Text-content-length: 32 Text-content-md5: e0b1aa4c95b4211d51a817c43f6a0070 Content-length: 32 /src/main/java/Application.java Node-path: src/test/java/Test.java Node-kind: file Node-action: change Text-content-length: 25 Text-content-md5: 2f8ba3ce8330bf354a73b4f243013e98 Content-length: 25 /src/test/java/Test.java Revision-number: 7 Prop-content-length: 135 Content-length: 135 K 7 svn:log V 33 o Making TCK update dump, take 3. K 10 svn:author V 7 trygvis K 8 svn:date V 27 2004-11-03T09:57:42.448827Z PROPS-END Node-path: pom.xml Node-kind: file Node-action: change Text-content-length: 8 Text-content-md5: eab74e9a6a0a7669ca7a253f0f0ed832 Content-length: 8 /pom.xml Node-path: readme.txt Node-kind: file Node-action: change Text-content-length: 11 Text-content-md5: 74088de3393a22eb8d6abc87369fb21a Content-length: 11 /readme.txt Node-path: src/main/java/Application.java Node-kind: file Node-action: change Text-content-length: 31 Text-content-md5: 1486dc4cd4c38fc1d4c2b4ae40f87a3e Content-length: 31 /src/main/java/Application.java Node-path: src/test/java/Test.java Node-kind: file Node-action: change Text-content-length: 24 Text-content-md5: 197e3f681c57ea737fdd1b73e83509b1 Content-length: 24 /src/test/java/Test.java Revision-number: 8 Prop-content-length: 121 Content-length: 121 K 7 svn:log V 21 setup t/b/t structure K 10 svn:author V 5 Brett K 8 svn:date V 27 2005-01-03T06:01:13.921625Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: tags Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/pom.xml Node-kind: file Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: pom.xml Node-path: trunk/readme.txt Node-kind: file Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: readme.txt Node-path: trunk/src Node-kind: dir Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: src Node-path: src Node-action: delete Node-path: pom.xml Node-action: delete Node-path: readme.txt Node-action: delete maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/0000755000175000017500000000000011345536667033505 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536670033656 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536670033656 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/branch/SvnBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000313711050561465033655 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.branch; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.branch.BranchCommandTckTest; import java.io.File; /** * This test tests the branch command. * * @author Emmanuel Venisse * @version $Id: SvnBranchCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnBranchCommandTckTest extends BranchCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/update/SvnUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000307011050561465033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.update; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest; import java.io.File; /** * @author Trygve Laugstøl * @version $Id: SvnUpdateCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnUpdateCommandTckTest extends UpdateCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/checkout/SvnCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000310111050561465033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: SvnCheckOutCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnCheckOutCommandTckTest extends CheckOutCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/status/SvnStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000305611050561465033655 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.status; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.status.StatusCommandTckTest; import java.io.File; /** * @author Brett Porter * @version $Id: SvnStatusCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnStatusCommandTckTest extends StatusCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536670033656 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/tag/SvnTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000310311050561465033646 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.tag; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.tag.TagCommandTckTest; import java.io.File; /** * This test tests the tag command. * * @author Brett Porter * @version $Id: SvnTagCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnTagCommandTckTest extends TagCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/checkin/SvnCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000306411050561465033654 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest; import java.io.File; /** * @author Brett Porter * @version $Id: SvnCheckInCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnCheckInCommandTckTest extends CheckInCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/list/SvnListCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000311511050561465033651 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.list; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.list.ListCommandTckTest; import java.io.File; /** * Test for list command * * @author Carlos Sanchez * @version $Id: SvnListCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnListCommandTckTest extends ListCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000755000175000017500000000000011345536667033664 5ustar twernertwerner././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/command/diff/SvnDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000000304211050561465033650 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn.command.diff; /* * 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. */ import org.apache.maven.scm.provider.svn.SvnScmTestUtils; import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest; import java.io.File; /** * @author Brett Porter * @version $Id: SvnDiffCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class SvnDiffCommandTckTest extends DiffCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) ); } /** {@inheritDoc} */ public void initRepo() throws Exception { SvnScmTestUtils.initializeRepository( getRepositoryRoot() ); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/org/apache/maven/scm/provider/svn/SvnScmTestUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/src/main/java/o0000644000175000017500000001357411057215000033647 0ustar twernertwernerpackage org.apache.maven.scm.provider.svn; /* * 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. */ import junit.framework.Assert; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; /** * @author Trygve Laugstøl * @version $Id: SvnScmTestUtils.java 691192 2008-09-02 10:48:32Z vsiveton $ */ public final class SvnScmTestUtils { /** 'svn' command line */ public static final String SVN_COMMAND_LINE = "svn"; /** 'svnadmin' command line */ public static final String SVNADMIN_COMMAND_LINE = "svnadmin"; private SvnScmTestUtils() { } public static void initializeRepository( File repositoryRoot ) throws Exception { if ( repositoryRoot.exists() ) { FileUtils.deleteDirectory( repositoryRoot ); } Assert.assertTrue( "Could not make repository root directory: " + repositoryRoot.getAbsolutePath(), repositoryRoot.mkdirs() ); ScmTestCase.execute( repositoryRoot.getParentFile(), SVNADMIN_COMMAND_LINE, "create " + repositoryRoot.getName() ); loadSvnDump( repositoryRoot, new SvnScmTestUtils().getClass().getClassLoader().getResourceAsStream( "tck/tck.dump" ) ); } public static void initializeRepository( File repositoryRoot, File dump ) throws Exception { if ( repositoryRoot.exists() ) { FileUtils.deleteDirectory( repositoryRoot ); } Assert.assertTrue( "Could not make repository root directory: " + repositoryRoot.getAbsolutePath(), repositoryRoot.mkdirs() ); ScmTestCase.execute( repositoryRoot.getParentFile(), SVNADMIN_COMMAND_LINE, "create " + repositoryRoot.getName() ); Assert.assertTrue( "The dump file doesn't exist: " + dump.getAbsolutePath(), dump.exists() ); loadSvnDump( repositoryRoot, new FileInputStream( dump ) ); } private static void loadSvnDump( File repositoryRoot, InputStream dumpStream ) throws Exception { Commandline cl = new Commandline(); cl.setExecutable( SVNADMIN_COMMAND_LINE ); cl.setWorkingDirectory( repositoryRoot.getParentFile().getAbsolutePath() ); cl.createArg().setValue( "load" ); cl.createArg().setValue( repositoryRoot.getAbsolutePath() ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitValue = CommandLineUtils.executeCommandLine( cl, dumpStream, stdout, stderr ); if ( exitValue != 0 ) { System.err.println( "-----------------------------------------" ); System.err.println( "Command line: " + cl ); System.err.println( "Working directory: " + cl.getWorkingDirectory() ); System.err.println( "-----------------------------------------" ); System.err.println( "Standard output: " ); System.err.println( "-----------------------------------------" ); System.err.println( stdout.getOutput() ); System.err.println( "-----------------------------------------" ); System.err.println( "Standard error: " ); System.err.println( "-----------------------------------------" ); System.err.println( stderr.getOutput() ); System.err.println( "-----------------------------------------" ); } if ( exitValue != 0 ) { Assert.fail( "Exit value wasn't 0, was:" + exitValue ); } } public static String getScmUrl( File repositoryRootFile ) throws CommandLineException { String repositoryRoot = repositoryRootFile.getAbsolutePath(); // TODO: it'd be great to build this into CommandLineUtils somehow // TODO: some way without a custom cygwin sys property? if ( "true".equals( System.getProperty( "cygwin" ) ) ) { Commandline cl = new Commandline(); cl.setExecutable( "cygpath" ); cl.createArg().setValue( "--unix" ); cl.createArg().setValue( repositoryRoot ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); int exitValue = CommandLineUtils.executeCommandLine( cl, stdout, null ); if ( exitValue != 0 ) { throw new CommandLineException( "Unable to convert cygwin path, exit code = " + exitValue ); } repositoryRoot = stdout.getOutput().trim(); } else if ( Os.isFamily( "windows" ) ) { repositoryRoot = "/" + StringUtils.replace( repositoryRoot, "\\", "/" ); } return "scm:svn:file://" + repositoryRoot; } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svntest/pom.xml0000644000175000017500000000310711322611461032344 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-svn 1.3 maven-scm-provider-svntest Maven SCM Subversion Provider TCK Tests Tests library for SCM SVN Provider. org.apache.maven.scm maven-scm-test maven-scm-1.3/maven-scm-providers/maven-scm-providers-svn/pom.xml0000644000175000017500000000411411322611461025121 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-providers-svn pom Maven SCM Subversion Provider - Parent SCM Provider implementation for SVN (http://subversion.tigris.org/). maven-scm-provider-svn-commons maven-scm-provider-svnexe maven-scm-provider-svntest tck-svn org.apache.maven.plugins maven-surefire-plugin nothing maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/0000755000175000017500000000000011345536664023601 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/src/0000755000175000017500000000000011345536664024370 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/src/site/0000755000175000017500000000000011345536664025334 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/src/site/site.xml0000644000175000017500000000215711051127665027016 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/0000755000175000017500000000000011345536663030777 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/0000755000175000017500000000000011345536663031566 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/site/0000755000175000017500000000000011345536663032532 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/site/site.x0000644000175000017500000000211711051127665033660 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/0000755000175000017500000000000011345536663032512 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resour0000755000175000017500000000000011345536663033752 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resources/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resour0000755000175000017500000000000011345536663033752 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resources/repository/test-repo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resour0000755000175000017500000000000011345536663033752 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resources/repository/test-repo/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/resour0000755000175000017500000000000011345536663033752 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/0000755000175000017500000000000011345536663033433 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/branch/GitBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000263511263356573033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.branch; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.branch.BranchCommandTckTest; /** * @author Mark Struberg * @version $Id: GitBranchCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitBranchCommandTckTest extends BranchCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/update/GitUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000263511263356573033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.update; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest; /** * @author Mark Struberg * @version $Id: GitUpdateCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitUpdateCommandTckTest extends UpdateCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkout/GitCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000311311263356573033611 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; /** * @author Mark Struberg * @version $Id: GitCheckOutCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitCheckOutCommandTckTest extends CheckOutCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/status/GitStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000263511263356573033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.status; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.status.StatusCommandTckTest; /** * @author Mark Struberg * @version $Id: GitStatusCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitStatusCommandTckTest extends StatusCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/tag/GitTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000261311263356573033615 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.tag; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.tag.TagCommandTckTest; /** * @author Mark Struberg * @version $Id: GitTagCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitTagCommandTckTest extends TagCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkin/GitCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000264411263356573033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest; /** * @author Mark Struberg * @version $Id: GitCheckInCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitCheckInCommandTckTest extends CheckInCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/list/GitListCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000262111263356573033614 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.list; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.list.ListCommandTckTest; /** * @author Mark Struberg * @version $Id: GitListCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitListCommandTckTest extends ListCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/diff/GitDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000262111263356573033614 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.diff; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest; /** * @author Mark Struberg * @version $Id: GitDiffCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class GitDiffCommandTckTest extends DiffCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000755000175000017500000000000011345536663033612 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/changelog/GitChangeLogCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000000253411263356573033617 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.changelog; import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.tck.command.changelog.ChangeLogCommandTckTest; /* * 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. */ /** * @author Mark Struberg */ public abstract class GitChangeLogCommandTckTest extends ChangeLogCommandTckTest { /** {@inheritDoc} */ public void initRepo() throws Exception { GitScmTestUtils.initRepo( "src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory() ); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/GitScmTestUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/src/main/java/o0000644000175000017500000001056111263356573033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import junit.framework.Assert; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; /** * @author Trygve Laugstøl * @version $Id: GitScmTestUtils.java 823147 2009-10-08 12:39:23Z struberg $ */ public final class GitScmTestUtils { private GitScmTestUtils() { } public static void initRepo( File repository, File workingDirectory, File assertionDirectory ) throws IOException { initRepo( "src/test/repository/", repository, workingDirectory ); FileUtils.deleteDirectory( assertionDirectory ); Assert.assertTrue( assertionDirectory.mkdirs() ); } public static void initRepo( String source, File repository, File workingDirectory ) throws IOException { // Copy the repository to target File src = PlexusTestCase.getTestFile( source ); FileUtils.deleteDirectory( repository ); Assert.assertTrue( repository.mkdirs() ); FileUtils.copyDirectoryStructure( src, repository ); // now let's get rid of all .svn directories in the copied folder deleteAllDirectories( repository, ".svn" ); FileUtils.deleteDirectory( workingDirectory ); Assert.assertTrue( workingDirectory.mkdirs() ); } public static String getScmUrl( File repositoryRootFile, String provider ) throws CommandLineException { String repositoryRoot = repositoryRootFile.getAbsolutePath(); // TODO: it'd be great to build this into CommandLineUtils somehow // TODO: some way without a custom cygwin sys property? if ( "true".equals( System.getProperty( "cygwin" ) ) ) { Commandline cl = new Commandline(); cl.setExecutable( "cygpath" ); cl.createArg().setValue( "--unix" ); cl.createArg().setValue( repositoryRoot ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); int exitValue = CommandLineUtils.executeCommandLine( cl, stdout, null ); if ( exitValue != 0 ) { throw new CommandLineException( "Unable to convert cygwin path, exit code = " + exitValue ); } repositoryRoot = stdout.getOutput().trim(); } else if ( Os.isFamily( "windows" ) ) { repositoryRoot = "/" + StringUtils.replace( repositoryRoot, "\\", "/" ); } return "scm:" + provider + ":file://" + repositoryRoot; } public static void deleteAllDirectories( File startDirectory, String pattern ) throws IOException { if ( startDirectory.isDirectory() ) { File[] childs = startDirectory.listFiles(); for ( int i = 0; i < childs.length; i++ ) { File child = childs[ i ]; if ( child.isDirectory() ) { if ( child.getName().equals( pattern ) ) { FileUtils.deleteDirectory( child ); } else { deleteAllDirectories( child, pattern ); } } } } } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/pom.xml0000644000175000017500000000310011322611461032267 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-git 1.3 maven-scm-provider-gittest Maven SCM git Provider TCK Tests Tests library for SCM Git Provider. org.apache.maven.scm maven-scm-test maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/0000755000175000017500000000000011345536664031551 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/0000755000175000017500000000000011345536664032340 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/site/0000755000175000017500000000000011345536664033304 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/site/si0000644000175000017500000000212211051127665033626 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/0000755000175000017500000000000011345536664033317 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/git/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/git/diff/git-diff1.logmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000644000175000017500000000021611047652335033640 0ustar twernertwernerdiff --git a/olamy.test b/olamy.test index 83fecd7..a64804b 100644 --- a/olamy.test +++ b/olamy.test @@ -1 +1,2 @@ test olamy +new line././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/git/diff/git-diff2.logmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000644000175000017500000000066011047652335033643 0ustar twernertwernerdiff --git a/pom.xml b/pom.xml index 5bb559a..4d2f09a 100644 --- a/pom.xml +++ b/pom.xml @@ -42,4 +42,5 @@ file://${user.home}/mavenreposnapshot + diff --git a/test.txt b/test.txt index 1b69af7..e12ba22 100644 --- a/test.txt +++ b/test.txt @@ -1 +1,2 @@ Huhu ...who is there? +maven-scm git provider works fine :-)././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/git/diff/git-diff-empty.logmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000644000175000017500000000000011047652335033627 0ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/META-INF/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/META-INF/checkoutdir/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/META-INF/plexus/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000755000175000017500000000000011345536664033646 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/resources/META-INF/plexus/components.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/re0000644000175000017500000000212610775773021033645 0ustar twernertwerner org.apache.maven.scm.provider.ScmProvider git org.apache.maven.scm.provider.git.TestGitScmProvider ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/command/diff/GitDiffConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000644000175000017500000001015511047652335033627 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.List; import java.util.Map; /** * @author Mark Struberg */ public class GitDiffConsumerTest extends PlexusTestCase { public void testEmptyLogConsumer() throws Exception { GitDiffConsumer consumer = new GitDiffConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/diff/git-diff-empty.log" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 0, changedFiles.size() ); } public void testLog1Consumer() throws Exception { GitDiffConsumer consumer = new GitDiffConsumer( new DefaultLog(), null ); File f = getTestFile( "src/test/resources/git/diff/git-diff1.log" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 1, changedFiles.size() ); testScmFile( (ScmFile) changedFiles.get( 0 ), "olamy.test", ScmFileStatus.MODIFIED ); Map differences = consumer.getDifferences(); assertNotNull( differences ); StringBuffer readmeDiffs = (StringBuffer) differences.get( "olamy.test" ); assertNotNull( readmeDiffs ); assertTrue( readmeDiffs.indexOf( "+new line" ) >= 0 ); } public void testLog2Consumer() throws Exception { GitDiffConsumer consumer = new GitDiffConsumer( new DefaultLog(), null ); File f = getTestFile( "src/test/resources/git/diff/git-diff2.log" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 2, changedFiles.size() ); testScmFile( (ScmFile) changedFiles.get( 0 ), "pom.xml", ScmFileStatus.MODIFIED ); testScmFile( (ScmFile) changedFiles.get( 1 ), "test.txt", ScmFileStatus.MODIFIED ); Map differences = consumer.getDifferences(); assertNotNull( differences ); StringBuffer addDiffs = (StringBuffer) differences.get( "pom.xml" ); assertNotNull( addDiffs ); assertTrue( addDiffs.indexOf( "+ " ) >= 0 ); addDiffs = (StringBuffer) differences.get( "test.txt" ); assertNotNull( addDiffs ); assertTrue( addDiffs.indexOf( "+maven-scm git provider works fine :-)" ) >= 0 ); } private void testScmFile( ScmFile fileToTest, String expectedFilePath, ScmFileStatus expectedStatus ) { assertEquals( expectedFilePath, fileToTest.getPath() ); assertEquals( expectedStatus, fileToTest.getStatus() ); } }././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/TestGitScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000644000175000017500000000406210775773021033632 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import org.apache.maven.scm.provider.git.command.GitCommand; import java.io.File; public class TestGitScmProvider extends AbstractGitScmProvider { protected GitCommand getAddCommand() { return null; } protected GitCommand getBranchCommand() { return null; } protected GitCommand getChangeLogCommand() { return null; } protected GitCommand getCheckInCommand() { return null; } protected GitCommand getCheckOutCommand() { return null; } protected GitCommand getDiffCommand() { return null; } protected GitCommand getExportCommand() { return null; } protected GitCommand getRemoveCommand() { return null; } protected GitCommand getStatusCommand() { return null; } protected GitCommand getTagCommand() { return null; } protected GitCommand getUpdateCommand() { return null; } protected GitCommand getListCommand() { return null; } protected GitCommand getInfoCommand() { return null; } protected String getRepositoryURL( File path ) { return null; } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/test/ja0000644000175000017500000002534011263356573033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.repository; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @author Emmanuel Venisse * @version $Id: GitScmProviderRepositoryTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitScmProviderRepositoryTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } // ---------------------------------------------------------------------- // Testing legal URLs // ---------------------------------------------------------------------- public void testLegalFileURL() throws Exception { testUrl( "scm:git:file:///tmp/repo", null, "file:///tmp/repo", null, null, null, null, 0 ); } public void testLegalFileHomeURL() throws Exception { testUrl( "scm:git:file://~/repo", null, "file://~/repo", null, null, null, null, 0 ); } public void testLegalSshHomeURL() throws Exception { testUrl( "scm:git:ssh://~/repo", null, "ssh://~/repo", null, null, null, null, 0 ); } public void testLegalLocalhostFileURL() throws Exception { testUrl( "scm:git:file://localhost/tmp/repo", null, "file://localhost/tmp/repo", null, null, null, "localhost", 0 ); } public void testLegalHistnameFileURL() throws Exception { testUrl( "scm:git:file://my_server/tmp/repo", null, "file://my_server/tmp/repo", null, null, null, "my_server", 0 ); } public void testLegalHttpURL() throws Exception { testUrl( "scm:git:http://gitrepos.apache.org", null, "http://gitrepos.apache.org", null, null, null, "gitrepos.apache.org", 0 ); } public void testLegalHttpURLWithUser() throws Exception { testUrl( "scm:git:http://user@gitrepos.apache.org", null, "http://gitrepos.apache.org", null, "user", null, "gitrepos.apache.org", 0 ); } public void testLegalHttpURLWithUserPassword() throws Exception { testUrl( "scm:git:http://user:password@gitrepos.apache.org", null, "http://gitrepos.apache.org", null, "user", "password", "gitrepos.apache.org", 0 ); } public void testLegalHttpsURL() throws Exception { testUrl( "scm:git:https://gitrepos.apache.org", null, "https://gitrepos.apache.org", null, null, null, "gitrepos.apache.org", 0 ); } public void testLegalHttpsURLWithUser() throws Exception { testUrl( "scm:git:https://user@gitrepos.apache.org", null, "https://gitrepos.apache.org", null, "user", null, "gitrepos.apache.org", 0 ); } public void testLegalHttpsURLWithUserPassword() throws Exception { testUrl( "scm:git:https://user:password@gitrepos.apache.org", null, "https://gitrepos.apache.org", null, "user", "password", "gitrepos.apache.org", 0 ); } public void testLegalSshURLWithUser() throws Exception { testUrl( "scm:git:ssh://user@gitrepos.apache.org", null, "ssh://user@gitrepos.apache.org", null, "user", null, "gitrepos.apache.org", 0 ); } public void testLegalSshURLWithUserPassword() throws Exception { testUrl( "scm:git:ssh://user:password@gitrepos.apache.org", null, "ssh://user:password@gitrepos.apache.org", null, "user", "password", "gitrepos.apache.org", 0 ); } public void testLegalGitURL() throws Exception { testUrl( "scm:git:git://gitrepos.apache.org", null, "git://gitrepos.apache.org", null, null, null, "gitrepos.apache.org", 0 ); } public void testGitDevURL() throws Exception, ScmRepositoryException { testUrl( "scm:git:git@github.com:olamy/scm-git-test-one-module.git", null, "git@github.com:olamy/scm-git-test-one-module.git", null, "git" , null, "github.com", 0 ); } public void testGitDevURLWIthPort() throws Exception, ScmRepositoryException { testUrl( "scm:git:git@github.com:222:olamy/scm-git-test-one-module.git", null, "git@github.com:222:olamy/scm-git-test-one-module.git", null, "git", null, "github.com", 222 ); } public void testLegalGitPortUrl() throws Exception { testUrl( "scm:git:http://username@gitrepos.apache.org:8800/pmgt/trunk", null, "http://gitrepos.apache.org:8800/pmgt/trunk", null, "username", null, "gitrepos.apache.org", 8800 ); testUrl( "scm:git:https://username@gitrepos.apache.org:20443/pmgt/trunk", null, "https://gitrepos.apache.org:20443/pmgt/trunk", null, "username", null, "gitrepos.apache.org", 20443 ); testUrl( "scm:git:git://username@gitrepos.apache.org:8800/pmgt/trunk", null, "git://username@gitrepos.apache.org:8800/pmgt/trunk", null, "username", null, "gitrepos.apache.org", 8800 ); testUrl( "scm:git:ssh://username@gitrepos.apache.org:8080/pmgt/trunk", null, "ssh://username@gitrepos.apache.org:8080/pmgt/trunk", null, "username", null, "gitrepos.apache.org", 8080 ); testUrl( "scm:git:ssh://username:password@gitrepos.apache.org/pmgt/trunk", null, "ssh://username:password@gitrepos.apache.org/pmgt/trunk", null, "username", "password", "gitrepos.apache.org", 0 ); } // ---------------------------------------------------------------------- // the following tests are for combined fetch + push URLs // ---------------------------------------------------------------------- public void testHttpFetchSshPushUrl() throws Exception { testUrl( "scm:git:[fetch=]http://git.apache.org/myprj.git[push=]ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git", "[fetch=]http://git.apache.org/myprj.git[push=]ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git", "http://git.apache.org/myprj.git", "ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git", "myuser", "mypassword", "git.apache.org", 0 ); testUrl( "scm:git:[push=]ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git[fetch=]http://git.apache.org/myprj.git", "[fetch=]http://git.apache.org/myprj.git[push=]ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git", "http://git.apache.org/myprj.git", "ssh://myuser:mypassword@git.apache.org/~/myrepo/myprj.git", "myuser", "mypassword", "git.apache.org", 0 ); } // ---------------------------------------------------------------------- // Testing illegal URLs // ---------------------------------------------------------------------- //X in fact this url is perfectly valid from a technical perspective //X it will be interpreted by git as git://file/tmp/git public void nottestIllegalFileUrl() throws Exception { testIllegalUrl( "file:/tmp/git" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private GitScmProviderRepository testUrl( String scmUrl, String expectedToString, String expectedFetchUrl, String expectedPushUrl, String expectedUser, String expectedPassword, String expectedHost, int expectedPort ) throws Exception, ScmRepositoryException { ScmRepository repository = scmManager.makeScmRepository( scmUrl ); assertNotNull( "ScmManager.makeScmRepository() returned null", repository ); assertNotNull( "The provider repository was null.", repository.getProviderRepository() ); assertTrue( "The SCM Repository isn't a " + GitScmProviderRepository.class.getName() + ".", repository .getProviderRepository() instanceof GitScmProviderRepository ); GitScmProviderRepository providerRepository = (GitScmProviderRepository) repository.getProviderRepository(); assertEquals( "fetch url is incorrect", expectedFetchUrl, providerRepository.getFetchUrl() ); if ( expectedPushUrl != null ) { assertEquals( "push url is incorrect", expectedPushUrl, providerRepository.getPushUrl() ); } if ( expectedToString != null ) { assertEquals( "toString is incorrect", "git:" + expectedToString, repository.toString() ); } else { assertEquals( "toString is incorrect", "git:" + expectedFetchUrl, repository.toString() ); } assertEquals( "User is incorrect", expectedUser, providerRepository.getUser() ); assertEquals( "Password is incorrect", expectedPassword, providerRepository.getPassword() ); assertEquals( "Host is incorrect", expectedHost == null ? "" : expectedHost, providerRepository.getHost() ); if ( expectedPort > 0 ) { assertEquals( "Port is incorrect", expectedPort, providerRepository.getPort() ); } return providerRepository; } private void testIllegalUrl( String url ) throws Exception { try { scmManager.makeScmRepository( "scm:git:" + url ); fail( "Expected a ScmRepositoryException while testing the url '" + url + "'." ); } catch ( ScmRepositoryException e ) { // expected } } public void testGetParent() throws Exception { new GitScmProviderRepository( "http://gitrepos.apache.org" ); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/0000755000175000017500000000000011345536664033264 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/mdo/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/md0000755000175000017500000000000011345536664033605 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/mdo/git-settings.mdomaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/md0000644000175000017500000000506411315117331033573 0ustar twernertwerner git Git git Provider Model. package org.apache.maven.scm.providers.gitlib.settings Settings 1.0.0+ revParseDateFormat 1.0.0+ String yyyy-MM-dd HH:mm:ss traceGitCommand 1.0.0+ String commitNoVerify 1.0.0+ boolean false use the option --no-verify (can prevent trailing whitespace issue with cygwin) ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/info/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/info/GitInfoItem.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000616611050561465033600 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.info; /* * 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. */ /** * @author Kenney Westerhof * @version $Id: GitInfoItem.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class GitInfoItem { private String path; private String url; private String repositoryRoot; private String repositoryUUID; private String revision; private String nodeKind; private String schedule; private String lastChangedAuthor; private String lastChangedRevision; private String lastChangedDate; public String getPath() { return path; } public void setPath( String path ) { this.path = path; } public String getURL() { return url; } public void setURL( String url ) { this.url = url; } public String getRepositoryRoot() { return repositoryRoot; } public void setRepositoryRoot( String repositoryRoot ) { this.repositoryRoot = repositoryRoot; } public String getRepositoryUUID() { return repositoryUUID; } public void setRepositoryUUID( String repositoryUUID ) { this.repositoryUUID = repositoryUUID; } public String getRevision() { return revision; } public void setRevision( String revision ) { this.revision = revision; } public String getNodeKind() { return nodeKind; } public void setNodeKind( String nodeKind ) { this.nodeKind = nodeKind; } public String getSchedule() { return schedule; } public void setSchedule( String schedule ) { this.schedule = schedule; } public String getLastChangedAuthor() { return lastChangedAuthor; } public void setLastChangedAuthor( String lastChangedAuthor ) { this.lastChangedAuthor = lastChangedAuthor; } public String getLastChangedRevision() { return lastChangedRevision; } public void setLastChangedRevision( String lastChangedRevision ) { this.lastChangedRevision = lastChangedRevision; } public String getLastChangedDate() { return lastChangedDate; } public void setLastChangedDate( String lastChangedDate ) { this.lastChangedDate = lastChangedDate; } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/info/GitInfoScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000337411050561465033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.info; /* * 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. */ import org.apache.maven.scm.ScmResult; import java.util.ArrayList; import java.util.List; /** * @author Kenney Westerhof * @version $Id: GitInfoScmResult.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class GitInfoScmResult extends ScmResult { private List infoItems; public GitInfoScmResult( String commandLine, String providerMessage, String commandOutput, boolean success ) { super( commandLine, providerMessage, commandOutput, success ); infoItems = new ArrayList( 0 ); } public GitInfoScmResult( String commandLine, List files ) { super( commandLine, null, null, true ); this.infoItems = files; } public GitInfoScmResult( List files, ScmResult result ) { super( result ); this.infoItems = files; } public List getInfoItems() { return infoItems; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/update/GitUpdateScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000254610775773021033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.update; /* * 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. */ import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: GitUpdateScmResult.java 645182 2008-04-05 21:58:41Z jvanzyl $ * @deprecated */ public class GitUpdateScmResult extends UpdateScmResultWithRevision { public GitUpdateScmResult( String commandLine, List updatedFiles, int revision ) { super( commandLine, updatedFiles, String.valueOf( revision ) ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/GitCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000212410775773021033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command; /* * 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. */ import org.apache.maven.scm.command.Command; /** * @author Trygve Laugstøl * @version $Id: GitCommand.java 645182 2008-04-05 21:58:41Z jvanzyl $ */ public interface GitCommand extends Command { } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/diff/GitDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000001447211057621704033577 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Brett Porter * @author Mark Struberg * @version $Id: GitDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class GitDiffConsumer implements StreamConsumer { // diff --git a/readme.txt b/readme.txt // index fea1611..9e131cf 100644 // --- a/readme.txt // +++ b/readme.txt // @@ -1 +1 @@ // -/readme.txt // \ No newline at end of file // +new version of /readme.txt /** * patern matches the index line of the diff comparison * paren.1 matches the first file * paren.2 matches the 2nd file */ private static final String DIFF_FILES_PATTERN = "^diff --git\\sa/(.*)\\sb/(.*)"; private static final String START_REVISION_TOKEN = "---"; private static final String END_REVISION_TOKEN = "+++"; private static final String ADDED_LINE_TOKEN = "+"; private static final String REMOVED_LINE_TOKEN = "-"; private static final String UNCHANGED_LINE_TOKEN = " "; private static final String CHANGE_SEPARATOR_TOKEN = "@@"; private static final String NO_NEWLINE_TOKEN = "\\ No newline at end of file"; private static final String INDEX_LINE_TOKEN = "index "; private static final String NEW_FILE_MODE_TOKEN = "new file mode "; private static final String DELETED_FILE_MODE_TOKEN = "deleted file mode "; private ScmLogger logger; private String currentFile; private StringBuffer currentDifference; private List changedFiles = new ArrayList(); private Map differences = new HashMap(); private StringBuffer patch = new StringBuffer(); /** * @see #DIFF_FILES_PATTERN */ private RE filesRegexp; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public GitDiffConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; try { filesRegexp = new RE( DIFF_FILES_PATTERN ); } catch ( RESyntaxException ex ) { throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse git log file. Something is probably wrong with the oro installation.", ex ); } } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( filesRegexp.match( line ) ) { // start a new file currentFile = filesRegexp.getParen( 1 ); changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) ); currentDifference = new StringBuffer(); differences.put( currentFile, currentDifference ); patch.append( line ).append( "\n" ); return; } if ( currentFile == null ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); return; } else if ( line.startsWith( INDEX_LINE_TOKEN ) ) { // skip, though could parse to verify start revision and end revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( NEW_FILE_MODE_TOKEN ) || line.startsWith( DELETED_FILE_MODE_TOKEN ) ) { // skip, though could parse to verify file mode patch.append( line ).append( "\n" ); } else if ( line.startsWith( START_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, start revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( END_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, end revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) || line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) || line.equals( NO_NEWLINE_TOKEN ) ) { // add to buffer currentDifference.append( line ).append( "\n" ); patch.append( line ).append( "\n" ); } else { // TODO: handle property differences if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); // skip to next file currentFile = null; currentDifference = null; } } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch.toString(); } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/AbstractGitScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000002543611263356573033611 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.command.info.GitInfoScmResult; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.ArrayList; import java.util.List; /** * SCM Provider for git * * * @author Emmanuel Venisse * @version $Id: AbstractGitScmProvider.java 823147 2009-10-08 12:39:23Z struberg $ */ public abstract class AbstractGitScmProvider extends AbstractScmProvider { // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Internal class */ private static class ScmUrlParserResult { private List messages = new ArrayList(); private ScmProviderRepository repository; } // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public String getScmSpecificFilename() { return ".git"; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { try { ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; } catch ( ScmException e ) { // XXX We should allow throwing of SCMException. throw new ScmRepositoryException( "Error creating the scm repository", e ); } } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null ) { throw new NullPointerException( "Path argument is null" ); } if ( !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } if ( !new File( path, ".git" ).exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a git checkout directory." ); } try { return makeProviderScmRepository( getRepositoryURL( path ), ':' ); } catch ( ScmException e ) { // XXX We should allow throwing of SCMException. throw new ScmRepositoryException( "Error creating the scm repository", e ); } } protected abstract String getRepositoryURL( File path ) throws ScmException; /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { List messages = new ArrayList(); try { makeProviderScmRepository( scmSpecificUrl, delimiter ); } catch ( ScmRepositoryException e ) { messages = e.getValidationMessages(); } return messages; } /** {@inheritDoc} */ public String getScmType() { return "git"; } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * The git-submodule(1) command is available since Git 1.5.3, so modules will * be activated in a later stage */ private ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter ) throws ScmException { ScmUrlParserResult result = new ScmUrlParserResult(); result.repository = new GitScmProviderRepository( scmSpecificUrl ); return result; } protected abstract GitCommand getAddCommand(); /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (AddScmResult) executeCommand( getAddCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getBranchCommand(); /** {@inheritDoc} */ protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (BranchScmResult) executeCommand( getBranchCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getChangeLogCommand(); /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ChangeLogScmResult) executeCommand( getChangeLogCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getCheckInCommand(); /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckInScmResult) executeCommand( getCheckInCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getCheckOutCommand(); /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (CheckOutScmResult) executeCommand( getCheckOutCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getDiffCommand(); /** {@inheritDoc} */ public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (DiffScmResult) executeCommand( getDiffCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getExportCommand(); /** {@inheritDoc} */ protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (ExportScmResult) executeCommand( getExportCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getRemoveCommand(); /** {@inheritDoc} */ public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (RemoveScmResult) executeCommand( getRemoveCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getStatusCommand(); /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (StatusScmResult) executeCommand( getStatusCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getTagCommand(); /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (TagScmResult) executeCommand( getTagCommand(), repository, fileSet, parameters ); } protected abstract GitCommand getUpdateCommand(); /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet, parameters ); } protected ScmResult executeCommand( GitCommand command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { command.setLogger( getLogger() ); return command.execute( repository, fileSet, parameters ); } protected abstract GitCommand getListCommand(); /** {@inheritDoc} */ public ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { GitCommand cmd = getListCommand(); return (ListScmResult) executeCommand( cmd, repository, fileSet, parameters ); } protected abstract GitCommand getInfoCommand(); public GitInfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { GitCommand cmd = getInfoCommand(); return (GitInfoScmResult) executeCommand( cmd, repository, fileSet, parameters ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitChangeSet.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000554311263356573033606 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: GitChangeSet.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitChangeSet extends ChangeSet { public GitChangeSet() { super(); } /** * @param strDate * @param userDatePattern * @param comment * @param author * @param files List of {@link ChangeFile} */ public GitChangeSet( String strDate, String userDatePattern, String comment, String author, List files ) { super( strDate, userDatePattern, comment, author, files ); } /** * @param date * @param comment * @param author * @param files List of {@link ChangeFile} */ public GitChangeSet( Date date, String comment, String author, List files ) { super( date, comment, author, files ); } /** {@inheritDoc} */ /*X TODO maybe we can drop the whole class? public boolean containsFilename( String filename, ScmProviderRepository repository ) { GitScmProviderRepository repo = (GitScmProviderRepository) repository; String url = repo.getUrl(); if ( !url.endsWith( "/" ) ) { url += "/"; } String currentFile = url + StringUtils.replace( filename, "\\", "/" ); if ( getFiles() != null ) { for ( Iterator i = getFiles().iterator(); i.hasNext(); ) { ChangeFile file = (ChangeFile) i.next(); if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) ) { return true; } } } return false; } */ } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/util/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/util/GitUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000515211320726466033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.util; /* * 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. */ import org.apache.maven.scm.providers.gitlib.settings.Settings; import org.apache.maven.scm.providers.gitlib.settings.io.xpp3.GitXpp3Reader; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; /** * @author Emmanuel Venisse * @version $Id: GitUtil.java 896222 2010-01-05 21:20:54Z olamy $ */ public class GitUtil { protected static final String GIT_SETTINGS_FILENAME = "git-settings.xml"; public static final File DEFAULT_SETTINGS_DIRECTORY = new File( System.getProperty( "user.home" ), ".scm" ); private static File settingsDirectory = DEFAULT_SETTINGS_DIRECTORY; private GitUtil() { } public static Settings getSettings() { File scmUserDir = settingsDirectory; File settingsFile = new File( scmUserDir, GIT_SETTINGS_FILENAME ); if ( settingsFile.exists() ) { GitXpp3Reader reader = new GitXpp3Reader(); try { return reader.read( ReaderFactory.newXmlReader( settingsFile ) ); } catch ( FileNotFoundException e ) { //Nothing to do } catch ( IOException e ) { //Nothing to do } catch ( XmlPullParserException e ) { String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage(); System.err.println( message ); } } return new Settings(); } public static void setSettingsDirectory( File directory ) { settingsDirectory = directory; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitConfigFileReader.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000001021711016331640033560 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: GitConfigFileReader.java 660014 2008-05-25 18:44:48Z hboutemy $ */ public class GitConfigFileReader { private File configDirectory; public File getConfigDirectory() { if ( configDirectory == null ) { File confDir = new File( ".git" ); if ( confDir.exists() ) { configDirectory = confDir; } else { confDir = new File( "." ); if ( confDir.exists() ) { configDirectory = confDir; } } } return configDirectory; } public void setConfigDirectory( File configDirectory ) { this.configDirectory = configDirectory; } public String getProperty( String group, String propertyName ) { List lines = getConfLines(); boolean inGroup = false; for ( Iterator i = lines.iterator(); i.hasNext(); ) { String line = ( (String) i.next() ).trim(); if ( !inGroup ) { if ( ( "[" + group + "]" ).equals( line ) ) { inGroup = true; } } else { if ( line.startsWith( "[" ) && line.endsWith( "]" ) ) { //a new group start return null; } if ( line.startsWith( "#" ) ) { continue; } if ( line.indexOf( '=' ) < 0 ) { continue; } String property = line.substring( 0, line.indexOf( '=' ) ).trim(); if ( !property.equals( propertyName ) ) { continue; } String value = line.substring( line.indexOf( '=' ) + 1 ); return value.trim(); } } return null; } /** * Load the git config file * * @return the list of all lines */ private List getConfLines() { List lines = new ArrayList(); BufferedReader reader = null; try { if ( getConfigDirectory().exists() ) { reader = new BufferedReader( new FileReader( new File( getConfigDirectory(), "config" ) ) ); String line; while ( ( line = reader.readLine() ) != null ) { if ( !line.startsWith( "#" ) && StringUtils.isNotEmpty( line ) ) { lines.add( line ); } } } } catch ( IOException e ) { lines.clear(); } finally { IOUtil.close( reader ); reader = null; } return lines; } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitCommandUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000455111057005130033561 0ustar twernertwernerpackage org.apache.maven.scm.provider.git; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.util.GitUtil; import org.apache.maven.scm.providers.gitlib.settings.Settings; import org.codehaus.plexus.util.cli.Commandline; /** * Command utilities for git commands. * * @author Jerome Lacoste * @version $Id: GitCommandUtils.java 690997 2008-09-01 15:29:28Z vsiveton $ */ public class GitCommandUtils { private GitCommandUtils() { } public static Commandline getBaseCommand( String commandName, GitScmProviderRepository repo, ScmFileSet fileSet ) { return getBaseCommand( commandName, repo, fileSet, null ); } public static Commandline getBaseCommand( String commandName, GitScmProviderRepository repo, ScmFileSet fileSet, String options ) { Settings settings = GitUtil.getSettings(); Commandline cl = new Commandline(); cl.setExecutable( "git" ); cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); if ( settings.getTraceGitCommand() != null ) { cl.addEnvironment( "GIT_TRACE", settings.getTraceGitCommand() ); } cl.createArg().setLine( options ); cl.createArg().setValue( commandName ); return cl; } public static String getRevParseDateFormat() { return GitUtil.getSettings().getRevParseDateFormat(); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000003305011272416215033566 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.repository; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; /** * @author Emmanuel Venisse * @author Mark Struberg * @version $Id: GitScmProviderRepository.java 831139 2009-10-29 22:51:57Z olamy $ */ public class GitScmProviderRepository extends ScmProviderRepositoryWithHost { /** sequence used to delimit the fetch URL */ public static final String URL_DELIMITER_FETCH = "[fetch=]"; /** sequence used to delimit the push URL */ public static final String URL_DELIMITER_PUSH = "[push=]"; /** this trails every protocol */ public static final String PROTOCOL_SEPARATOR = "://"; /** use local file as transport*/ public static final String PROTOCOL_FILE = "file"; /** use gits internal protocol */ public static final String PROTOCOL_GIT = "git"; /** use secure shell protocol */ public static final String PROTOCOL_SSH = "ssh"; /** use the standard port 80 http protocol */ public static final String PROTOCOL_HTTP = "http"; /** use the standard port 443 https protocol */ public static final String PROTOCOL_HTTPS = "https"; /** use rsync for retrieving the data * TODO implement! */ public static final String PROTOCOL_RSYNC = "rsync"; /** * No special protocol specified. Git will either use git:// * or ssh:// depending on whether we work locally or over the network */ public static final String PROTOCOL_NONE = ""; /** this may either 'git' or 'jgit' depending on the underlying implementation being used */ private String provider; /** the URL used to fetch from the upstream repository */ private RepositoryUrl fetchInfo; /** the URL used to push to the upstream repository */ private RepositoryUrl pushInfo; public GitScmProviderRepository( String url ) throws ScmException { if ( url == null ) { throw new ScmException( "url must not be null" ); } if ( url.startsWith( URL_DELIMITER_FETCH ) ) { String fetch = url.substring( URL_DELIMITER_FETCH.length() ); int indexPushDelimiter = fetch.indexOf( URL_DELIMITER_PUSH ); if ( indexPushDelimiter >= 0 ) { String push = fetch.substring( indexPushDelimiter + URL_DELIMITER_PUSH.length() ); pushInfo = parseUrl( push ); fetch = fetch.substring( 0, indexPushDelimiter ); } fetchInfo = parseUrl( fetch ); if ( pushInfo == null ) { pushInfo = fetchInfo; } } else if ( url.startsWith( URL_DELIMITER_PUSH ) ) { String push = url.substring( URL_DELIMITER_PUSH.length() ); int indexFetchDelimiter = push.indexOf( URL_DELIMITER_FETCH ); if ( indexFetchDelimiter >= 0 ) { String fetch = push.substring( indexFetchDelimiter + URL_DELIMITER_FETCH.length() ); fetchInfo = parseUrl( fetch ); push = push.substring( 0, indexFetchDelimiter ); } pushInfo = parseUrl( push ); if ( fetchInfo == null ) { fetchInfo = pushInfo; } } else { fetchInfo = pushInfo = parseUrl( url ); } // set the default values for backward compatibility from the push url // because it's more likely that the push URL contains 'better' credentials setUser( pushInfo.getUserName() ); setPassword( pushInfo.getPassword() ); setHost( pushInfo.getHost() ); if ( pushInfo.getPort() != null && pushInfo.getPort().length() > 0 ) { setPort( Integer.parseInt( pushInfo.getPort() ) ); } } public GitScmProviderRepository( String url, String user, String password ) throws ScmException { this( url ); setUser( user ); setPassword( password ); } /** * @return either 'git' or 'jgit' depending on the underlying implementation being used */ public String getProvider() { return provider; } public RepositoryUrl getFetchInfo() { return fetchInfo; } public RepositoryUrl getPushInfo() { return pushInfo; } /** * @return the URL used to fetch from the upstream repository */ public String getFetchUrl() { return getUrl( fetchInfo ); } /** * @return the URL used to push to the upstream repository */ public String getPushUrl() { return getUrl( pushInfo ); } /** * Parse the given url string and store all the extracted * information in a {@code RepositoryUrl} * @param url to parse * @return filled with the information from the given URL * @throws ScmException */ private RepositoryUrl parseUrl( String url ) throws ScmException { RepositoryUrl repoUrl = new RepositoryUrl(); url = parseProtocol( repoUrl, url ); url = parseUserInfo( repoUrl, url ); url = parseHostAndPort( repoUrl, url ); // the rest of the url must be the path to the repository on the server repoUrl.setPath( url ); return repoUrl; } /** * * @param repoUrl * @return */ private String getUrl( RepositoryUrl repoUrl ) { StringBuffer urlSb = new StringBuffer( repoUrl.getProtocol() ); boolean urlSupportsUserInformation = false; if ( PROTOCOL_SSH.equals( repoUrl.getProtocol() ) || PROTOCOL_RSYNC.equals( repoUrl.getProtocol() ) || PROTOCOL_GIT.equals( repoUrl.getProtocol() ) || PROTOCOL_NONE.equals( repoUrl.getProtocol() ) ) { urlSupportsUserInformation = true; } if ( repoUrl.getProtocol() != null && repoUrl.getProtocol().length() > 0 ) { urlSb.append( "://" ); } // add user information if given and allowed for the protocol if ( urlSupportsUserInformation ) { String userName = repoUrl.getUserName(); // if specified on the commandline or other configuration, we take this. if ( getUser() != null && getUser().length() > 0 ) { userName = getUser(); } String password = repoUrl.getPassword(); if ( getPassword() != null && getPassword().length() > 0 ) { password = getPassword(); } //X TODO passphrase handling is missing! if ( userName != null && userName.length() > 0 ) { urlSb.append( userName ); if ( password != null && password.length() > 0 ) { urlSb.append( ':' ).append( password ); } urlSb.append( '@' ); } } // add host and port information urlSb.append( repoUrl.getHost() ); if ( repoUrl.getPort() != null && repoUrl.getPort().length() > 0 ) { urlSb.append( ':' ).append( repoUrl.getPort() ); } // finaly we add the path to the repo on the host urlSb.append( repoUrl.getPath() ); return urlSb.toString(); } /** * Parse the protocol from the given url and fill it into the given RepositoryUrl. * @param repoUrl * @param url * @return the given url with the protocol parts removed */ private String parseProtocol( RepositoryUrl repoUrl, String url ) throws ScmException { // extract the protocol if ( url.startsWith( PROTOCOL_FILE + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_FILE ); } else if ( url.startsWith( PROTOCOL_HTTPS + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_HTTPS ); } else if ( url.startsWith( PROTOCOL_HTTP + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_HTTP ); } else if ( url.startsWith( PROTOCOL_SSH + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_SSH ); } else if ( url.startsWith( PROTOCOL_GIT + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_GIT ); } else if ( url.startsWith( PROTOCOL_RSYNC + PROTOCOL_SEPARATOR ) ) { repoUrl.setProtocol( PROTOCOL_RSYNC ); } else { // when no protocol is specified git will pick either ssh:// or git:// // depending on whether we work locally or over the network repoUrl.setProtocol( PROTOCOL_NONE ); return url; } url = url.substring( repoUrl.getProtocol().length() + 3 ); return url; } /** * Parse the user information from the given url and fill * user name and password into the given RepositoryUrl. * @param repoUrl * @param url * @return the given url with the user parts removed */ private String parseUserInfo( RepositoryUrl repoUrl, String url ) throws ScmException { // extract user information int indexAt = url.indexOf( "@" ); if ( indexAt >= 0 ) { String userInfo = url.substring( 0, indexAt ); int indexPwdSep = userInfo.indexOf( ":" ); if ( indexPwdSep < 0 ) { repoUrl.setUserName( userInfo ); } else { repoUrl.setUserName( userInfo.substring( 0, indexPwdSep ) ); repoUrl.setPassword( userInfo.substring( indexPwdSep + 1 ) ); } url = url.substring( indexAt + 1 ); } return url; } /** * Parse server and port from the given url and fill it into the * given RepositoryUrl. * @param repoUrl * @param url * @return the given url with the server parts removed * @throws ScmException */ private String parseHostAndPort( RepositoryUrl repoUrl, String url ) throws ScmException { StringBuffer host = new StringBuffer(); StringBuffer port = new StringBuffer(); int i = 0; boolean isPort = false; while ( i < url.length() ) { char c = url.charAt( i ); if ( c == ':' ) { i++; isPort = true; continue; } if ( c == '/' || c == '\\' || c == '~' ) { // if we find a slash (backslash for windows compatibility) // or a home sign (~) then we are finished break; } if ( isPort ) { if ( ! Character.isDigit( c ) ) { // this seems not to be a port, so it must be the start of the the path block i--; // because the ':' seems to belong to the path in this case break; } else { port.append( c ); i++; continue; } } // otherwise this must still be part of the host host.append( c ); i++; } repoUrl.setHost( host.toString() ); repoUrl.setPort( port.toString() ); url = url.substring( i ); return url; } /** {@inheritDoc} */ public String getRelativePath( ScmProviderRepository ancestor ) { if ( ancestor instanceof GitScmProviderRepository ) { GitScmProviderRepository gitAncestor = (GitScmProviderRepository) ancestor; //X TODO review! String url = getFetchUrl(); String path = url.replaceFirst( gitAncestor.getFetchUrl() + "/", "" ); if ( !path.equals( url ) ) { return path; } } return null; } /** {@inheritDoc} */ public String toString() { // yes we really like to check if those are the exact same instance! if ( fetchInfo == pushInfo ) { return getUrl( fetchInfo ); } return URL_DELIMITER_FETCH + getUrl( fetchInfo ) + URL_DELIMITER_PUSH + getUrl( pushInfo ); } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/RepositoryUrl.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/ja0000644000175000017500000000504011263356573033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.repository; /* * 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. */ /** * This class is a container which holds information about * repository URL. * @author Mark Struberg * @version $Id: RepositoryUrl.java 823147 2009-10-08 12:39:23Z struberg $ * @since 1.3 */ public class RepositoryUrl { /** the protocol used to access the upstream repository */ private String protocol; /** the server to access the upstream repository */ private String host; /** the port to access the upstream repository */ private String port; /** the path on the server to access the upstream repository */ private String path; /** the user name from the repository URL */ private String userName; /** the password from the repository URL */ private String password; public String getProtocol() { return protocol; } public void setProtocol( String protocol ) { this.protocol = protocol; } public String getHost() { return host; } public void setHost( String host ) { this.host = host; } public String getPort() { return port; } public void setPort( String port ) { this.port = port; } public String getPath() { return path; } public void setPath( String path ) { this.path = path; } public String getUserName() { return userName; } public void setUserName( String userName ) { this.userName = userName; } public String getPassword() { return password; } public void setPassword( String password ) { this.password = password; } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/pom.xml0000644000175000017500000000421111322611461033044 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-git 1.3 maven-scm-provider-git-commons Maven SCM Git Provider - Common library Common library for SCM Git Provider. regexp regexp org.codehaus.modello modello-maven-plugin java xpp3-reader xsd 1.0.0 src/main/mdo/git-settings.mdo maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/0000755000175000017500000000000011345536664030602 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/0000755000175000017500000000000011345536664031371 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/site/0000755000175000017500000000000011345536664032335 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/site/site.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/site/site.xm0000644000175000017500000000212511051127665033636 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/0000755000175000017500000000000011345536664032350 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update-one.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000063511047551164033750 0ustar twernertwernerremote: Counting objects: 5, done.â†[K remote: Compressing objects: 100% (3/3), done.â†[K remote: Total 3 (delta 2), reused 1 (delta 0)â†[K Unpacking objects: 100% (3/3), done. From git@github.com:olamy/scm-git-test-one-module * branch master -> FETCH_HEAD Updating a74329b..5c76cac Fast forward pom.xmlâ†[m | 1 â†[32m+â†[m 1 files changed, 1 insertions(+), 0 deletions(-)â†[m././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update-add-delete.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000105711047551164033747 0ustar twernertwernerremote: Counting objects: 12, done.â†[K remote: Compressing objects: 100% (6/6), done.â†[K) â†[K remote: Total 9 (delta 3), reused 8 (delta 2)â†[K Unpacking objects: 100% (9/9), done. From git@github.com:olamy/scm-git-test-one-module * branch master -> FETCH_HEAD Updating 9e24129..a74329b Fast forward README â†[m | 2 â†[31m--â†[m pom.xml â†[m | 1 â†[31m-â†[m test.txtâ†[m | 1 â†[32m+â†[m 3 files changed, 1 insertions(+), 3 deletions(-)â†[m delete mode 100644 README create mode 100644 test.txt ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update-one-other-format.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000032111047551164033740 0ustar twernertwernerFrom git@github.com:olamy/scm-git-test-one-module * branch master -> FETCH_HEAD Updating a2a2d2f..9b95d23 Fast forward pom.xml | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update-latest-rev.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000021511160266402033734 0ustar twernertwernercommit a300c56a341bae8d0eb5ec4ed5551a11c75a5a6e Author: Mark Struberg Date: Wed Mar 18 15:59:31 2009 +0100 No msg ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000070311047551164033744 0ustar twernertwernerremote: Counting objects: 7, done.â†[K remote: Compressing objects: 100% (3/3), done.â†[K remote: Total 4 (delta 2), reused 3 (delta 1)â†[K Unpacking objects: 100% (4/4), done. From git@github.com:olamy/scm-git-test-one-module * branch master -> FETCH_HEAD Updating e5f3806..9e24129 Fast forward README â†[m | 1 â†[31m-â†[m pom.xmlâ†[m | 1 â†[32m+â†[m 2 files changed, 1 insertions(+), 1 deletions(-)â†[m ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/update/git-update-up-to-date.outmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000016511047551164033746 0ustar twernertwernerFrom git@github.com:olamy/scm-git-test-one-module * branch master -> FETCH_HEAD Already up-to-date.././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/status/gitstatus2.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000174211010222205033725 0ustar twernertwerner# Not currently on any branch. # Changed but not updated: # (use "git add/rm ..." to update what will be committed) # # modified: maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.java # modified: maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java # deleted: maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInConsumer.java # modified: maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java # # Untracked files: # (use "git add ..." to include in what will be committed) # # maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumerTest.java # maven-scm-provider-gitexe/src/test/resources/git/status/ no changes added to commit (use "git add" and/or "git commit -a") ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/status/gitstatus1.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000036311010222205033723 0ustar twernertwerner# On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # new file: project.xml # # Changed but not updated: # (use "git add ..." to update what will be committed) # # modified: readme.txt # ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/status/gitstatus-empty.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000057711010222205033732 0ustar twernertwerner# Not currently on any branch. # Untracked files: # (use "git add ..." to include in what will be committed) # # maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInConsumerTest.java # maven-scm-provider-gitexe/src/test/resources/git/checkin/ nothing added to commit but untracked files present (use "git add" to track) ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/remove/gitrm.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000010211010222205033712 0ustar twernertwernerrm 'src/main/java/Application.java' rm 'src/test/java/Test.java' ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/remove/gitrm-empty.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000000011010222205033707 0ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/changelog/gitwhatchanged.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000240711046177134033747 0ustar twernertwernercommit 87b491254306a64cebee4be3195fd56542b2b09f Author: Mark Struberg Date: 2007-11-24 01:14:44 +0100 tck :100644 100644 14a4052... 61a0d22... M src/main/java/Application.java commit 21b9e10522ae661b9c6595cb29a6d2ec76af3fe3 Author: Mark Struberg Date: 2007-11-24 01:13:10 +0100 tck :100644 100644 d18f041... b53306f... M src/test/java/Test.java commit 71fa36033234b8998937b9d4d746da186038cbcc Author: Mark Struberg Date: 2007-11-24 01:12:01 +0100 fixed tck :100644 100644 165cc8e... d18f041... M src/test/java/Test.java commit 895d423689da3b36d8e9106c0ecbf3d62433978c Author: Mark Struberg Date: 2007-11-24 01:10:42 +0100 / added :100644 100644 0d79d56... fea1611... M readme.txt commit 2d22f2da71ef279c4759b1c09cdb8282b63f0cf6 Author: Mark Struberg Date: 2007-11-24 01:10:06 +0100 fixed linebreak :100644 100644 fd39fa3... 614a3fd... M pom.xml :100644 100644 e69de29... 0d79d56... M readme.txt commit e5442f3dff1884ec9df7fa67b3d08c7f3f83b5ce Author: Mark Struberg Date: 2007-11-24 01:07:48 +0100 fix content for tck :100644 100644 4575900... fd39fa3... M pom.xml :100644 100644 b84aed0... e69de29... M readme.txt ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/git/changelog/gitwhatchanged2.gitlogmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000004067511046177134033760 0ustar twernertwernercommit 107135a712f86525ca810e16dfdac7e65994d74c Author: Mark Struberg Date: 2007-11-27 20:10:27 +0100 initial changelog consumer written :100644 100644 b47e9c6... 19d30d2... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java :100644 100644 c0da783... 504f1a3... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumer.java :100644 100644 f5a5c34... 8551d3f... M maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumerTest.java commit d56726a4e0b3fcf54a6c2fb45d285fcf23e4053a Author: Mark Struberg Date: 2007-11-27 16:25:25 +0100 temporarily use production scm :100644 100644 169d76c... d0ad30a... M maven-scm-provider-gittest/pom.xml commit 0bde2244241273a1777622d09c9cd1e916fba669 Author: Mark Struberg Date: 2007-11-27 16:16:28 +0100 fixed revision and date handling :100644 100644 adb5a96... cb93527... M maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java commit 981afd58987f5ac4afa21be2d1e0d7420f77e19f Author: Mark Struberg Date: 2007-11-27 16:16:13 +0100 fixed revision and date handling :100644 100644 6b565e4... b47e9c6... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java commit 52733aa427041cafd760833cb068ffe897fd35db Author: Mark Struberg Date: 2007-11-27 14:05:36 +0100 fixed a GitCommandLineUtil and provice first version of the checkin command. :100644 100644 8ecfe61... b8b008d... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.java :100644 100644 60102fb... c74c06b... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.java :100644 100644 efdade7... 04e9e7d... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/branch/GitBranchCommand.java :100644 100644 061f5a3... 6b565e4... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java :000000 100644 0000000... df19ea1... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java :000000 100644 0000000... e30ad1a... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInConsumer.java :100644 100644 766eafc... 076d9b8... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java :100644 100644 8cf873e... 634c0ea... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/diff/GitDiffCommand.java :100644 100644 94bba3b... e26619a... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveCommand.java :100644 100644 5ddbb49... 7d742df... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusCommand.java commit cef708a0aa71cc72f12eb6755513294f720ad858 Author: Mark Struberg Date: 2007-11-27 21:04:12 +0100 add initial git test repository in src/test/resources/repository :160000 000000 87b491254306a64cebee4be3195fd56542b2b09f 0000000... D maven-scm-provider-gitexe/src/test/resources/repository :000000 100644 0000000... cb089cd... A maven-scm-provider-gitexe/src/test/resources/repository/HEAD :000000 100644 0000000... cb64714... A maven-scm-provider-gitexe/src/test/resources/repository/config :000000 100644 0000000... c6f25e8... A maven-scm-provider-gitexe/src/test/resources/repository/description :000000 100644 0000000... 02de1ef... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/applypatch-msg :000000 100644 0000000... c5cdb9d... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/commit-msg :000000 100644 0000000... 8be6f34... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-commit :000000 100644 0000000... b70c8fd... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-receive :000000 100644 0000000... bcba893... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-update :000000 100644 0000000... eeccc93... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-applypatch :000000 100644 0000000... 18b8730... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-commit :000000 100644 0000000... 981c454... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-rebase :000000 100644 0000000... d8c7626... A maven-scm-provider-gitexe/src/test/resources/repository/hooks/update :000000 100644 0000000... 2c87b72... A maven-scm-provider-gitexe/src/test/resources/repository/info/exclude :000000 100644 0000000... 7e59e55... A maven-scm-provider-gitexe/src/test/resources/repository/logs/HEAD :000000 100644 0000000... 7e59e55... A maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/heads/master :000000 100644 0000000... 6cb21b1... A maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/remotes/origin/master :000000 100644 0000000... 4c7bbd6... A maven-scm-provider-gitexe/src/test/resources/repository/objects/17/e953589369a48dcb0a0cbad084a76ef852cd11 :000000 100644 0000000... 6b6bfad... A maven-scm-provider-gitexe/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816d :000000 100644 0000000... 0a079e7... A maven-scm-provider-gitexe/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7 :000000 100644 0000000... c8859bd... A maven-scm-provider-gitexe/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58 :000000 100644 0000000... bca48ac... A maven-scm-provider-gitexe/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3 :000000 100644 0000000... 26470db... A maven-scm-provider-gitexe/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822 :000000 100644 0000000... 9493985... A maven-scm-provider-gitexe/src/test/resources/repository/objects/92/09a983605d6e43e5cf841a1ea18a1914bb7407 :000000 100644 0000000... ea35629... A maven-scm-provider-gitexe/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7 :000000 100644 0000000... 314330e... A maven-scm-provider-gitexe/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23 :000000 100644 0000000... fe99cd8... A maven-scm-provider-gitexe/src/test/resources/repository/objects/ba/cd4ee105073117b30e5dcdba5150373b6b53c6 :000000 100644 0000000... bb5b1d5... A maven-scm-provider-gitexe/src/test/resources/repository/objects/c3/8b0351660113545db270ba6918cc22a9eb17ce :000000 100644 0000000... ec76cb0... A maven-scm-provider-gitexe/src/test/resources/repository/objects/c5/1dcd33e7b71897603c203b5e0afc1d75f70051 :000000 100644 0000000... b543850... A maven-scm-provider-gitexe/src/test/resources/repository/objects/f7/1429f9ff9214a546b438c611ae942c9cf5a49e :000000 100644 0000000... 1497fff... A maven-scm-provider-gitexe/src/test/resources/repository/objects/fd/39fa3de0f63bc5c78eca219e74e0a8531bd3e6 :000000 100644 0000000... 6c36970... A maven-scm-provider-gitexe/src/test/resources/repository/objects/fe/a16119a5b4ec0562d4f65b4237314250773bf8 :000000 100644 0000000... b1c9092... A maven-scm-provider-gitexe/src/test/resources/repository/refs/heads/master :000000 100644 0000000... 6efe28f... A maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/origin/HEAD :000000 100644 0000000... b1c9092... A maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/origin/master commit 7c14cf0301dbb6d1379c1801a703b2641c22f348 Author: Mark Struberg Date: 2007-11-24 02:51:23 +0100 tck continued until still missing 'checkin' :100644 100644 faba30e... 8ecfe61... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.java :100644 100644 e958caa... 60102fb... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.java :100644 100644 1bfb15c... 0aec2d9... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddConsumer.java :100644 100644 e7898db... 766eafc... M maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java :160000 160000 71cd186fe37302da964626f6428e978d780eda3a 87b491254306a64cebee4be3195fd56542b2b09f M maven-scm-provider-gitexe/src/test/resources/repository :100644 100644 0aa8af3... a7fd9f9... M maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkout/GitCheckOutCommandTckTest.java :100644 100644 b4391bb... db28b51... M maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/status/GitStatusCommandTckTest.java commit e670863b2b03e158c59f34af1fee20f91b2bd852 Author: Mark Struberg Date: 2007-11-22 22:16:03 +0100 initial version :000000 100644 0000000... e848fff... A .gitignore :000000 100644 0000000... c61beb6... A maven-scm-provider-git-commons/pom.xml :000000 100644 0000000... 904d9ae... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/AbstractGitScmProvider.java :000000 100644 0000000... 9173df4... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitChangeSet.java :000000 100644 0000000... 828d9a5... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitCommandUtils.java :000000 100644 0000000... b57d3aa... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/GitConfigFileReader.java :000000 100644 0000000... b25ad9e... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/GitCommand.java :000000 100644 0000000... 33e9b9c... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/diff/GitDiffConsumer.java :000000 100644 0000000... 77f97dc... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/info/GitInfoItem.java :000000 100644 0000000... 372f440... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/info/GitInfoScmResult.java :000000 100644 0000000... 9522dee... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/command/update/GitUpdateScmResult.java :000000 100644 0000000... 655030e... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java :000000 100644 0000000... f1de1cf... A maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/util/GitUtil.java :000000 100644 0000000... b539a92... A maven-scm-provider-git-commons/src/main/mdo/git-settings.mdo :000000 100644 0000000... e904826... A maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/TestGitScmProvider.java :000000 100644 0000000... 0622702... A maven-scm-provider-git-commons/src/test/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepositoryTest.java :000000 160000 0000000... 157b0990d207fe1ded344d5eb86cd076d263e0a4 A maven-scm-provider-git-commons/src/test/resources/META-INF/checkoutdir :000000 100644 0000000... 3e99a4f... A maven-scm-provider-git-commons/src/test/resources/META-INF/plexus/components.xml :000000 100644 0000000... ecf100e... A maven-scm-provider-gitexe/pom.xml :000000 100644 0000000... 625a9c1... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/GitExeScmProvider.java :000000 100644 0000000... 0de70b9... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.java :000000 100644 0000000... faba30e... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.java :000000 100644 0000000... e958caa... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.java :000000 100644 0000000... 1bfb15c... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddConsumer.java :000000 100644 0000000... efdade7... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/branch/GitBranchCommand.java :000000 100644 0000000... 061f5a3... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.java :000000 100644 0000000... c0da783... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumer.java :000000 100644 0000000... e7898db... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java :000000 100644 0000000... 216027c... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutConsumer.java :000000 100644 0000000... 8cf873e... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/diff/GitDiffCommand.java :000000 100644 0000000... 94bba3b... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveCommand.java :000000 100644 0000000... d1d228f... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveConsumer.java :000000 100644 0000000... 5ddbb49... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusCommand.java :000000 100644 0000000... 008ca2b... A maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java :000000 100644 0000000... adb5a96... A maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.java :000000 100644 0000000... f5a5c34... A maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumerTest.java :000000 100644 0000000... 6f77d36... A maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommandTest.java :000000 100644 0000000... 7c96e8d... A maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitExeCheckOutCommandTckTest.java :000000 100644 0000000... d04d644... A maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitExeStatusCommandTckTest.java :000000 160000 0000000... 71cd186fe37302da964626f6428e978d780eda3a A maven-scm-provider-gitexe/src/test/resources/repository :000000 100644 0000000... 169d76c... A maven-scm-provider-gittest/pom.xml :000000 100644 0000000... 093f631... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/GitScmTestUtils.java :000000 100644 0000000... 4262688... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/branch/GitBranchCommandTckTest.java :000000 100644 0000000... aa16003... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkin/GitCheckInCommandTckTest.java :000000 100644 0000000... 0aa8af3... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/checkout/GitCheckOutCommandTckTest.java :000000 100644 0000000... beb9a60... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/diff/GitDiffCommandTckTest.java :000000 100644 0000000... 7f9417b... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/list/GitListCommandTckTest.java :000000 100644 0000000... b4391bb... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/status/GitStatusCommandTckTest.java :000000 100644 0000000... e07e79c... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/tag/GitTagCommandTckTest.java :000000 100644 0000000... 0c4028e... A maven-scm-provider-gittest/src/main/java/org/apache/maven/scm/provider/git/command/update/GitUpdateCommandTckTest.java :000000 160000 0000000... 4ab782deeccf97172acbbaccfe816983c8e72626 A maven-scm-provider-gittest/src/main/resources/repository/test-repo/checkout :000000 100644 0000000... f341932... A pom.xml ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/HEADmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000063110775773021033751 0ustar twernertwerner0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg 1196106917 +0100 c51dcd33e7b71897603c203b5e0afc1d75f70051 baa229a9193371fad604444f64c4f26f8ff702f3 Mark Struberg 1197041894 +0100 push baa229a9193371fad604444f64c4f26f8ff702f3 1d308c3b92eb0df9c0dc76436d50edfd0ca41d18 Mark Struberg 1197042012 +0100 push ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/remotes/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/remotes/origin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/remotes/origin/mastermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000027110775773021033751 0ustar twernertwerner0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg 1196106917 +0100 clone: from /home/msx/tmp/maven-git/repository/.git ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/heads/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/logs/refs/heads/mastermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000063110775773021033751 0ustar twernertwerner0000000000000000000000000000000000000000 c51dcd33e7b71897603c203b5e0afc1d75f70051 Mark Struberg 1196106917 +0100 c51dcd33e7b71897603c203b5e0afc1d75f70051 baa229a9193371fad604444f64c4f26f8ff702f3 Mark Struberg 1197041894 +0100 push baa229a9193371fad604444f64c4f26f8ff702f3 1d308c3b92eb0df9c0dc76436d50edfd0ca41d18 Mark Struberg 1197042012 +0100 push ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/info/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/info/excludemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000036611157544644033760 0ustar twernertwerner# git-ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/configmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000010611157544644033750 0ustar twernertwerner[core] repositoryformatversion = 0 filemode = true bare = true ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/HEADmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000003011157544644033744 0ustar twernertwernerref: refs/heads/master ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/descriptionmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000007311157544644033753 0ustar twernertwernerUnnamed repository; edit this file to name it for gitweb. ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/f7/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/f7/1429f9ff9214a546b438c611ae942c9cf5a49emaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005610775773021033752 0ustar twernertwernerx+)JMU06d01…¬Ä²D†]gý²²Šoæ‹=»+0ÀÜ:;øïw 1././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/dc/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/dc/4204852765c12f398ef4a5fbcabf23cf17a183maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000016410775773021033752 0ustar twernertwernerx+)JMU040f040031Q(ÈÏÕ«ÈÍaHô²¿à,i›þEÔ#tA¦#K²Úf¨’¢ÔÄ”ÜT½’ІyÂ2еyç;íÜ.´TãB²îì3ËM €@¡¸(™ÁÚuþJW©)¤Î b¡&E6¡–“eÄDŽïóÒ¼òx‡·9îUÇž÷¿:}ñ¥÷§¦/@´dŒTJ„¢“_âÔÍŽ[Ó›~‡Ž}íØã¼ÎǶšÁÔ}îî™jPô././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/3b/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/3b/d305c57c635aead10cf59f7c1dc51af03edaf7maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000016410775773021033752 0ustar twernertwernerx+)JMU040f040031Q(ÈÏÕ«ÈÍaHô²¿à,i›þEÔ#tA¦#K²Úf¨’¢ÔÄ”ÜT½’І %—nyÚtå[´“¹¡S@¹õ P(.Jf°v¿ÒUjÊ©³ÍÚn;ùuc.0ù)Ÿ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/3b/459fa9451a94fc1acd10e2e29ab73d93eb816dmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000011310775773021033744 0ustar twernertwernerx+)JMU03b01…ÜÄÌ<†ï"š?ÿOYê¶Åâ˜àº):s¾.™‘.I-.a°ù¾»í`hˆH÷× µÿ&Ï Y^©<T././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/fd/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/fd/39fa3de0f63bc5c78eca219e74e0a8531bd3e6maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000003010775773021033742 0ustar twernertwernerxKÊÉOR°dÐ/ÈÏÕ«ÈÍá+0ý././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/92/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/92/f139dfec4d1dfb79c3cd2f94e83bf13129668bmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000020411157544644033747 0ustar twernertwernerxÍ1Â0 @QæœÂ;²›† !.ÀÄ \Ç¡´AÁ¸=âlyúRç¹Ð@kªàÇä1Hˆ²÷•¡äpÈQ(I Îè5qŽŽW›jƒ ·;\­­£¶_¿:¿yªu—ôÔùH=}[$D'ߥé_Ø•¥Xá”ùY›¹áÚZtÁùÐZÇ‘0$×%(GœÐJää Ïz+Î\ïpÑ:÷RØM?:,|+eeD]KØn}k$D¾I•¿d“ŸY3?àz<ʤPåU¦¬¥.>CCVó''Cë././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/94/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/94/d3d586e355f318d67e3da6bb16a91be7aad1a7maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000003410775773021033746 0ustar twernertwernerxKÊÉOR04bÐ/JMLÉMÕ+©(áA©X././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/61/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/61/a0d22b023d6e31894d736cca8c1a47b6edd822maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005510775773021033751 0ustar twernertwernerxKÊÉOR06dÐ/.JÖÏMÌÌÓÏJ,KÔw,(ÈÉLN,ÉÌÏÓ Æ ³././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/61/4a3fd04313593d67f4154855a06941046326b3maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000002710775773021033750 0ustar twernertwernerxKÊÉOR°`Ð/ÈÏÕ«ÈÍ&)ò././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/1d/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/1d/308c3b92eb0df9c0dc76436d50edfd0ca41d18maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000030710775773021033751 0ustar twernertwernerxŽÁJÅ0D]ç+îþÜ$Mc@DxKq¥?p›ÜÛ†Ú¦¤yÂû{ƒøÎf†9 L,Û–Ze;%‹.:Gëˆ)iŒâ‚ø¨Stš-'¯ª¼7˜ˆŒ t°Ök¡4âÐ%ã1£<‰x4bÝÚR*¼S]á£ÕÛÄu†çó/½Þi)å1ñ h<ÑÃ5¢Š¿ÿk¬h¦¼C\8®ÝÛÂPjžóN_ðÍõÌ¥—6Z;è´Âçõ Ÿí„…Žã®~Ω[Ò././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/3c/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/3c/f7bb86c15554148bf5b0b12bfd639e54a77e58maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005610775773021033752 0ustar twernertwernerx+)JMU06d01…¬Ä²D†Iœ+›b󜟞o‘’[Ø%)²»„ò ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/b5/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/b5/3306f849b69ef0459ddf5cccff06b5fbb08c23maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000004410775773021033747 0ustar twernertwernerxKÊÉOR02aÐ/.JÖ/I-.ÑÏJ,KÔ²ô@,¬… ü././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/9e/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/objects/9e/131cfc732b0d9f42b9b712a528d0632d9bcca7maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005310775773021033747 0ustar twernertwernerxKÊÉOR02gÈK-W(K-*ÎÌÏSÈOSÐ/JMLÉMÕ+©(áÓ ã././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/origin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/origin/HEADmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000004010775773021033743 0ustar twernertwernerref: refs/remotes/origin/master ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/remotes/origin/mastermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005110775773021033745 0ustar twernertwernerc51dcd33e7b71897603c203b5e0afc1d75f70051 ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/heads/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/refs/heads/mastermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000005211157544644033750 0ustar twernertwerner92f139dfec4d1dfb79c3cd2f94e83bf13129668b ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000755000175000017500000000000011345536664033753 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-commit.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000025011157544644033750 0ustar twernertwerner#!/bin/sh # # An example hook script that is called after a successful # commit is made. # # To enable this hook, rename this file to "post-commit". : Nothing ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/update.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000566711157544644033771 0ustar twernertwerner#!/bin/sh # # An example hook script to blocks unannotated tags from entering. # Called by git-receive-pack with arguments: refname sha1-old sha1-new # # To enable this hook, rename this file to "update". # # Config # ------ # hooks.allowunannotated # This boolean sets whether unannotated tags will be allowed into the # repository. By default they won't be. # hooks.allowdeletetag # This boolean sets whether deleting tags will be allowed in the # repository. By default they won't be. # hooks.allowdeletebranch # This boolean sets whether deleting branches will be allowed in the # repository. By default they won't be. # # --- Command line refname="$1" oldrev="$2" newrev="$3" # --- Safety check if [ -z "$GIT_DIR" ]; then echo "Don't run this script from the command line." >&2 echo " (if you want, you could supply GIT_DIR then run" >&2 echo " $0 )" >&2 exit 1 fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then echo "Usage: $0 " >&2 exit 1 fi # --- Config allowunannotated=$(git config --bool hooks.allowunannotated) allowdeletebranch=$(git config --bool hooks.allowdeletebranch) allowdeletetag=$(git config --bool hooks.allowdeletetag) # check for no description projectdesc=$(sed -e '1q' "$GIT_DIR/description") if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb." ]; then echo "*** Project description file hasn't been set" >&2 exit 1 fi # --- Check types # if $newrev is 0000...0000, it's a commit to delete a ref. if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then newrev_type=delete else newrev_type=$(git-cat-file -t $newrev) fi case "$refname","$newrev_type" in refs/tags/*,commit) # un-annotated tag short_refname=${refname##refs/tags/} if [ "$allowunannotated" != "true" ]; then echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 exit 1 fi ;; refs/tags/*,delete) # delete tag if [ "$allowdeletetag" != "true" ]; then echo "*** Deleting a tag is not allowed in this repository" >&2 exit 1 fi ;; refs/tags/*,tag) # annotated tag ;; refs/heads/*,commit) # branch ;; refs/heads/*,delete) # delete branch if [ "$allowdeletebranch" != "true" ]; then echo "*** Deleting a branch is not allowed in this repository" >&2 exit 1 fi ;; refs/remotes/*,commit) # tracking branch ;; refs/remotes/*,delete) # delete tracking branch if [ "$allowdeletebranch" != "true" ]; then echo "*** Deleting a tracking branch is not allowed in this repository" >&2 exit 1 fi ;; *) # Anything else (is there anything else?) echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 exit 1 ;; esac # --- Finished exit 0 ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-commitmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000323710775773021033756 0ustar twernertwerner#!/bin/sh # # An example hook script to verify what is about to be committed. # Called by git-commit with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, make this file executable. # This is slightly modified from Andrew Morton's Perfect Patch. # Lines you introduce should not have trailing whitespace. # Also check for an indentation that has SP before a TAB. if git-rev-parse --verify HEAD 2>/dev/null then git-diff-index -p -M --cached HEAD else # NEEDSWORK: we should produce a diff with an empty tree here # if we want to do the same verification for the initial import. : fi | perl -e ' my $found_bad = 0; my $filename; my $reported_filename = ""; my $lineno; sub bad_line { my ($why, $line) = @_; if (!$found_bad) { print STDERR "*\n"; print STDERR "* You have some suspicious patch lines:\n"; print STDERR "*\n"; $found_bad = 1; } if ($reported_filename ne $filename) { print STDERR "* In $filename\n"; $reported_filename = $filename; } print STDERR "* $why (line $lineno)\n"; print STDERR "$filename:$lineno:$line\n"; } while (<>) { if (m|^diff --git a/(.*) b/\1$|) { $filename = $1; next; } if (/^@@ -\S+ \+(\d+)/) { $lineno = $1 - 1; next; } if (/^ /) { $lineno++; next; } if (s/^\+//) { $lineno++; chomp; if (/\s$/) { bad_line("trailing whitespace", $_); } if (/^\s* /) { bad_line("indent SP followed by a TAB", $_); } if (/^(?:[<>=]){7}/) { bad_line("unresolved merge conflict", $_); } } } exit($found_bad); ' ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-receivemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000077610775773021033763 0ustar twernertwerner#!/bin/sh # # An example hook script for the post-receive event # # This script is run after receive-pack has accepted a pack and the # repository has been updated. It is passed arguments in through stdin # in the form # # For example: # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # # see contrib/hooks/ for an sample, or uncomment the next line (on debian) # #. /usr/share/doc/git-core/contrib/hooks/post-receive-email ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/prepare-commit-msg.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000234711157544644033761 0ustar twernertwerner#!/bin/sh # # An example hook script to prepare the commit log message. # Called by git-commit with the name of the file that has the # commit message, followed by the description of the commit # message's source. The hook's purpose is to edit the commit # message file. If the hook fails with a non-zero status, # the commit is aborted. # # To enable this hook, rename this file to "prepare-commit-msg". # This hook includes three examples. The first comments out the # "Conflicts:" part of a merge commit. # # The second includes the output of "git diff --name-status -r" # into the message, just before the "git status" output. It is # commented because it doesn't cope with --amend or with squashed # commits. # # The third example adds a Signed-off-by line to the message, that can # still be edited. This is rarely a good idea. case "$2,$3" in merge,) perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; # ,|template,) # perl -i.bak -pe ' # print "\n" . `git diff --cached --name-status -r` # if /^#/ && $first++ == 0' "$1" ;; *) ;; esac # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-rebasemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000001024610775773021033754 0ustar twernertwerner#!/bin/sh # # Copyright (c) 2006 Junio C Hamano # publish=next basebranch="$1" if test "$#" = 2 then topic="refs/heads/$2" else topic=`git symbolic-ref HEAD` fi case "$basebranch,$topic" in master,refs/heads/??/*) ;; *) exit 0 ;# we do not interrupt others. ;; esac # Now we are dealing with a topic branch being rebased # on top of master. Is it OK to rebase it? # Is topic fully merged to master? not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." exit 1 ;# we could allow it, but there is no point. fi # Is topic ever merged to next? If so you should not be rebasing it. only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` only_next_2=`git-rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then not_in_topic=`git-rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" exit 1 ;# we could allow it, but there is no point. else exit 0 fi else not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:\n"; my (%not_in_next) = map { /^([0-9a-f]+) /; ($1 => 1); } split(/\n/, $ARGV[1]); for my $elem (map { /^([0-9a-f]+) (.*)$/; [$1 => $2]; } split(/\n/, $ARGV[2])) { if (!exists $not_in_next{$elem->[0]}) { if ($msg) { print STDERR $msg; undef $msg; } print STDERR " $elem->[1]\n"; } } ' "$topic" "$not_in_next" "$not_in_master" exit 1 fi exit 0 ################################################################ This sample hook safeguards topic branches that have been published from being rewound. The workflow assumed here is: * Once a topic branch forks from "master", "master" is never merged into it again (either directly or indirectly). * Once a topic branch is fully cooked and merged into "master", it is deleted. If you need to build on top of it to correct earlier mistakes, a new topic branch is created by forking at the tip of the "master". This is not strictly necessary, but it makes it easier to keep your history simple. * Whenever you need to test or publish your changes to topic branches, merge them into "next" branch. The script, being an example, hardcodes the publish branch name to be "next", but it is trivial to make it configurable via $GIT_DIR/config mechanism. With this workflow, you would want to know: (1) ... if a topic branch has ever been merged to "next". Young topic branches can have stupid mistakes you would rather clean up before publishing, and things that have not been merged into other branches can be easily rebased without affecting other people. But once it is published, you would not want to rewind it. (2) ... if a topic branch has been fully merged to "master". Then you can delete it. More importantly, you should not build on top of it -- other people may already want to change things related to the topic as patches against your "master", so if you need further changes, it is better to fork the topic (perhaps with the same name) afresh from the tip of "master". Let's look at this example: o---o---o---o---o---o---o---o---o---o "next" / / / / / a---a---b A / / / / / / / / c---c---c---c B / / / / \ / / / / b---b C \ / / / / / \ / ---o---o---o---o---o---o---o---o---o---o---o "master" A, B and C are topic branches. * A has one fix since it was merged up to "next". * B has finished. It has been fully merged up to "master" and "next", and is ready to be deleted. * C has not merged to "next" at all. We would want to allow C to be rebased, refuse A, and encourage B to be deleted. To compute (1): git-rev-list ^master ^topic next git-rev-list ^master next if these match, topic has not merged in next at all. To compute (2): git-rev-list master..topic if this is empty, it is fully merged to "master". ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-applypatchmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000060310775773021033750 0ustar twernertwerner#!/bin/sh # # An example hook script to verify what is about to be committed # by applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. # # To enable this hook, make this file executable. . git-sh-setup test -x "$GIT_DIR/hooks/pre-commit" && exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} : ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/commit-msg.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000162611157544644033760 0ustar twernertwerner#!/bin/sh # # An example hook script to check the commit log message. # Called by git-commit with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. # # To enable this hook, rename this file to "commit-msg". # Uncomment the below to add a Signed-off-by line to the message. # Doing this in a hook is a bad idea in general, but the prepare-commit-msg # hook is more suited to it. # # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" # This example catches duplicate Signed-off-by lines. test "" = "$(grep '^Signed-off-by: ' "$1" | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { echo >&2 Duplicate Signed-off-by lines. exit 1 } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-commit.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000103111157544644033746 0ustar twernertwerner#!/bin/sh # # An example hook script to verify what is about to be committed. # Called by git-commit with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, rename this file to "pre-commit". if git-rev-parse --verify HEAD 2>/dev/null then against=HEAD else # Initial commit: diff against an empty tree object against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi exec git diff-index --check --cached $against -- ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/updatemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000370110775773021033752 0ustar twernertwerner#!/bin/sh # # An example hook script to blocks unannotated tags from entering. # Called by git-receive-pack with arguments: refname sha1-old sha1-new # # To enable this hook, make this file executable by "chmod +x update". # # Config # ------ # hooks.allowunannotated # This boolean sets whether unannotated tags will be allowed into the # repository. By default they won't be. # # --- Command line refname="$1" oldrev="$2" newrev="$3" # --- Safety check if [ -z "$GIT_DIR" ]; then echo "Don't run this script from the command line." >&2 echo " (if you want, you could supply GIT_DIR then run" >&2 echo " $0 )" >&2 exit 1 fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then echo "Usage: $0 " >&2 exit 1 fi # --- Config allowunannotated=$(git-repo-config --bool hooks.allowunannotated) # check for no description projectdesc=$(sed -e '1p' "$GIT_DIR/description") if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb" ]; then echo "*** Project description file hasn't been set" >&2 exit 1 fi # --- Check types # if $newrev is 0000...0000, it's a commit to delete a branch if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then newrev_type=commit else newrev_type=$(git-cat-file -t $newrev) fi case "$refname","$newrev_type" in refs/tags/*,commit) # un-annotated tag short_refname=${refname##refs/tags/} if [ "$allowunannotated" != "true" ]; then echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 exit 1 fi ;; refs/tags/*,tag) # annotated tag ;; refs/heads/*,commit) # branch ;; refs/remotes/*,commit) # tracking branch ;; *) # Anything else (is there anything else?) echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 exit 1 ;; esac # --- Finished exit 0 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-receive.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000107011157544644033751 0ustar twernertwerner#!/bin/sh # # An example hook script for the "post-receive" event. # # The "post-receive" script is run after receive-pack has accepted a pack # and the repository has been updated. It is passed arguments in through # stdin in the form # # For example: # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # # see contrib/hooks/ for an sample, or uncomment the next line and # rename the file to "post-receive". #. /usr/share/doc/git-core/contrib/hooks/post-receive-email ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/applypatch-msgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000067110775773021033755 0ustar twernertwerner#!/bin/sh # # An example hook script to check the commit log message taken by # applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. The hook is # allowed to edit the commit message file. # # To enable this hook, make this file executable. . git-sh-setup test -x "$GIT_DIR/hooks/commit-msg" && exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} : ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/commit-msgmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000141410775773021033751 0ustar twernertwerner#!/bin/sh # # An example hook script to check the commit log message. # Called by git-commit with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. # # To enable this hook, make this file executable. # Uncomment the below to add a Signed-off-by line to the message. # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" # This example catches duplicate Signed-off-by lines. test "" = "$(grep '^Signed-off-by: ' "$1" | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { echo >&2 Duplicate Signed-off-by lines. exit 1 } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-update.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000030511157544644033751 0ustar twernertwerner#!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". exec git-update-server-info ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-commitmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000023010775773021033744 0ustar twernertwerner#!/bin/sh # # An example hook script that is called after a successful # commit is made. # # To enable this hook, make this file executable. : Nothing ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-applypatch.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000063411157544644033756 0ustar twernertwerner#!/bin/sh # # An example hook script to verify what is about to be committed # by applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. # # To enable this hook, rename this file to "pre-applypatch". . git-sh-setup test -x "$GIT_DIR/hooks/pre-commit" && exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} : ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/pre-rebase.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000001176711157544644033767 0ustar twernertwerner#!/bin/sh # # Copyright (c) 2006, 2008 Junio C Hamano # # The "pre-rebase" hook is run just before "git-rebase" starts doing # its job, and can prevent the command from running by exiting with # non-zero status. # # The hook is called with the following parameters: # # $1 -- the upstream the series was forked from. # $2 -- the branch being rebased (or empty when rebasing the current branch). # # This sample shows how to prevent topic branches that are already # merged to 'next' branch from getting rebased, because allowing it # would result in rebasing already published history. publish=next basebranch="$1" if test "$#" = 2 then topic="refs/heads/$2" else topic=`git symbolic-ref HEAD` || exit 0 ;# we do not interrupt rebasing detached HEAD fi case "$topic" in refs/heads/??/*) ;; *) exit 0 ;# we do not interrupt others. ;; esac # Now we are dealing with a topic branch being rebased # on top of master. Is it OK to rebase it? # Does the topic really exist? git show-ref -q "$topic" || { echo >&2 "No such branch $topic" exit 1 } # Is topic fully merged to master? not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." exit 1 ;# we could allow it, but there is no point. fi # Is topic ever merged to next? If so you should not be rebasing it. only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` only_next_2=`git-rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then not_in_topic=`git-rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" exit 1 ;# we could allow it, but there is no point. else exit 0 fi else not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:\n"; my (%not_in_next) = map { /^([0-9a-f]+) /; ($1 => 1); } split(/\n/, $ARGV[1]); for my $elem (map { /^([0-9a-f]+) (.*)$/; [$1 => $2]; } split(/\n/, $ARGV[2])) { if (!exists $not_in_next{$elem->[0]}) { if ($msg) { print STDERR $msg; undef $msg; } print STDERR " $elem->[1]\n"; } } ' "$topic" "$not_in_next" "$not_in_master" exit 1 fi exit 0 ################################################################ This sample hook safeguards topic branches that have been published from being rewound. The workflow assumed here is: * Once a topic branch forks from "master", "master" is never merged into it again (either directly or indirectly). * Once a topic branch is fully cooked and merged into "master", it is deleted. If you need to build on top of it to correct earlier mistakes, a new topic branch is created by forking at the tip of the "master". This is not strictly necessary, but it makes it easier to keep your history simple. * Whenever you need to test or publish your changes to topic branches, merge them into "next" branch. The script, being an example, hardcodes the publish branch name to be "next", but it is trivial to make it configurable via $GIT_DIR/config mechanism. With this workflow, you would want to know: (1) ... if a topic branch has ever been merged to "next". Young topic branches can have stupid mistakes you would rather clean up before publishing, and things that have not been merged into other branches can be easily rebased without affecting other people. But once it is published, you would not want to rewind it. (2) ... if a topic branch has been fully merged to "master". Then you can delete it. More importantly, you should not build on top of it -- other people may already want to change things related to the topic as patches against your "master", so if you need further changes, it is better to fork the topic (perhaps with the same name) afresh from the tip of "master". Let's look at this example: o---o---o---o---o---o---o---o---o---o "next" / / / / / a---a---b A / / / / / / / / c---c---c---c B / / / / \ / / / / b---b C \ / / / / / \ / ---o---o---o---o---o---o---o---o---o---o---o "master" A, B and C are topic branches. * A has one fix since it was merged up to "next". * B has finished. It has been fully merged up to "master" and "next", and is ready to be deleted. * C has not merged to "next" at all. We would want to allow C to be rebased, refuse A, and encourage B to be deleted. To compute (1): git-rev-list ^master ^topic next git-rev-list ^master next if these match, topic has not merged in next at all. To compute (2): git-rev-list master..topic if this is empty, it is fully merged to "master". ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/applypatch-msg.samplemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000072311157544644033755 0ustar twernertwerner#!/bin/sh # # An example hook script to check the commit log message taken by # applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. The hook is # allowed to edit the commit message file. # # To enable this hook, rename this file to "applypatch-msg". . git-sh-setup test -x "$GIT_DIR/hooks/commit-msg" && exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} : ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resources/repository/hooks/post-updatemaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/resourc0000644000175000017500000000031710775773021033752 0ustar twernertwerner#!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, make this file executable by "chmod +x post-update". exec git-update-server-info maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/0000755000175000017500000000000011345536663033270 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/branch/GitExeBranchCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000246211263356573033636 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.branch; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.branch.GitBranchCommandTckTest; /** * @author Mark Struberg */ public class GitExeBranchCommandTckTest extends GitBranchCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536663033631 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000645611263356573033645 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg * @version $Id: GitUpdateCommandTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitUpdateCommandTest extends ScmTestCase { public void testCommandLineNoBranch() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, "git pull http://foo.com/git master" ); } public void testCommandLineWithBranch() throws Exception { testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "mybranch" ), "git pull http://foo.com/git mybranch" ); } public void testCommandLineLatestRevision() throws Exception { testLatestRevisionCommandLine( "scm:git:http://foo.com/git", null, "git log -n1 --date-order master" ); } // ---------------------------------------------------------------------- // private helper functions // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, ScmVersion branch, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/git-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitUpdateCommand.createCommandLine( gitRepository, workingDirectory, branch ); assertCommandLine( commandLine, workingDirectory, cl ); } private void testLatestRevisionCommandLine( String scmUrl, ScmBranch branch, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/git-update-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitUpdateCommand.createLatestRevisionCommandLine( gitRepository, workingDirectory, branch ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000030400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitLatestRevisionCommandConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000477411160266402033631 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; import java.io.BufferedReader; import java.io.File; import java.io.Reader; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.ReaderFactory; /* * 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. */ /** * @author Mark Struberg * @since 1.2 * @version $Id: GitLatestRevisionCommandConsumerTest.java 755751 2009-03-18 21:52:02Z olamy $ */ public class GitLatestRevisionCommandConsumerTest extends PlexusTestCase { public void testUpToDate() throws Exception { GitLatestRevisionCommandConsumer consumer = buildGitLatestRevisionCommandConsumer( "/src/test/resources/git/update/git-update-latest-rev.out" ); String latestRev = consumer.getLatestRevision(); assertNotNull( latestRev ); assertEquals( "a300c56a341bae8d0eb5ec4ed5551a11c75a5a6e", latestRev ); } // utils methods private GitLatestRevisionCommandConsumer buildGitLatestRevisionCommandConsumer( String fileName ) throws Exception { GitLatestRevisionCommandConsumer consumer = new GitLatestRevisionCommandConsumer( new DefaultLog() ); BufferedReader r = getGitLogBufferedReader( fileName ); String line; while ( ( line = r.readLine() ) != null ) { //System.out.println(" line " + line ); consumer.consumeLine( line ); } return consumer; } private BufferedReader getGitLogBufferedReader( String fileName ) throws Exception { File f = getTestFile( fileName ); Reader reader = ReaderFactory.newReader( f, "UTF-8" ); return new BufferedReader( reader ); } } ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitExeUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000264111263356573033635 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.update.GitUpdateCommandTckTest; /** * @author Mark Struberg * @version $Id: GitExeUpdateCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitExeUpdateCommandTckTest extends GitUpdateCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000001122511160266402033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; import java.io.BufferedReader; import java.io.File; import java.io.Reader; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.ReaderFactory; /* * 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. */ /** * @author olamy * @since 10 août 2008 * @version $Id: GitUpdateCommandConsumerTest.java 755751 2009-03-18 21:52:02Z olamy $ */ public class GitUpdateCommandConsumerTest extends PlexusTestCase { public void testUpToDate() throws Exception { GitUpdateCommandConsumer consumer = buildGitUpdateCommandConsumer( "/src/test/resources/git/update/git-update-up-to-date.out" ); List changedFiles = consumer.getUpdatedFiles(); assertEquals( 0, changedFiles.size() ); } public void testTwoModified() throws Exception { GitUpdateCommandConsumer consumer = buildGitUpdateCommandConsumer( "/src/test/resources/git/update/git-update.out" ); List changedFiles = consumer.getUpdatedFiles(); assertEquals( 2, changedFiles.size() ); assertScmFile( (ScmFile) changedFiles.get( 0 ), "README", ScmFileStatus.UPDATED ); assertScmFile( (ScmFile) changedFiles.get( 1 ), "pom.xml", ScmFileStatus.UPDATED ); } public void testAddDeleteFile() throws Exception { GitUpdateCommandConsumer consumer = buildGitUpdateCommandConsumer( "/src/test/resources/git/update/git-update-add-delete.out" ); List changedFiles = consumer.getUpdatedFiles(); assertEquals( 3, changedFiles.size() ); assertScmFile( (ScmFile) changedFiles.get( 0 ), "README", ScmFileStatus.DELETED ); assertScmFile( (ScmFile) changedFiles.get( 1 ), "pom.xml", ScmFileStatus.UPDATED ); assertScmFile( (ScmFile) changedFiles.get( 2 ), "test.txt", ScmFileStatus.ADDED ); } public void testOneUpdate() throws Exception { assertOneUpdate( "/src/test/resources/git/update/git-update-one.out" ); } public void testOneUpdateOtherFormat() throws Exception { assertOneUpdate( "/src/test/resources/git/update/git-update-one-other-format.out" ); } // ---------------------------------------------------------------------- // private helper functions // ---------------------------------------------------------------------- private void assertOneUpdate( String fileName ) throws Exception { GitUpdateCommandConsumer consumer = buildGitUpdateCommandConsumer( fileName ); List changedFiles = consumer.getUpdatedFiles(); assertEquals( 1, changedFiles.size() ); assertScmFile( (ScmFile) changedFiles.get( 0 ), "pom.xml", ScmFileStatus.UPDATED ); } private GitUpdateCommandConsumer buildGitUpdateCommandConsumer( String fileName ) throws Exception { GitUpdateCommandConsumer consumer = new GitUpdateCommandConsumer( new DefaultLog(), null ); BufferedReader r = getGitLogBufferedReader( fileName ); String line; while ( ( line = r.readLine() ) != null ) { //System.out.println(" line " + line ); consumer.consumeLine( line ); } return consumer; } private BufferedReader getGitLogBufferedReader( String fileName ) throws Exception { File f = getTestFile( fileName ); Reader reader = ReaderFactory.newReader( f, "UTF-8" ); return new BufferedReader( reader ); } private void assertScmFile( ScmFile file, String fileName, ScmFileStatus status ) { assertEquals( fileName, file.getPath() ); assertEquals( status, file.getStatus() ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000545311015073323033621 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: GitCheckOutCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class GitCheckOutCommandTest extends ScmTestCase { private File workingDirectory; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void setUp() throws Exception { super.setUp(); workingDirectory = getTestFile( "target/git-checkout-command-test" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void testCommandLineWithBranch() throws Exception { testCommandLine( getScmManager(), "scm:git:http://foo.com/git", "mybranch", "git checkout mybranch" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( ScmManager scmManager, String scmUrl, String revision, String commandLine ) throws Exception { ScmRepository repository = scmManager.makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitCheckOutCommand.createCommandLine( gitRepository, workingDirectory, new ScmRevision( revision ) ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000027600000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitExeCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000227310775773021033634 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.git.command.checkout.GitCheckOutCommandTckTest; /** * @author Emmanuel Venisse * @version $Id: GitExeCheckOutCommandTckTest.java 645182 2008-04-05 21:58:41Z jvanzyl $ */ public class GitExeCheckOutCommandTckTest extends GitCheckOutCommandTckTest { } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000001124611010222205033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.PlexusTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.List; /** * @author Mark Struberg */ public class GitStatusConsumerTest extends PlexusTestCase { public void testConsumerAddedFile() { GitStatusConsumer consumer = new GitStatusConsumer( new DefaultLog(), null ); consumer.consumeLine( "# new file: project.xml" ); List changedFiles = consumer.getChangedFiles(); assertNotNull( changedFiles ); assertEquals( 1, changedFiles.size() ); } public void testLog1Consumer() throws Exception { GitStatusConsumer consumer = new GitStatusConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/status/gitstatus1.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 2, changedFiles.size() ); testScmFile( (ScmFile) changedFiles.get( 0 ), "project.xml", ScmFileStatus.ADDED ); testScmFile( (ScmFile) changedFiles.get( 1 ), "readme.txt" , ScmFileStatus.MODIFIED ); } public void testEmptyLogConsumer() throws Exception { GitStatusConsumer consumer = new GitStatusConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/status/gitstatus-empty.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 0, changedFiles.size() ); } public void testLog2Consumer() throws Exception { GitStatusConsumer consumer = new GitStatusConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/status/gitstatus2.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getChangedFiles(); assertEquals( 4, changedFiles.size() ); testScmFile( (ScmFile) changedFiles.get( 0 ) , "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.java" , ScmFileStatus.MODIFIED ); testScmFile( (ScmFile) changedFiles.get( 1 ) , "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.java" , ScmFileStatus.MODIFIED ); testScmFile( (ScmFile) changedFiles.get( 2 ) , "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInConsumer.java" , ScmFileStatus.DELETED ); testScmFile( (ScmFile) changedFiles.get( 3 ) , "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java" , ScmFileStatus.MODIFIED ); } private void testScmFile( ScmFile fileToTest, String expectedFilePath, ScmFileStatus expectedStatus ) { assertEquals( expectedFilePath, fileToTest.getPath() ); assertEquals( expectedStatus, fileToTest.getStatus() ); } } ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitExeStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000263711263356573033642 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.status; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.status.GitStatusCommandTckTest; /** * @author Brett Porter * @version $Id: GitExeStatusCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitExeStatusCommandTckTest extends GitStatusCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000636411010222205033611 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveConsumer; import org.codehaus.plexus.PlexusTestCase; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.List; /** * @author Mark Struberg */ public class GitRemoveConsumerTest extends PlexusTestCase { public void testConsumerRemovedFile() { GitRemoveConsumer consumer = new GitRemoveConsumer( new DefaultLog() ); consumer.consumeLine( "rm 'project.xml'" ); List changedFiles = consumer.getRemovedFiles(); assertNotNull( changedFiles ); assertEquals( 1, changedFiles.size() ); } public void testLog1Consumer() throws Exception { GitRemoveConsumer consumer = new GitRemoveConsumer( new DefaultLog() ); File f = getTestFile( "/src/test/resources/git/remove/gitrm.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getRemovedFiles(); assertEquals( 2, changedFiles.size() ); testScmFile( (ScmFile) changedFiles.get( 0 ), "src/main/java/Application.java", ScmFileStatus.DELETED ); testScmFile( (ScmFile) changedFiles.get( 1 ), "src/test/java/Test.java" , ScmFileStatus.DELETED ); } public void testEmptyLogConsumer() throws Exception { GitRemoveConsumer consumer = new GitRemoveConsumer( new DefaultLog() ); File f = getTestFile( "/src/test/resources/git/remove/gitrm-empty.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List changedFiles = consumer.getRemovedFiles(); assertEquals( 0, changedFiles.size() ); } private void testScmFile( ScmFile fileToTest, String expectedFilePath, ScmFileStatus expectedStatus ) { assertEquals( expectedFilePath, fileToTest.getPath() ); assertEquals( expectedStatus, fileToTest.getStatus() ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/tag/GitTagCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000541411015073323033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.tag; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg */ public class GitTagCommandTest extends ScmTestCase { private File messageFile; private String messageFileString; public void setUp() throws Exception { super.setUp(); messageFile = new File( "commit-message" ); String path = messageFile.getAbsolutePath(); if ( path.indexOf( ' ' ) >= 0 ) { path = "\"" + path + "\""; } messageFileString = "-F " + path; } public void testCommandLineTag() throws Exception { testCommandLine( "scm:git:http://foo.com/git/trunk", "my-tag-1", "git tag " + messageFileString + " my-tag-1" ); } public void testCommandLineWithUsernameAndTag() throws Exception { testCommandLine( "scm:git:http://anonymous@foo.com/git/trunk", "my-tag-1", "git tag " + messageFileString + " my-tag-1" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String tag, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/git-checkin-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitTagCommand.createCommandLine( gitRepository, workingDirectory, tag, messageFile ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/tag/GitExeTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000266411263356573033642 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.tag; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.tag.GitTagCommandTckTest; /** * This test tests the tag command. * * @author Brett Porter * @version $Id: GitExeTagCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitExeTagCommandTckTest extends GitTagCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitExeCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000264511263356573033641 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.checkin.GitCheckInCommandTckTest; /** * @author Brett Porter * @version $Id: GitExeCheckInCommandTckTest.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitExeCheckInCommandTckTest extends GitCheckInCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000662111047415053033624 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.util.GitUtil; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Trygve Laugstøl */ public class GitCheckInCommandTest extends ScmTestCase { private File messageFile; private String messageFileString; public void setUp() throws Exception { super.setUp(); messageFile = new File( "commit-message" ); String path = messageFile.getAbsolutePath(); if ( path.indexOf( ' ' ) >= 0 ) { path = "\"" + path + "\""; } messageFileString = "-F " + path; } public void testCommandLineWithoutTag() throws Exception { if ( GitUtil.getSettings().isCommitNoVerify() ) { testCommandLine( "scm:git:http://foo.com/git/trunk", "git commit --verbose " + messageFileString + " -a" + " --no-verify" ); } else { testCommandLine( "scm:git:http://foo.com/git/trunk", "git commit --verbose " + messageFileString + " -a" ); } } public void testCommandLineWithUsername() throws Exception { if ( GitUtil.getSettings().isCommitNoVerify() ) { testCommandLine( "scm:git:http://anonymous@foo.com/git/trunk", "git commit --verbose " + messageFileString + " -a" + " --no-verify" ); } else { testCommandLine( "scm:git:http://anonymous@foo.com/git/trunk", "git commit --verbose " + messageFileString + " -a" ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/git-checkin-command-test" ); ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitCheckInCommand.createCommitCommandLine( gitRepository, new ScmFileSet( workingDirectory ), messageFile ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/diff/GitExeDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000247711263356573033644 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.diff; /* * 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. */ import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.diff.GitDiffCommandTckTest; /** * @author Mark Struberg */ public class GitExeDiffCommandTckTest extends GitDiffCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitExeChangeLogCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000250311263356573033632 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.changelog; import org.apache.maven.scm.provider.git.GitScmTestUtils; import org.apache.maven.scm.provider.git.command.changelog.GitChangeLogCommandTckTest; /* * 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. */ /** * @author Mark Struberg */ public class GitExeChangeLogCommandTckTest extends GitChangeLogCommandTckTest { /** {@inheritDoc} */ public String getScmUrl() throws Exception { return GitScmTestUtils.getScmUrl( getRepositoryRoot(), "git" ); } } ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000002021611176152472033626 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Calendar; import java.util.Date; /** * @author Emmanuel Venisse * @version $Id: GitChangeLogCommandTest.java 769975 2009-04-29 22:31:22Z olamy $ */ public class GitChangeLogCommandTest extends ScmTestCase { private File workingDirectory; public void setUp() throws Exception { super.setUp(); workingDirectory = getTestFile( "target/git-update-command-test" ); } public void testCommandLineNoDates() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, (Date) null, (Date) null, "git whatchanged --date=iso" + " -- " + workingDirectory ); } public void testCommandLineWithDates() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, GMT_TIME_ZONE ); Date endDate = getDate( 2007, Calendar.OCTOBER, 10, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, "git whatchanged \"--since=2003-09-10 00:00:00 +0000\" \"--until=2007-10-10 00:00:00 +0000\" --date=iso" + " -- " + workingDirectory ); } public void testCommandLineStartDateOnly() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, null, "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" --date=iso" + " -- " + workingDirectory ); } public void testCommandLineDateFormat() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso" + " -- " + workingDirectory ); } public void testCommandLineDateVersionRanges() throws Exception { Date startDate = getDate( 2003, Calendar.SEPTEMBER, 10, 1, 1, 1, GMT_TIME_ZONE ); Date endDate = getDate( 2005, Calendar.NOVEMBER, 13, 23, 23, 23, GMT_TIME_ZONE ); testCommandLine( "scm:git:http://foo.com/git", null, startDate, endDate, new ScmRevision( "1" ), new ScmRevision( "10" ), "git whatchanged \"--since=2003-09-10 01:01:01 +0000\" \"--until=2005-11-13 23:23:23 +0000\" --date=iso 1..10" + " -- " + workingDirectory ); } public void testCommandLineEndDateOnly() throws Exception { Date endDate = getDate( 2003, Calendar.NOVEMBER, 10, GMT_TIME_ZONE ); // Only specifying end date should print no dates at all testCommandLine( "scm:git:http://foo.com/git", null, null, endDate, "git whatchanged \"--until=2003-11-10 00:00:00 +0000\" --date=iso" + " -- " + workingDirectory ); } public void testCommandLineWithBranchNoDates() throws Exception { testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), (Date) null, (Date) null, "git whatchanged --date=iso my-test-branch" + " -- " + workingDirectory ); } public void testCommandLineWithStartVersion() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), null, "git whatchanged --date=iso 1.." + " -- " + workingDirectory ); } public void testCommandLineWithStartVersionAndEndVersion() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "10" ), "git whatchanged --date=iso 1..10" + " -- " + workingDirectory ); } public void testCommandLineWithStartVersionAndEndVersionEquals() throws Exception { testCommandLine( "scm:git:http://foo.com/git", null, new ScmRevision( "1" ), new ScmRevision( "1" ), "git whatchanged --date=iso 1..1" + " -- " + workingDirectory ); } public void testCommandLineWithStartVersionAndEndVersionAndBranch() throws Exception { testCommandLine( "scm:git:http://foo.com/git", new ScmBranch( "my-test-branch" ), new ScmRevision( "1" ), new ScmRevision( "10" ), "git whatchanged --date=iso 1..10 my-test-branch" + " -- " + workingDirectory ); } // ---------------------------------------------------------------------- // private helper functions // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, ScmBranch branch, Date startDate, Date endDate, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitChangeLogCommand.createCommandLine( gitRepository, workingDirectory, branch, startDate, endDate, null, null ); assertCommandLine( commandLine, workingDirectory, cl ); } private void testCommandLine( String scmUrl, ScmBranch branch, ScmVersion startVersion, ScmVersion endVersion, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitChangeLogCommand.createCommandLine( gitRepository, workingDirectory, branch, null, null, startVersion, endVersion ); assertCommandLine( commandLine, workingDirectory, cl ); } private void testCommandLine( String scmUrl, ScmBranch branch, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion, String commandLine ) throws Exception { ScmRepository repository = getScmManager().makeScmRepository( scmUrl ); GitScmProviderRepository gitRepository = (GitScmProviderRepository) repository.getProviderRepository(); Commandline cl = GitChangeLogCommand.createCommandLine( gitRepository, workingDirectory, branch, startDate, endDate, startVersion, endVersion ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000027300000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000001276311047412776033641 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.changelog; /* * 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. */ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.text.SimpleDateFormat; import java.util.Iterator; import java.util.List; import java.util.TimeZone; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.DefaultLog; import org.apache.regexp.RE; import org.codehaus.plexus.PlexusTestCase; /** * @author Mark Struberg */ public class GitChangeLogConsumerTest extends PlexusTestCase { public void testConsumer1() throws Exception { //was Date: Tue Nov 27 16:16:28 2007 +0100 //iso Date: 2007-11-24 01:13:10 +0100 RE dateRegexp = new RE( "^Date:\\s*(.*)" );//new RE( "^Date:\\s*\\w-1\\w-1\\w-1\\s(.*)" ); boolean match = dateRegexp.match( "Date: 2007-11-24 01:13:10 +0100" ); String datestring = dateRegexp.getParen( 1 ); assertEquals("2007-11-24 01:13:10 +0100", datestring); assertTrue( match ); GitChangeLogConsumer consumer = new GitChangeLogConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/changelog/gitwhatchanged.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List modifications = consumer.getModifications(); assertEquals( 6, modifications.size() ); for ( Iterator i = modifications.iterator(); i.hasNext(); ) { ChangeSet entry = (ChangeSet) i.next(); assertEquals( "Mark Struberg ", entry.getAuthor() ); assertNotNull( entry.getDate() ); assertTrue( entry.getComment() != null && entry.getComment().length() > 0 ); assertNotNull( entry.getFiles() ); assertFalse( entry.getFiles().isEmpty() ); } ChangeSet entry = (ChangeSet) modifications.get( 3 ); assertEquals( "Mark Struberg ", entry.getAuthor() ); assertNotNull( entry.getDate() ); SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss Z" ); sdf.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); assertEquals( "2007-11-24 00:10:42 +0000", sdf.format( entry.getDate() ) ); assertEquals( "/ added", entry.getComment() ); assertNotNull( entry.getFiles() ); ChangeFile cf = (ChangeFile) entry.getFiles().get( 0 ); assertEquals( "readme.txt", cf.getName() ); assertTrue( cf.getRevision() != null && cf.getRevision().length() > 0 ); } public void testConsumer2() throws Exception { GitChangeLogConsumer consumer = new GitChangeLogConsumer( new DefaultLog(), null ); File f = getTestFile( "/src/test/resources/git/changelog/gitwhatchanged2.gitlog" ); BufferedReader r = new BufferedReader( new FileReader( f ) ); String line; while ( ( line = r.readLine() ) != null ) { consumer.consumeLine( line ); } List modifications = consumer.getModifications(); for ( Iterator i = modifications.iterator(); i.hasNext(); ) { ChangeSet entry = (ChangeSet) i.next(); assertEquals( "Mark Struberg ", entry.getAuthor() ); assertNotNull( entry.getDate() ); assertTrue( entry.getComment() != null && entry.getComment().length() > 0 ); assertNotNull( entry.getFiles() ); assertFalse( entry.getFiles().isEmpty() ); } assertEquals( 8, modifications.size() ); ChangeSet entry = (ChangeSet) modifications.get( 4 ); assertEquals( "Mark Struberg ", entry.getAuthor() ); assertNotNull( entry.getDate() ); SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss Z" ); sdf.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); assertEquals( "2007-11-27 13:05:36 +0000", sdf.format( entry.getDate() ) ); assertEquals( "fixed a GitCommandLineUtil and provice first version of the checkin command.", entry .getComment() ); assertNotNull( entry.getFiles() ); assertEquals( 10, entry.getFiles().size() ); ChangeFile cf = (ChangeFile) entry.getFiles().get( 0 ); assertEquals( "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.java", cf.getName() ); assertTrue( cf.getRevision() != null && cf.getRevision().length() > 0 ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000755000175000017500000000000011345536664033632 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitExeAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/or0000644000175000017500000000504611176146712033632 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.add; import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; /* * 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. */ /** * Check if the {@code GitAddCommand#createCommandLine(File, List)} returns the correct * command line execution string. * @author Mark Struberg * @version $Id: GitExeAddCommandTest.java 769959 2009-04-29 21:59:38Z olamy $ */ public class GitExeAddCommandTest extends ScmTestCase { public void testAddCommandSingleFile() throws Exception { List/*File*/ files = new ArrayList(); files.add( new File( "myFile.java" ) ); testCommandLine( "scm:git:http://foo.com/git", files, "git add -- myFile.java" ); } public void testAddCommandMultipleFiles() throws Exception { List/*File*/ files = new ArrayList(); files.add( new File( "myFile.java" ) ); files.add( new File( "myFile2.java" ) ); files.add( new File( "myFile3.java" ) ); testCommandLine( "scm:git:http://foo.com/git", files, "git add -- myFile.java myFile2.java myFile3.java" ); } // ---------------------------------------------------------------------- // private helper functions // ---------------------------------------------------------------------- private void testCommandLine( String scmUrl, List files, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/git-add-command-test" ); Commandline cl = GitAddCommand.createCommandLine(workingDirectory, files ); assertCommandLine( commandLine, workingDirectory, cl ); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/0000755000175000017500000000000011345536664032315 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/0000755000175000017500000000000011345536664033236 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/branch/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/branch/GitCurrentBranchConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000401711263356573033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.branch; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; /** * This logger parses the output of git symbolic-ref HEAD * to determine the current branch. * @author Mark Struberg * @version $Id: GitCurrentBranchConsumer.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitCurrentBranchConsumer extends AbstractConsumer { private final static String BRANCH_INDICATOR = "refs/heads/"; private String branch; /** * Default constructor. */ public GitCurrentBranchConsumer( ScmLogger logger ) { super( logger ); } public String getBranchName() { return branch; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { line = line.trim(); if ( line.startsWith( BRANCH_INDICATOR ) ) { branch = line.substring( BRANCH_INDICATOR.length() ); } } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/branch/GitBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001374511263356573033611 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.branch; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.branch.AbstractBranchCommand; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListCommand; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListConsumer; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg * @version $Id: GitBranchCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitBranchCommand extends AbstractBranchCommand implements GitCommand { /** {@inheritDoc} */ public ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet, String branch, String message ) throws ScmException { if ( branch == null || StringUtils.isEmpty( branch.trim() ) ) { throw new ScmException( "branch name must be specified" ); } if ( !fileSet.getFileList().isEmpty() ) { throw new ScmException( "This provider doesn't support branching subsets of a directory" ); } GitScmProviderRepository repository = (GitScmProviderRepository) repo; Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new BranchScmResult( cl.toString(), "The git-branch command failed.", stderr.getOutput(), false ); } // and now push the branch to the origin repository Commandline clPush = createPushCommandLine( repository, fileSet, branch ); exitCode = GitCommandLineUtils.execute( clPush, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new BranchScmResult( clPush.toString(), "The git-push command failed.", stderr.getOutput(), false ); } // as last action we search for the branched files GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.TAGGED ); Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new BranchScmResult( clList.toString(), "The git-ls-files command failed.", stderr.getOutput(), false ); } return new BranchScmResult( cl.toString(), listConsumer.getListedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, String branch ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "branch" ); cl.createArg().setValue( branch ); return cl; } public static Commandline createPushCommandLine( GitScmProviderRepository repository, ScmFileSet fileSet, String branch ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "push" ); cl.createArg().setValue( repository.getPushUrl() ); cl.createArg().setValue( branch ); return cl; } /** * Helper function to detect the current branch */ public static String getCurrentBranch( ScmLogger logger, GitScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "symbolic-ref" ); cl.createArg().setValue( "HEAD" ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); GitCurrentBranchConsumer cbConsumer = new GitCurrentBranchConsumer( logger ); int exitCode; exitCode = GitCommandLineUtils.execute( cl, cbConsumer, stderr, logger ); if ( exitCode != 0 ) { throw new ScmException( "Detecting the current branch failed: " + stderr.getOutput() ); } return cbConsumer.getBranchName(); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001464311263356573033607 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.changelog.GitChangeLogCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author olamy * @since 10 august 2008 * @version $Id: GitUpdateCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitUpdateCommand extends AbstractUpdateCommand implements GitCommand { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion scmVersion ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() ) && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 ) { throw new ScmException( "remote repository must not be the working directory" ); } int exitCode; GitUpdateCommandConsumer consumer = new GitUpdateCommandConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); Commandline cl = createCommandLine( repository, fileSet.getBasedir(), scmVersion ); exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "failed to update git, return code " + exitCode ); } return new UpdateScmResult( cl.toString(), "The git-pull origin master command failed.", stderr.getOutput(), false ); } // now let's get the latest version Commandline clRev = createLatestRevisionCommandLine( repository, fileSet.getBasedir(), scmVersion ); GitLatestRevisionCommandConsumer consumerRev = new GitLatestRevisionCommandConsumer( getLogger() ); exitCode = GitCommandLineUtils.execute( clRev, consumerRev, stderr, getLogger() ); if ( exitCode != 0 ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "failed to update git, return code " + exitCode ); } return new UpdateScmResult( cl.toString(), "The git-log command failed.", stderr.getOutput(), false ); } String latestRevision = consumerRev.getLatestRevision(); return new UpdateScmResultWithRevision( cl.toString(), consumer.getUpdatedFiles(), latestRevision ); } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { GitChangeLogCommand changelogCmd = new GitChangeLogCommand(); changelogCmd.setLogger( getLogger() ); return changelogCmd; } /** * create the command line for updating the current branch with the info from the foreign repository. */ public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, ScmVersion scmVersion ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "pull" ); cl.createArg().setLine( repository.getFetchUrl() ); // now set the branch where we would like to pull from if ( scmVersion instanceof ScmBranch ) { cl.createArg().setLine( scmVersion.getName() ); } else { cl.createArg().setLine( "master" ); } return cl; } /** * @param scmVersion a valid branch or null if the master branch should be taken * @return CommandLine for getting the latest commit on the given branch */ public static Commandline createLatestRevisionCommandLine(GitScmProviderRepository repository, File workingDirectory, ScmVersion scmVersion) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "log" ); // only show exactly 1 commit cl.createArg().setValue( "-n1" ); // same as --topo-order, but ensure ordering of merges cl.createArg().setValue( "--date-order" ); if ( scmVersion != null && scmVersion instanceof ScmBranch && scmVersion.getName() != null && scmVersion.getName().length() > 0 ) { // if any branch is given, lets take em cl.createArg().setValue( scmVersion.getName() ); } else { // otherwise we work on the master branch cl.createArg().setValue( "master" ); } return cl; } } ././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitLatestRevisionCommandConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000564611160266402033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.StringUtils; /** * @author Mark Struberg * @version $Id: GitLatestRevisionCommandConsumer.java 755751 2009-03-18 21:52:02Z olamy $ */ public class GitLatestRevisionCommandConsumer extends AbstractConsumer { /** * The pattern used to match git log latest revision lines */ private static final String LATESTREV_PATTERN = "^commit \\s*(.*)"; /** * The regular expression used to match git log latest revision lines */ private RE latestRevRegexp; private String latestRevision; public GitLatestRevisionCommandConsumer( ScmLogger logger ) { super( logger ); try { latestRevRegexp = new RE( LATESTREV_PATTERN ); } catch ( RESyntaxException ex ) { throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse git log file. This shouldn't happen. Something is probably wrong with the oro installation.", ex ); } } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "GitLatestRevisionCommandConsumer consumeLine : " + line ); } if ( line == null || StringUtils.isEmpty( line ) ) { return; } processGetLatestRevision( line ); } public String getLatestRevision() { return latestRevision; } /** * Process the current input line for the latest revision * * @param line A line of text from the git log output */ private void processGetLatestRevision( String line ) { if ( !latestRevRegexp.match( line ) ) { return; } latestRevision = latestRevRegexp.getParen( 1 ); } } ././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001125011057610744033570 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.update; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.StringUtils; /** * @author olamy * @version $Id: GitUpdateCommandConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class GitUpdateCommandConsumer extends AbstractConsumer { private boolean updatingFound; private boolean summaryFound; private Map scmFiles = new LinkedHashMap(); public GitUpdateCommandConsumer( ScmLogger logger, File workingDirectory ) { super( logger ); } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "GitUpdateCommandConsumer consumeLine : " + line ); } if ( line == null || StringUtils.isEmpty( line ) ) { return; } if ( !updatingFound ) { if ( line.startsWith( "Updating" ) ) { updatingFound = true; return; } } // skip summary line //1 files changed, 1 insertions(+), 1 deletions(-)â†[m if ( line.indexOf( "files changed" ) >= 0 ) { summaryFound = true; return; } if ( updatingFound && !summaryFound ) { // test format : pom.xml\u2190[m | int index = line.indexOf( "\u2190[" ); if ( index >= 0 ) { String fileName = StringUtils.trim( line.substring( 0, index ) ); scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.UPDATED ) ); return; } else { // test other format : pom.xml | 3 +-- index = line.indexOf( "|" ); if ( index >= 0 ) { String fileName = StringUtils.trim( line.substring( 0, index ) ); scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.UPDATED ) ); return; } } } if ( updatingFound && summaryFound ) { // here we have status/name of added/remove and we update if create or remove // 3 files changed, 1 insertions(+), 3 deletions(-)\u2190[m // delete mode 100644 README // create mode 100644 test.txt String[] changedFileLine = StringUtils.split( line, " " ); if ( changedFileLine != null ) { if ( changedFileLine.length >= 4 ) { String status = changedFileLine[0]; String fileName = changedFileLine[3]; ScmFile scmFile = (ScmFile) scmFiles.get( fileName ); if ( scmFile != null ) { if ( StringUtils.equalsIgnoreCase( "delete", status ) ) { scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.DELETED ) ); } if ( StringUtils.equalsIgnoreCase( "create", status ) ) { scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.ADDED ) ); } } } } } } public List getUpdatedFiles() { if ( getLogger().isDebugEnabled() ) { getLogger().debug( " updatedFiles size " + scmFiles.size() ); } return new ArrayList( scmFiles.values() ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000002016711263356573033605 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListCommand; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListConsumer; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg * @version $Id: GitCheckOutCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitCheckOutCommand extends AbstractCheckOutCommand implements GitCommand { /** * For git, the given repository is a remote one. * We have to clone it first if the working directory does not contain a git repo yet, * otherwise we have to git-pull it. * * TODO We currently assume a '.git' directory, so this does not work for --bare repos * {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() ) && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 ) { throw new ScmException( "remote repository must not be the working directory" ); } int exitCode; CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( !fileSet.getBasedir().exists() || !( new File( fileSet.getBasedir(), ".git" ).exists() ) ) { if ( fileSet.getBasedir().exists() ) { // git refuses to clone otherwise fileSet.getBasedir().delete(); } // no git repo seems to exist, let's clone the original repo Commandline clClone = createCloneCommand( repository, fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clClone, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckOutScmResult( clClone.toString(), "The git-clone command failed.", stderr.getOutput(), false ); } } if ( fileSet.getBasedir().exists() && new File( fileSet.getBasedir(), ".git" ).exists() ) { // git repo exists, so we must git-pull the changes Commandline clPull = createPullCommand( repository, fileSet.getBasedir(), version ); exitCode = GitCommandLineUtils.execute( clPull, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckOutScmResult( clPull.toString(), "The git-pull command failed.", stderr.getOutput(), false ); } } // and now lets do the git-checkout itself Commandline cl = createCommandLine( repository, fileSet.getBasedir(), version ); exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckOutScmResult( cl.toString(), "The git-checkout command failed.", stderr.getOutput(), false ); } // and now search for the files GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.CHECKED_IN ); Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckOutScmResult( clList.toString(), "The git-ls-files command failed.", stderr.getOutput(), false ); } return new CheckOutScmResult( cl.toString(), listConsumer.getListedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, ScmVersion version ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "checkout" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { cl.createArg().setValue( version.getName() ); } return cl; } /** * create a git-clone repository command */ private Commandline createCloneCommand( GitScmProviderRepository repository, File workingDirectory ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory.getParentFile(), "clone" ); cl.createArg().setValue( repository.getFetchUrl() ); cl.createArg().setFile( workingDirectory ); return cl; } /** * create a git-pull repository command */ private Commandline createPullCommand( GitScmProviderRepository repository, File workingDirectory, ScmVersion version ) { Commandline cl; if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { if ( version instanceof ScmTag ) { // A tag will not be pulled but we only fetch all the commits from the upstream repo // This is done because checking out a tag might not happen on the current branch // but create a 'detached HEAD'. // In fact, a tag in git may be in multiple branches. This occurs if // you create a branch after the tag has been created cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "fetch" ); cl.createArg().setValue( repository.getFetchUrl() ); } else { cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "pull" ); cl.createArg().setValue( repository.getFetchUrl() ); cl.createArg().setValue( version.getName() + ":" + version.getName() ); } } else { cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "pull" ); cl.createArg().setValue( repository.getFetchUrl() ); cl.createArg().setValue( "master" ); } return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001050611057621704033571 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Mark Struberg * @version $Id: GitStatusConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class GitStatusConsumer implements StreamConsumer { /** * The pattern used to match added file lines */ private static final String ADDED_PATTERN = "^#\\s*new file:\\s*(.*)"; /** * The pattern used to match modified file lines */ private static final String MODIFIED_PATTERN = "^#\\s*modified:\\s*(.*)"; /** * The pattern used to match deleted file lines */ private static final String DELETED_PATTERN = "^#\\s*deleted:\\s*(.*)"; /** * @see #ADDED_PATTERN */ private RE addedRegexp; /** * @see #MODIFIED_PATTERN */ private RE modifiedRegexp; /** * @see #DELETED_PATTERN */ private RE deletedRegexp; private ScmLogger logger; private File workingDirectory; private List changedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public GitStatusConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; try { addedRegexp = new RE( ADDED_PATTERN ); modifiedRegexp = new RE( MODIFIED_PATTERN ); deletedRegexp = new RE( DELETED_PATTERN ); } catch ( RESyntaxException ex ) { throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse git log file. This shouldn't happen. Something is probably wrong with the oro installation.", ex ); } } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( StringUtils.isEmpty( line ) ) { return; } ScmFileStatus status = null; String file = null; if ( addedRegexp.match( line ) ) { status = ScmFileStatus.ADDED; file = addedRegexp.getParen( 1 ); } else if ( modifiedRegexp.match( line ) ) { status = ScmFileStatus.MODIFIED; file = modifiedRegexp.getParen( 1 ); } else if ( deletedRegexp.match( line ) ) { status = ScmFileStatus.DELETED; file = deletedRegexp.getParen( 1 ); } // If the file isn't a file; don't add it. if ( file != null ) { if ( workingDirectory != null && !new File( workingDirectory, file ).isFile() ) { return; } changedFiles.add( new ScmFile( file, status ) ); } } public List getChangedFiles() { return changedFiles; } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000575711057610744033607 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: GitStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class GitStatusCommand extends AbstractStatusCommand implements GitCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Commandline cl = createCommandLine( (GitScmProviderRepository) repo, fileSet ); GitStatusConsumer consumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { // git-status returns non-zero if nothing to do if ( getLogger().isInfoEnabled() ) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" ); } } return new StatusScmResult( cl.toString(), consumer.getChangedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( GitScmProviderRepository repository, ScmFileSet fileSet ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "status" ); return cl; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000604611057621704033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mark Struberg * @version $Id: GitRemoveConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class GitRemoveConsumer implements StreamConsumer { /** * The pattern used to match deleted file lines */ private static final String REMOVED_PATTERN = "^rm\\s'(.*)'"; private ScmLogger logger; private List removedFiles = new ArrayList(); /** * @see #REMOVED_PATTERN */ private RE removedRegexp; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public GitRemoveConsumer( ScmLogger logger ) { this.logger = logger; try { removedRegexp = new RE( REMOVED_PATTERN ); } catch ( RESyntaxException ex ) { throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse git log file. This shouldn't happen. Something is probably wrong with the oro installation.", ex ); } } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.length() <= 2 ) { return; } if ( removedRegexp.match( line ) ) { String file = removedRegexp.getParen( 1 ); removedFiles.add( new ScmFile( file, ScmFileStatus.DELETED ) ); } else { if ( logger.isInfoEnabled() ) { logger.info( "could not parse line: " + line ); } return; } } public List getRemovedFiles() { return removedFiles; } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/remove/GitRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000605611050561465033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.List; /** * @author Mark Struberg * @version $Id: GitRemoveCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class GitRemoveCommand extends AbstractRemoveCommand implements GitCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; if ( fileSet.getFileList().isEmpty() ) { throw new ScmException( "You must provide at least one file/directory to remove" ); } Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); GitRemoveConsumer consumer = new GitRemoveConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new RemoveScmResult( cl.toString(), "The git command failed.", stderr.getOutput(), false ); } return new RemoveScmResult( cl.toString(), consumer.getRemovedFiles() ); } public static Commandline createCommandLine( File workingDirectory, List/*File*/ files ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "rm" ); GitCommandLineUtils.addTarget( cl, files ); return cl; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/tag/GitTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001461111263356573033602 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.tag; /* * 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. */ import java.io.File; import java.io.IOException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListCommand; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListConsumer; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Mark Struberg * @version $Id: GitTagCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitTagCommand extends AbstractTagCommand implements GitCommand { public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, String message ) throws ScmException { return executeTagCommand( repo, fileSet, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ public ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { if ( tag == null || StringUtils.isEmpty( tag.trim() ) ) { throw new ScmException( "tag name must be specified" ); } if ( !fileSet.getFileList().isEmpty() ) { throw new ScmException( "This provider doesn't support tagging subsets of a directory" ); } GitScmProviderRepository repository = (GitScmProviderRepository) repo; File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null ); try { FileUtils.fileWrite( messageFile.getAbsolutePath(), scmTagParameters.getMessage() ); } catch ( IOException ex ) { return new TagScmResult( null, "Error while making a temporary file for the commit message: " + ex.getMessage(), null, false ); } try { CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; Commandline clTag = createCommandLine( repository, fileSet.getBasedir(), tag, messageFile ); exitCode = GitCommandLineUtils.execute( clTag, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new TagScmResult( clTag.toString(), "The git-tag command failed.", stderr.getOutput(), false ); } // and now push the tag to the origin repository Commandline clPush = createPushCommandLine( repository, fileSet, tag ); exitCode = GitCommandLineUtils.execute( clPush, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new TagScmResult( clPush.toString(), "The git-push command failed.", stderr.getOutput(), false ); } // plus search for the tagged files GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.TAGGED ); Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckOutScmResult( clList.toString(), "The git-ls-files command failed.", stderr.getOutput(), false ); } return new TagScmResult( clTag.toString(), listConsumer.getListedFiles() ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, String tag, File messageFile ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "tag" ); cl.createArg().setValue( "-F" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); // Note: this currently assumes you have the tag base checked out too cl.createArg().setValue( tag ); return cl; } public static Commandline createPushCommandLine( GitScmProviderRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "push" ); cl.createArg().setValue( repository.getPushUrl() ); cl.createArg().setValue( tag ); return cl; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkin/GitCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000002153011263356573033600 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.util.GitUtil; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.add.GitAddCommand; import org.apache.maven.scm.provider.git.gitexe.command.branch.GitBranchCommand; import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusCommand; import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumer; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Mark Struberg * @version $Id: GitCheckInCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitCheckInCommand extends AbstractCheckInCommand implements GitCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); int exitCode; File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null ); try { FileUtils.fileWrite( messageFile.getAbsolutePath(), message ); } catch ( IOException ex ) { return new CheckInScmResult( null, "Error while making a temporary file for the commit message: " + ex.getMessage(), null, false ); } try { if ( !fileSet.getFileList().isEmpty() ) { // if specific fileSet is given, we have to git-add them first // otherwise we will use 'git-commit -a' later Commandline clAdd = GitAddCommand.createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); exitCode = GitCommandLineUtils.execute( clAdd, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckInScmResult( clAdd.toString(), "The git-add command failed.", stderr.getOutput(), false ); } } // git-commit doesn't show single files, but only summary :/ // so we must run git-status and consume the output // borrow a few things from the git-status command Commandline clStatus = GitStatusCommand.createCommandLine( repository, fileSet ); GitStatusConsumer statusConsumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clStatus, statusConsumer, stderr, getLogger() ); if ( exitCode != 0 ) { // git-status returns non-zero if nothing to do if ( getLogger().isInfoEnabled() ) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to " + "track)" ); } } Commandline clCommit = createCommitCommandLine( repository, fileSet, messageFile ); exitCode = GitCommandLineUtils.execute( clCommit, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckInScmResult( clCommit.toString(), "The git-commit command failed.", stderr.getOutput(), false ); } Commandline cl = createPushCommandLine( getLogger(), repository, fileSet, version ); exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new CheckInScmResult( cl.toString(), "The git-push command failed.", stderr.getOutput(), false ); } List checkedInFiles = new ArrayList( statusConsumer.getChangedFiles().size() ); // rewrite all detected files to now have status 'checked_in' for ( Iterator it = statusConsumer.getChangedFiles().iterator(); it.hasNext(); ) { ScmFile scmfile = new ScmFile( ( (ScmFile) it.next() ).getPath(), ScmFileStatus.CHECKED_IN ); if ( fileSet.getFileList().isEmpty() ) { checkedInFiles.add( scmfile ); } else { // if a specific fileSet is given, we have to check if the file is really tracked for ( Iterator itfl = fileSet.getFileList().iterator(); itfl.hasNext(); ) { File f = (File) itfl.next(); if ( f.toString().equals( scmfile.getPath() ) ) { checkedInFiles.add( scmfile ); } } } } return new CheckInScmResult( cl.toString(), checkedInFiles ); } finally { try { FileUtils.forceDelete( messageFile ); } catch ( IOException ex ) { // ignore } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createPushCommandLine( ScmLogger logger, GitScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "push" ); String branch = GitBranchCommand.getCurrentBranch( logger, repository, fileSet ); if ( branch == null || branch.length() == 0) { throw new ScmException( "Could not detect the current branch. Don't know where I should push to!" ); } cl.createArg().setValue( repository.getPushUrl() ); cl.createArg().setValue( branch + ":" + branch ); return cl; } public static Commandline createCommitCommandLine( GitScmProviderRepository repository, ScmFileSet fileSet, File messageFile ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( fileSet.getBasedir(), "commit" ); cl.createArg().setValue( "--verbose" ); cl.createArg().setValue( "-F" ); cl.createArg().setValue( messageFile.getAbsolutePath() ); if ( fileSet.getFileList().isEmpty() ) { // commit all tracked files cl.createArg().setValue( "-a" ); } else { // specify exactly which files to commit GitCommandLineUtils.addTarget( cl, fileSet.getFileList() ); } if ( GitUtil.getSettings().isCommitNoVerify() ) { cl.createArg().setValue( "--no-verify" ); } return cl; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000677111263356573033612 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.list.AbstractListCommand; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg * @version $Id: GitListCommand.java 823147 2009-10-08 12:39:23Z struberg $ */ public class GitListCommand extends AbstractListCommand implements GitCommand { /** {@inheritDoc} */ protected ListScmResult executeListCommand( ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion scmVersion ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() ) && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 ) { throw new ScmException( "remote repository must not be the working directory" ); } int exitCode; CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); GitListConsumer consumer = new GitListConsumer( getLogger(), fileSet.getBasedir().getParentFile(), ScmFileStatus.CHECKED_IN ); Commandline cl = createCommandLine( repository, fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new ListScmResult( cl.toString(), "The git-ls-files command failed.", stderr.getOutput(), false ); } return new ListScmResult( cl.toString(), consumer.getListedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "ls-files" ); return cl; } } ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/list/GitListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000407011050561465033570 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.list; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.git.gitexe.command.AbstractFileCheckingConsumer; import java.io.File; import java.util.List; /** * @author Mark Struberg * @version $Id: GitListConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class GitListConsumer extends AbstractFileCheckingConsumer { private ScmFileStatus fileStatus; /** * @param logger * @param workingDirectory * @param fileStatus will be used for each file found */ public GitListConsumer( ScmLogger logger, File workingDirectory, ScmFileStatus fileStatus ) { super( logger, workingDirectory ); this.fileStatus = fileStatus; } /** {@inheritDoc} */ protected void parseLine( String line ) { String file = line; addFile( new ScmFile( file, fileStatus ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getListedFiles() { return getFiles(); } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001032011057621704033563 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.Iterator; import java.util.List; /** * Command line construction utility. * * @author Brett Porter * @author Mark Struberg * @version $Id: GitCommandLineUtils.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class GitCommandLineUtils { public static void addTarget( Commandline cl, List/**/ files ) { if ( files == null || files.isEmpty() ) { return; } for ( Iterator i = files.iterator(); i.hasNext(); ) { File f = (File) i.next(); String relativeFile = f.getPath(); if ( f.getAbsolutePath().startsWith( cl.getWorkingDirectory().getAbsolutePath() ) ) { // so we can omit the starting characters relativeFile = relativeFile.substring( cl.getWorkingDirectory().getAbsolutePath().length() ); if ( relativeFile.startsWith( File.separator ) ) { relativeFile = relativeFile.substring( File.separator.length() ); } } // no setFile() since this screws up the working directory! cl.createArg().setValue( relativeFile ); } } public static Commandline getBaseGitCommandLine( File workingDirectory, String command ) { if ( command == null || command.length() == 0 ) { return null; } Commandline cl = new Commandline(); cl.setExecutable( "git" ); cl.createArg().setValue( command ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); return cl; } public static int execute( Commandline cl, StreamConsumer consumer, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws ScmException { if ( logger.isInfoEnabled() ) { logger.info( "Executing: " + cl ); logger.info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } return exitCode; } public static int execute( Commandline cl, CommandLineUtils.StringStreamConsumer stdout, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws ScmException { if ( logger.isInfoEnabled() ) { logger.info( "Executing: " + cl ); logger.info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } return exitCode; } } ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/AbstractFileCheckingConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000000542511057621704033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Kenney Westerhof * @version $Id: AbstractFileCheckingConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public abstract class AbstractFileCheckingConsumer implements StreamConsumer { protected ScmLogger logger; protected File workingDirectory; private List files = new ArrayList(); protected int revision; private boolean filtered; public AbstractFileCheckingConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; } /** {@inheritDoc} */ public final void consumeLine( String line ) { if ( line.length() <= 3 ) { return; } if ( logger.isDebugEnabled() ) { logger.debug( line ); } parseLine( line ); } protected abstract void parseLine( String line ); protected List getFiles() { if ( !filtered ) { for ( Iterator it = files.iterator(); it.hasNext(); ) { if ( !new File( workingDirectory, ( (ScmFile) it.next() ).getPath() ).isFile() ) { it.remove(); } } filtered = true; } return files; } protected final int parseInt( String revisionString ) { try { return Integer.parseInt( revisionString ); } catch ( NumberFormatException ex ) { return 0; } } protected void addFile( ScmFile file ) { files.add( file ); } public final int getRevision() { return revision; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/diff/GitDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001024211057005130033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.command.diff.GitDiffConsumer; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Mark Struberg * @version $Id: GitDiffCommand.java 690997 2008-09-01 15:29:28Z vsiveton $ */ public class GitDiffCommand extends AbstractDiffCommand implements GitCommand { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { GitDiffConsumer consumer = new GitDiffConsumer( getLogger(), fileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; Commandline clDiff2Index = createCommandLine( fileSet.getBasedir(), startVersion, endVersion, false ); exitCode = GitCommandLineUtils.execute( clDiff2Index, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new DiffScmResult( clDiff2Index.toString(), "The git-diff command failed.", stderr.getOutput(), false ); } Commandline clDiff2Head = createCommandLine( fileSet.getBasedir(), startVersion, endVersion, true ); exitCode = GitCommandLineUtils.execute( clDiff2Head, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new DiffScmResult( clDiff2Head.toString(), "The git-diff command failed.", stderr.getOutput(), false ); } return new DiffScmResult( clDiff2Index.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * @param cached if true diff the index to the head, else diff the tree to the index */ public static Commandline createCommandLine( File workingDirectory, ScmVersion startVersion, ScmVersion endVersion, boolean cached ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "diff" ); if ( cached ) { cl.createArg().setValue( "--cached" ); } if ( startVersion != null && StringUtils.isNotEmpty( startVersion.getName() ) ) { cl.createArg().setValue( startVersion.getName() ); } if ( endVersion != null && StringUtils.isNotEmpty( endVersion.getName() ) ) { cl.createArg().setValue( endVersion.getName() ); } return cl; } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000002272411157544644033606 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.changelog; /* * 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. */ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.git.GitChangeSet; import org.apache.maven.scm.util.AbstractConsumer; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; /** * @author Mark Struberg * @version $Id: GitChangeLogConsumer.java 755014 2009-03-16 21:50:28Z olamy $ */ public class GitChangeLogConsumer extends AbstractConsumer { /** * Date formatter for git timestamp * we use iso format cli git log --date=iso sample : 2008-08-06 01:37:18 +0200 */ private static final String GIT_TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss Z"; /** * State machine constant: expecting header */ private static final int STATUS_GET_HEADER = 1; /** * State machine constant: expecting author information */ private static final int STATUS_GET_AUTHOR = 2; /** * State machine constant: expecting date information */ private static final int STATUS_GET_DATE = 3; /** * State machine constant: expecting file information */ private static final int STATUS_GET_FILE = 4; /** * State machine constant: expecting comments */ private static final int STATUS_GET_COMMENT = 5; /** * The pattern used to match git header lines */ private static final String HEADER_PATTERN = "^commit (.*)"; /** * The pattern used to match git author lines */ private static final String AUTHOR_PATTERN = "^Author: (.*)"; /** * The pattern used to match git date lines */ private static final String DATE_PATTERN = "^Date:\\s*(.*)"; /** * The pattern used to match git file lines */ private static final String FILE_PATTERN = "^:\\d* \\d* [:xdigit:]*\\.* [:xdigit:]*\\.* ([:upper:])\\t(.*)"; /** * Current status of the parser */ private int status = STATUS_GET_HEADER; /** * List of change log entries */ private List entries = new ArrayList(); /** * The current log entry being processed by the parser */ private GitChangeSet currentChange; /** * The current revision of the entry being processed by the parser */ private String currentRevision; /** * The current comment of the entry being processed by the parser */ private StringBuffer currentComment; /** * The regular expression used to match header lines */ private RE headerRegexp; /** * The regular expression used to match author lines */ private RE authorRegexp; /** * The regular expression used to match date lines */ private RE dateRegexp; /** * The regular expression used to match file lines */ private RE fileRegexp; private String userDateFormat; /** * Default constructor. */ public GitChangeLogConsumer( ScmLogger logger, String userDateFormat ) { super( logger ); this.userDateFormat = userDateFormat; try { headerRegexp = new RE( HEADER_PATTERN ); authorRegexp = new RE( AUTHOR_PATTERN ); dateRegexp = new RE( DATE_PATTERN ); fileRegexp = new RE( FILE_PATTERN ); } catch ( RESyntaxException ex ) { throw new RuntimeException( "INTERNAL ERROR: Could not create regexp to parse git log file. This shouldn't happen. Something is probably wrong with the oro installation.", ex ); } } public List getModifications() { // this is needed since the processFile does not always get a the end-sequence correctly. processGetFile( "" ); return entries; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( status ) { case STATUS_GET_HEADER: processGetHeader( line ); break; case STATUS_GET_AUTHOR: processGetAuthor( line ); break; case STATUS_GET_DATE: processGetDate( line, null ); break; case STATUS_GET_COMMENT: processGetComment( line ); break; case STATUS_GET_FILE: processGetFile( line ); break; default: throw new IllegalStateException( "Unknown state: " + status ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Process the current input line in the GET_HEADER state. The * author, date, and the revision of the entry are gathered. Note, * Subversion does not have per-file revisions, instead, the entire * repository is given a single revision number, which is used for * the revision number of each file. * * @param line A line of text from the git log output */ private void processGetHeader( String line ) { if ( !headerRegexp.match( line ) ) { return; } currentRevision = headerRegexp.getParen( 1 ); currentChange = new GitChangeSet(); status = STATUS_GET_AUTHOR; } /** * Process the current input line in the STATUS_GET_AUTHOR state. This * state gathers all of the author information that are part of a log entry. * * @param line a line of text from the git log output */ private void processGetAuthor( String line ) { if ( !authorRegexp.match( line ) ) { return; } String author = authorRegexp.getParen( 1 ); currentChange.setAuthor( author ); status = STATUS_GET_DATE; } /** * Process the current input line in the STATUS_GET_DATE state. This * state gathers all of the date information that are part of a log entry. * * @param line a line of text from the git log output */ private void processGetDate( String line, Locale locale ) { if ( !dateRegexp.match( line ) ) { return; } String datestring = dateRegexp.getParen( 1 ); Date date = parseDate( datestring.trim(), userDateFormat, GIT_TIMESTAMP_PATTERN, locale ); currentChange.setDate( date ); status = STATUS_GET_COMMENT; } /** * Process the current input line in the GET_COMMENT state. This * state gathers all of the comments that are part of a log entry. * * @param line a line of text from the git log output */ private void processGetComment( String line ) { if ( line.length() < 4 ) { if ( currentComment == null ) { currentComment = new StringBuffer(); } else { currentChange.setComment( currentComment.toString() ); status = STATUS_GET_FILE; } } else { if ( currentComment.length() > 0 ) { currentComment.append( '\n' ); } currentComment.append( line.substring( 4 ) ); } } /** * Process the current input line in the GET_FILE state. This state * adds each file entry line to the current change log entry. Note, * the revision number for the entire entry is used for the revision * number of each file. * * @param line A line of text from the git log output */ private void processGetFile( String line ) { if ( line.length() == 0 ) { if ( currentChange != null ) { entries.add( currentChange ); } resetChangeLog(); status = STATUS_GET_HEADER; } else { if ( !fileRegexp.match( line ) ) { return; } // String action = fileRegexp.getParen( 1 ); // action is currently not used String name = fileRegexp.getParen( 2 ); currentChange.addFile( new ChangeFile( name, currentRevision ) ); } } private void resetChangeLog() { currentComment = null; currentChange = null; } } ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/changelog/GitChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001601011176152472033570 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; /** * @author Emmanuel Venisse * @version $Id: GitChangeLogCommand.java 769975 2009-04-29 22:31:22Z olamy $ */ public class GitChangeLogCommand extends AbstractChangeLogCommand implements GitCommand { private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z"; /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, null, null, null, datePattern, startVersion, endVersion ); } /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { return executeChangeLogCommand( repo, fileSet, startDate, endDate, branch, datePattern, null, null ); } protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { Commandline cl = createCommandLine( (GitScmProviderRepository) repo, fileSet.getBasedir(), branch, startDate, endDate, startVersion, endVersion ); GitChangeLogConsumer consumer = new GitChangeLogConsumer( getLogger(), datePattern ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The git-log command failed.", stderr.getOutput(), false ); } ChangeLogSet changeLogSet = new ChangeLogSet( consumer.getModifications(), startDate, endDate ); changeLogSet.setStartVersion( startVersion ); changeLogSet.setEndVersion( endVersion ); return new ChangeLogScmResult( cl.toString(), changeLogSet ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * this constructs creates the commandline for the git-whatchanged command. * Since it uses --since and --until for the start and end date, the branch * and version parameters can be used simultanously. */ public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, ScmBranch branch, Date startDate, Date endDate, ScmVersion startVersion, ScmVersion endVersion ) { SimpleDateFormat dateFormat = new SimpleDateFormat( DATE_FORMAT ); dateFormat.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "whatchanged" ); if ( startDate != null || endDate != null ) { if ( startDate != null ) { cl.createArg().setValue( "--since=" + StringUtils.escape( dateFormat.format( startDate ) ) ); } if ( endDate != null ) { cl.createArg().setValue( "--until=" + StringUtils.escape( dateFormat.format( endDate ) ) ); } } // since this parameter is also used for the output formatting, we need it also if no start nor end date is given cl.createArg().setValue( "--date=iso" ); if ( startVersion != null || endVersion != null ) { StringBuffer versionRange = new StringBuffer(); if ( startVersion != null ) { versionRange.append( StringUtils.escape( startVersion.getName() ) ); } versionRange.append( ".." ); if ( endVersion != null ) { versionRange.append( StringUtils.escape( endVersion.getName() ) ); } cl.createArg().setValue( versionRange.toString() ); } if ( branch != null && branch.getName() != null && branch.getName().length() > 0 ) { cl.createArg().setValue( branch.getName() ); } // Insert a separator to make sure that files aren't interpreted as part of the version spec cl.createArg().setValue( "--" ); // We have to report only the changes of the current project. // This is needed for child projects, otherwise we would get the changelog of the // whole parent-project including all childs. cl.createArg().setFile( workingDirectory ); return cl; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000755000175000017500000000000011345536664033577 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/add/GitAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001165011176146712033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils; import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusCommand; import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumer; import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Mark Struberg * @version $Id: GitAddCommand.java 769959 2009-04-29 21:59:38Z olamy $ */ public class GitAddCommand extends AbstractAddCommand implements GitCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { GitScmProviderRepository repository = (GitScmProviderRepository) repo; if ( fileSet.getFileList().isEmpty() ) { throw new ScmException( "You must provide at least one file/directory to add" ); } Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); int exitCode; exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() ); if ( exitCode != 0 ) { return new AddScmResult( cl.toString(), "The git-add command failed.", stderr.getOutput(), false ); } // git-add doesn't show single files, but only summary :/ // so we must run git-status and consume the output // borrow a few things from the git-status command Commandline clStatus = GitStatusCommand.createCommandLine( repository, fileSet ); GitStatusConsumer statusConsumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir() ); exitCode = GitCommandLineUtils.execute( clStatus, statusConsumer, stderr, getLogger() ); if ( exitCode != 0 ) { // git-status returns non-zero if nothing to do if ( getLogger().isInfoEnabled() ) { getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" ); } } List changedFiles = new ArrayList(); // rewrite all detected files to now have status 'checked_in' for ( Iterator it = statusConsumer.getChangedFiles().iterator(); it.hasNext(); ) { ScmFile scmfile = (ScmFile) it.next(); // if a specific fileSet is given, we have to check if the file is really tracked for ( Iterator itfl = fileSet.getFileList().iterator(); itfl.hasNext(); ) { File f = (File) itfl.next(); if ( f.toString().equals( scmfile.getPath() ) ) { changedFiles.add( scmfile ); } } } return new AddScmResult( cl.toString(), changedFiles ); } public static Commandline createCommandLine( File workingDirectory, List/*File*/files ) throws ScmException { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "add" ); // use this separator to make clear that the following parameters are files and not revision info. cl.createArg().setValue( "--" ); GitCommandLineUtils.addTarget( cl, files ); return cl; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/GitExeScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/or0000644000175000017500000001117311157544644033602 0ustar twernertwernerpackage org.apache.maven.scm.provider.git.gitexe; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.provider.git.AbstractGitScmProvider; import org.apache.maven.scm.provider.git.command.GitCommand; import org.apache.maven.scm.provider.git.command.info.GitInfoItem; import org.apache.maven.scm.provider.git.command.info.GitInfoScmResult; import org.apache.maven.scm.provider.git.gitexe.command.add.GitAddCommand; import org.apache.maven.scm.provider.git.gitexe.command.branch.GitBranchCommand; import org.apache.maven.scm.provider.git.gitexe.command.changelog.GitChangeLogCommand; import org.apache.maven.scm.provider.git.gitexe.command.checkin.GitCheckInCommand; import org.apache.maven.scm.provider.git.gitexe.command.checkout.GitCheckOutCommand; import org.apache.maven.scm.provider.git.gitexe.command.diff.GitDiffCommand; import org.apache.maven.scm.provider.git.gitexe.command.list.GitListCommand; import org.apache.maven.scm.provider.git.gitexe.command.remove.GitRemoveCommand; import org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusCommand; import org.apache.maven.scm.provider.git.gitexe.command.tag.GitTagCommand; import org.apache.maven.scm.provider.git.gitexe.command.update.GitUpdateCommand; import org.apache.maven.scm.repository.ScmRepositoryException; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: GitExeScmProvider.java 755014 2009-03-16 21:50:28Z olamy $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="git" */ public class GitExeScmProvider extends AbstractGitScmProvider { /** {@inheritDoc} */ protected GitCommand getAddCommand() { return new GitAddCommand(); } /** {@inheritDoc} */ protected GitCommand getBranchCommand() { return new GitBranchCommand(); } /** {@inheritDoc} */ protected GitCommand getChangeLogCommand() { return new GitChangeLogCommand(); } /** {@inheritDoc} */ protected GitCommand getCheckInCommand() { return new GitCheckInCommand(); } /** {@inheritDoc} */ protected GitCommand getCheckOutCommand() { return new GitCheckOutCommand(); } /** {@inheritDoc} */ protected GitCommand getDiffCommand() { return new GitDiffCommand(); } /** {@inheritDoc} */ protected GitCommand getExportCommand() { return null; //X TODO } /** {@inheritDoc} */ protected GitCommand getRemoveCommand() { return new GitRemoveCommand(); } /** {@inheritDoc} */ protected GitCommand getStatusCommand() { return new GitStatusCommand(); } /** {@inheritDoc} */ protected GitCommand getTagCommand() { return new GitTagCommand(); } /** {@inheritDoc} */ protected GitCommand getUpdateCommand() { return new GitUpdateCommand(); } /** {@inheritDoc} */ protected GitCommand getListCommand() { return new GitListCommand(); } /** {@inheritDoc} */ public GitCommand getInfoCommand() { return null; //X TODO } /** {@inheritDoc} */ protected String getRepositoryURL( File path ) throws ScmException { // Note: I need to supply just 1 absolute path, but ScmFileSet won't let me without // a basedir (which isn't used here anyway), so use a dummy file. GitInfoScmResult result = info( null, new ScmFileSet( new File( "" ), path ), null ); if ( result.getInfoItems().size() != 1 ) { throw new ScmRepositoryException( "Cannot find URL: " + ( result.getInfoItems().size() == 0 ? "no" : "multiple" ) + " items returned by the info command" ); } return ( (GitInfoItem) result.getInfoItems().get( 0 ) ).getURL(); } } maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/pom.xml0000644000175000017500000000434611322611461032106 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers-git 1.3 maven-scm-provider-gitexe Maven SCM Git Provider - Git Executable Impl. Executable implementation for SCM Git Provider. regexp regexp org.apache.maven.scm maven-scm-provider-git-commons org.apache.maven.scm maven-scm-provider-gittest test org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/maven-scm-providers-git/pom.xml0000644000175000017500000000424211322611461025100 0ustar twernertwerner 4.0.0 maven-scm-providers org.apache.maven.scm 1.3 maven-scm-providers-git pom Maven SCM Git Provider - Parent SCM Provider implementation for Git (http://git.or.cz/). maven-scm-provider-git-commons maven-scm-provider-gittest maven-scm-provider-gitexe tck-git org.apache.maven.plugins maven-surefire-plugin nothing maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/0000755000175000017500000000000011345536667024560 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/0000755000175000017500000000000011345536667025347 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/site/0000755000175000017500000000000011345536667026313 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/site/site.xml0000644000175000017500000000213111051127665027762 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/0000755000175000017500000000000011345536667026326 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/0000755000175000017500000000000011345536667030340 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/0000755000175000017500000000000011345536667032262 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/0000755000175000017500000000000011345536667033544 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/update_en.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/u0000644000175000017500000000467611057212425033727 0ustar twernertwernerProcessing dir "my_vob\modules\utils". Making dir "my_vob\modules\utils\utils-logging-jar". Processing dir "my_vob\modules\utils\utils-logging-jar". . Processing dir "my_vob\modules\utils\utils-logging-jar\src". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging". ... End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com". . End dir "my_vob\modules\utils\utils-logging-jar\src\main". . Processing dir "my_vob\modules\utils\utils-logging-jar\src\test". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com". . End dir "my_vob\modules\utils\utils-logging-jar\src\test". . End dir "my_vob\modules\utils\utils-logging-jar\src". . Loading "my_vob\modules\utils\utils-logging-jar\testfile.txt" (50 bytes). End dir "my_vob\modules\utils\utils-logging-jar". End dir "my_vob\modules\utils". . Done loading "\my_vob\modules\utils" (21 objects, copied 0 KB). Log has been written to "C:\Program Files\Apache Software Foundation\continuum-1.0.1\apps\continuum\working-directory\32\update.01-dec-05.16.11.18.updt". ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/update_ja.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/u0000644000175000017500000000707611057212425033724 0ustar twernertwernerディレクトリ "my_vob\modules\utils" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar" を作æˆã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar" を処ç†ã—ã¦ã„ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ... ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main\com" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\main" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils" を処ç†ã—ã¦ã„ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging" を処ç†ã—ã¦ã„ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test\com" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src\test" を終了ã—ã¾ã™ã€‚ . ディレクトリ "my_vob\modules\utils\utils-logging-jar\src" を終了ã—ã¾ã™ã€‚ . "my_vob\modules\utils\utils-logging-jar\testfile.txt" をロードã—ã¦ã„ã¾ã™ (50 bytes)。 "my_vob\modules\utils\utils-logging-jar\unload.txt" をアンロードã—ã¾ã—ãŸã€‚ ディレクトリ "my_vob\modules\utils\utils-logging-jar" を終了ã—ã¾ã™ã€‚ ディレクトリ "my_vob\modules\utils" を終了ã—ã¾ã™ã€‚ . "\my_vob\modules\utils" ã®ãƒ­ãƒ¼ãƒ‰ãŒå®Œäº†ã—ã¾ã—ãŸã€‚ (21 個ã®ã‚ªãƒ–ジェクトã€0 KB をコピー) ログ㌠"C:\Program Files\Apache Software Foundation\continuum-1.0.1\apps\continuum\working-directory\32\update.01-dec-05.16.11.18.updt" ã«æ›¸ãè¾¼ã¾ã‚Œã¾ã—ãŸã€‚ ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/update.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/update/u0000644000175000017500000000467610345304271033727 0ustar twernertwernerProcessing dir "my_vob\modules\utils". Making dir "my_vob\modules\utils\utils-logging-jar". Processing dir "my_vob\modules\utils\utils-logging-jar". . Processing dir "my_vob\modules\utils\utils-logging-jar\src". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils". Processing dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging". ... End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis\utils". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp\mis". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com\mycomp". . End dir "my_vob\modules\utils\utils-logging-jar\src\main\com". . End dir "my_vob\modules\utils\utils-logging-jar\src\main". . Processing dir "my_vob\modules\utils\utils-logging-jar\src\test". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils". Processing dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils\logging". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis\utils". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp\mis". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com\mycomp". . End dir "my_vob\modules\utils\utils-logging-jar\src\test\com". . End dir "my_vob\modules\utils\utils-logging-jar\src\test". . End dir "my_vob\modules\utils\utils-logging-jar\src". . Loading "my_vob\modules\utils\utils-logging-jar\testfile.txt" (50 bytes). End dir "my_vob\modules\utils\utils-logging-jar". End dir "my_vob\modules\utils". . Done loading "\my_vob\modules\utils" (21 objects, copied 0 KB). Log has been written to "C:\Program Files\Apache Software Foundation\continuum-1.0.1\apps\continuum\working-directory\32\update.01-dec-05.16.11.18.updt". maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/status/0000755000175000017500000000000011345536667033605 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/status/status.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/status/s0000644000175000017500000000001410340340210033730 0ustar twernertwerner.\test.java maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/unedit/0000755000175000017500000000000011345536667033552 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/unedit/unedit.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/unedit/u0000644000175000017500000000013610340340210033704 0ustar twernertwernerPrivate version of "test.java" saved in "test.java.keep". Checkout cancelled for "test.java". maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/remove/0000755000175000017500000000000011345536667033557 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/remove/remove.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/remove/r0000644000175000017500000000002510340340210033703 0ustar twernertwernerRemoved "test.java". maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/tag/0000755000175000017500000000000011345536667033035 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/tag/tag.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/tag/tag.0000644000175000017500000000010210340340210033545 0ustar twernertwernerCreated label "TEST_LABEL_V1.0" on "test.java" version "\main\1". ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/0000755000175000017500000000000011345536667033666 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/checkin.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/checkin/0000644000175000017500000000005210340340210033630 0ustar twernertwernerChecked in "test.java" version "\main\3". maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/edit/0000755000175000017500000000000011345536667033207 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/edit/edit.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/edit/edi0000644000175000017500000000006010340340210033632 0ustar twernertwernerChecked out "test.java" from version "\main\1". ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelo0000755000175000017500000000000011345536667033763 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcase-settings.xmlmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelo0000644000175000017500000000013511014356045033743 0ustar twernertwerner -8.8 ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelog/clearcaselog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/changelo0000644000175000017500000000125610370410674033753 0ustar twernertwernerNAME:PartyManager\src\java\uk\co\mycompany\corppay\refdata\model\Submission.java DATE:20040630.145714 COMM:checkin - checkin - Added status constants. - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor USER:88888888 NAME:PartyManager\src\java\uk\co\mycompany\util\hibernate DATE:20040630.143802 COMM:checkin - checkin - Added storing of data. - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor USER:55555 NAME:PartyManager\src\java\uk\co\mycompany\corppay\refdata\model\Submission.java DATE:20040630.143759 COMM:checkin - checkin - Added storing of data. - Activity: Acceptance_Tests_For_Release_to_Instruction_Processor USER:martenss maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/add/0000755000175000017500000000000011345536667033012 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/add/add.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/resources/clearcase/add/add.0000644000175000017500000000006010340340210033502 0ustar twernertwernerCreated element "test.java" (type "text_file"). maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/0000755000175000017500000000000011345536666027246 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/0000755000175000017500000000000011345536666030035 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/0000755000175000017500000000000011345536666031256 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/0000755000175000017500000000000011345536666032364 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536666033146 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536666033510 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536666033510 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536666033510 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/update/ClearCaseUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000264011015073323033470 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.update; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; /** * @author Wim Deblauwe */ public class ClearCaseUpdateCommandTest extends ScmTestCase { public void testCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory() ); Commandline commandLine = ClearCaseUpdateCommand.createCommandLine( scmFileSet ); assertCommandLine( "cleartool update -f", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/update/ClearCaseUpdateConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000655411057212425033504 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.update; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; import java.util.Locale; /** * @author Wim Deblauwe */ public class ClearCaseUpdateConsumerTest extends ScmTestCase { private InputStream getResourceAsStream( String name, Locale locale ) { String path; if ( locale == null || "".equals( locale.getLanguage() ) ) { path = name; } else { String base = name.substring( 0, name.lastIndexOf( '.' ) ); String ext = name.substring( name.lastIndexOf( '.' ) ); path = base + "_" + locale.getLanguage() + ext; if ( !new File( path ).exists() ) { path = name; } } return super.getResourceAsStream( path ); } private void localizedConsumer( Locale locale ) throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/update/update.txt", locale ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream, "UTF-8" ) ); String s = in.readLine(); ClearCaseUpdateConsumer consumer = new ClearCaseUpdateConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } String message = "locale is \"" + locale.getLanguage() + "\""; Collection entries = consumer.getUpdatedFiles(); assertEquals( message + " Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( message, "my_vob\\modules\\utils\\utils-logging-jar\\testfile.txt", scmFile.getPath() ); assertEquals( message, ScmFileStatus.UPDATED, scmFile.getStatus() ); } public void testConsumer() throws IOException { // Locale[] locales = { Locale.US, Locale.JAPANESE }; Locale[] locales = { Locale.getDefault() }; Locale defaultLocale = Locale.getDefault(); for ( int i = 0; i < locales.length; i++ ) { Locale.setDefault( locales[i] ); localizedConsumer( locales[i] ); } Locale.setDefault( defaultLocale ); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000001500611057215000033464 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.IOException; /** * @author Wim Deblauwe * @author Frederic Mura */ public class ClearCaseCheckOutCommandTest extends ScmTestCase { private Settings settings = null; private ClearCaseCheckOutCommand checkOutCommand = null; public void setUp() throws Exception { super.setUp(); checkOutCommand = new ClearCaseCheckOutCommand(); checkOutCommand.setLogger( new DefaultLog() ); settings = new Settings(); checkOutCommand.setSettings( settings ); } public void testCreateViewCommandLine() throws IOException { String viewName = "testView"; settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_DEFAULT ); Commandline commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, null ); assertCommandLine( "cleartool mkview -snapshot -tag testView -vws " + checkOutCommand.getViewStore() + "testView.vws " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); settings.setUseVWSParameter( false ); commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, null ); assertCommandLine( "cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_LT ); settings.setUseVWSParameter( true ); commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, null ); assertCommandLine( "cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); settings.setUseVWSParameter( false ); commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, null ); assertCommandLine( "cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_UCM ); String streamId = "streamIdentifier"; commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, streamId ); assertCommandLine( "cleartool mkview -snapshot -tag testView -stream " + streamId + " " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); settings.setUseVWSParameter( true ); commandLine = checkOutCommand.createCreateViewCommandLine( getWorkingDirectory(), viewName, streamId ); assertCommandLine( "cleartool mkview -snapshot -tag testView -stream " + streamId + " -vws " + checkOutCommand.getViewStore() + "testView.vws " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine ); } public void testUpdateConfigSpec() { settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_DEFAULT ); File configSpecLocation; if ( Os.isFamily( "windows" ) ) { configSpecLocation = new File( "\\\\myserver\\configspecs\\testconfigspec.txt" ); } else { configSpecLocation = new File( "/clearcase/configspecs/testconfigspec.txt" ); } Commandline commandLine = checkOutCommand.createUpdateConfigSpecCommandLine( getWorkingDirectory(), configSpecLocation, "testView" ); assertCommandLine( "cleartool setcs -tag testView " + configSpecLocation, getWorkingDirectory(), commandLine ); settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_LT ); commandLine = checkOutCommand.createUpdateConfigSpecCommandLine( getWorkingDirectory(), configSpecLocation, "testView" ); assertCommandLine( "cleartool setcs -tag testView " + configSpecLocation, getWorkingDirectory(), commandLine ); } public void testCreateConfigSpec() { assertEquals( "element * CHECKEDOUT\n" + "element * /main/LATEST\n" + "load MYVOB/my/dir\n", checkOutCommand.createConfigSpec( "MYVOB/my/dir", null ) ); assertEquals( "element * CHECKEDOUT\n" + "element * MYTAG\n" + "element -directory * /main/LATEST\n" + "load MYVOB/my/dir\n", checkOutCommand .createConfigSpec( "MYVOB/my/dir", new ScmBranch( "MYTAG" ) ) ); } public void testGetStreamIdentifier() { String streamName = "stream35_v1.0"; String vobName = "pVob_35"; String streamIdentifier = checkOutCommand.getStreamIdentifier( streamName, vobName ); assertEquals( "stream:" + streamName + "@" + vobName, streamIdentifier ); streamIdentifier = checkOutCommand.getStreamIdentifier( streamName, null ); assertNull( streamIdentifier ); streamIdentifier = checkOutCommand.getStreamIdentifier( null, vobName ); assertNull( streamIdentifier ); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000274511015073323033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.status; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseStatusCommandTest extends ScmTestCase { public void testCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), new File( "test.java" ) ); Commandline commandLine = ClearCaseStatusCommand.createCommandLine( scmFileSet ); assertCommandLine( "cleartool lscheckout -cview -r -fmt %n\\n", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000453310535556312033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.util.StringUtils; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseStatusConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/status/status.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseStatusConsumer consumer = new ClearCaseStatusConsumer( new DefaultLog(), getWorkingDirectory() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getCheckedOutFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); String scmFilePath = StringUtils.replace( scmFile.getPath(), "\\", File.separator ); assertEquals( new File( getWorkingDirectory(), "test.java" ).getAbsolutePath(), scmFilePath ); assertEquals( ScmFileStatus.CHECKED_OUT, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000415310535556312033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseUnEditConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/unedit/unedit.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseUnEditConsumer consumer = new ClearCaseUnEditConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getUnEditFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.UNKNOWN, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000303011015073323033462 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseUnEditCommandTest extends ScmTestCase { public void testCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), new File( "test.java" ) ); Commandline commandLine = ClearCaseUnEditCommand.createCommandLine( new DefaultLog(), scmFileSet ); assertCommandLine( "cleartool unco -keep test.java", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000415410535556312033504 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseRemoveConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/remove/remove.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseRemoveConsumer consumer = new ClearCaseRemoveConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getRemovedFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.DELETED, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000303011015073323033462 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseRemoveCommandTest extends ScmTestCase { public void testCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), new File( "test.java" ) ); Commandline commandLine = ClearCaseRemoveCommand.createCommandLine( new DefaultLog(), scmFileSet ); assertCommandLine( "cleartool rmname -nc test.java", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000413010535556312033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseTagConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/tag/tag.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseTagConsumer consumer = new ClearCaseTagConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getTaggedFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.TAGGED, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000276111015073323033474 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseTagCommandTest extends ScmTestCase { public void testCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), new File( "test.java" ) ); Commandline commandLine = ClearCaseTagCommand.createCommandLine( scmFileSet, "TEST_LABEL_V1.0" ); assertCommandLine( "cleartool mklabel TEST_LABEL_V1.0 test.java", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000321711015073323033471 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseCheckInCommandTest extends ScmTestCase { public void testCommand() throws ScmException { File file = new File( "test.java" ); ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), file ); Commandline commandLine = ClearCaseCheckInCommand.createCommandLine( scmFileSet, "done some changes" ); assertCommandLine( "cleartool ci -c \"done some changes\" " + file.getAbsolutePath(), getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000416710535556312033510 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseCheckInConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/checkin/checkin.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseCheckInConsumer consumer = new ClearCaseCheckInConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getCheckedInFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.CHECKED_IN, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000413510535556312033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.edit; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseEditConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/edit/edit.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseEditConsumer consumer = new ClearCaseEditConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getEditFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.UNKNOWN, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000307011015073323033466 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.edit; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseEditCommandTest extends ScmTestCase { public void testCommand() { File file = new File( "test.java" ); ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), file ); Commandline commandLine = ClearCaseEditCommand.createCommandLine( new DefaultLog(), scmFileSet ); assertCommandLine( "cleartool co -nc " + file.getAbsolutePath(), getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000001013511015073323033466 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.clearcase.util.ClearCaseUtil; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Date; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @author Mark Holster * @version $Id: ClearCaseChangeLogCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class ClearCaseChangeLogCommandTest extends ScmTestCase { public void testGetCommandLine() throws Exception { Date startDate = null; Date endDate = null; testCommandLine( null, startDate, endDate, "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o - %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco" ); } public void testGetCommandLineWithUserPattern() throws Exception { ClearCaseUtil.setSettingsDirectory( getTestFile( "src/test/resources/clearcase/changelog" ) ); Date startDate = null; Date endDate = null; testCommandLine( null, startDate, endDate, "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o - %o - %c - Activity: %[activity]p\\nUSER:%-8.8u\\n\" -recurse -nco" ); ClearCaseUtil.setSettingsDirectory( ClearCaseUtil.DEFAULT_SETTINGS_DIRECTORY ); } public void testGetCommandLineWithTag() throws Exception { Date startDate = null; Date endDate = null; testCommandLine( new ScmBranch( "myBranch" ), startDate, endDate, "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o - %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -branch myBranch" ); } public void testGetCommandLineWithStartDate() throws Exception { Date startDate = getDate( 2003, 8, 10 ); Date endDate = null; testCommandLine( null, startDate, endDate, "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o - %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -since 10-Sep-2003" ); } public void testGetCommandLineWithTagAndStartDate() throws Exception { Date startDate = getDate( 2003, 8, 10 ); Date endDate = null; testCommandLine( new ScmBranch( "myBranch" ), startDate, endDate, "cleartool lshistory -fmt \"NAME:%En\\nDATE:%Nd\\nCOMM:%-12.12o - %o - %c - Activity: %[activity]p\\nUSER:%u\\n\" -recurse -nco -since 10-Sep-2003 -branch myBranch" ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void testCommandLine( ScmBranch branch, Date startDate, Date endDate, String commandLine ) throws Exception { File workingDirectory = getTestFile( "target/clearcare-changelog-command-test" ); Commandline cl = ClearCaseChangeLogCommand.createCommandLine( workingDirectory, branch, startDate ); assertCommandLine( commandLine, workingDirectory, cl ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033511 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000412610535556312033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Wim Deblauwe */ public class ClearCaseAddConsumerTest extends ScmTestCase { public void testConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/clearcase/add/add.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); ClearCaseAddConsumer consumer = new ClearCaseAddConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getAddedFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ScmFile scmFile = (ScmFile) entries.iterator().next(); assertEquals( "test.java", scmFile.getPath() ); assertEquals( ScmFileStatus.ADDED, scmFile.getStatus() ); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000000274511015073323033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.add; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe */ public class ClearCaseAddCommandTest extends ScmTestCase { public void testAddCommand() { ScmFileSet scmFileSet = new ScmFileSet( getWorkingDirectory(), new File( "test.java" ) ); Commandline commandLine = ClearCaseAddCommand.createCommandLine( scmFileSet ); assertCommandLine( "cleartool mkelem -c \"new file\" -nco test.java", getWorkingDirectory(), commandLine ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536666033510 5ustar twernertwerner././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/provider/clearcase/repository/ClearCaseScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/test/java/org/apache/maven/scm/pr0000644000175000017500000002517611057221063033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.repository; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.apache.maven.scm.repository.ScmRepositoryException; import java.io.File; import java.io.IOException; /** * @author Wim Deblauwe * @author Antoine Veret */ public class ClearCaseScmProviderRepositoryTest extends TestCase { public void testParsingUrlWithPipe() throws ScmRepositoryException, IOException { Settings settings = new Settings(); String viewName = "my_module_view"; String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String url = viewName + "|" + configSpecPath; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertEquals( viewName, repository.getViewName( "bla" ) ); assertNull( repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testParsingUrlWithColon() throws ScmRepositoryException { Settings settings = new Settings(); String viewName = "my_module_view"; String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String url = viewName + ":" + configSpecPath; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertEquals( viewName, repository.getViewName( "bla" ) ); assertNull( repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testParsingUrlWithoutViewName() throws ScmRepositoryException { Settings settings = new Settings(); String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String url = configSpecPath; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertNotNull( repository.getViewName( "15" ) ); assertTrue( repository.getViewName( "15" ).indexOf( "15" ) != -1 ); assertNull( repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testAutoConfigSpecWithColon() throws Exception { Settings settings = new Settings(); String url = "my_view_name:load /VOB/some/dir"; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertNull( repository.getConfigSpec() ); assertTrue( repository.isAutoConfigSpec() ); assertEquals( "my_view_name", repository.getViewName( "bla" ) ); assertEquals( "/VOB/some/dir", repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testAutoConfigSpecWithPipe() throws Exception { Settings settings = new Settings(); String url = "my_view_name|load /VOB/some/dir"; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertNull( repository.getConfigSpec() ); assertTrue( repository.isAutoConfigSpec() ); assertEquals( "my_view_name", repository.getViewName( "bla" ) ); assertEquals( "/VOB/some/dir", repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testAutoConfigSpecWithoutViewName() throws Exception { Settings settings = new Settings(); String url = "load /VOB/some/dir"; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertNull( repository.getConfigSpec() ); assertTrue( repository.isAutoConfigSpec() ); assertNotNull( repository.getViewName( "15" ) ); assertTrue( repository.getViewName( "15" ).indexOf( "15" ) != -1 ); assertEquals( "/VOB/some/dir", repository.getLoadDirectory() ); assertNull(repository.getStreamName()); assertNull(repository.getVobName()); } public void testParsingUrlClearCaseUCMWithPipe() throws ScmRepositoryException { Settings settings = new Settings(); settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM); String delimiter = "|"; String viewName = "my_module_view"; String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String vobName = "pvob_alliance"; String streamName = "INT_COMMUN_V1.0"; String url = viewName + delimiter + configSpecPath + delimiter + vobName + delimiter + streamName; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertEquals( viewName, repository.getViewName( "bla" ) ); assertNull( repository.getLoadDirectory() ); assertEquals(streamName, repository.getStreamName()); assertEquals(vobName, repository.getVobName()); } public void testParsingUrlClearCaseUCMWithoutViewnameWithColon() throws ScmRepositoryException { Settings settings = new Settings(); settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM); String delimiter = ":"; String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String vobName = "pvob_alliance"; String streamName = "INT_COMMUN_V1.0"; String url = configSpecPath + delimiter + vobName + delimiter + streamName; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertNotNull( repository.getViewName( "bla" ) ); assertNull( repository.getLoadDirectory() ); assertEquals(streamName, repository.getStreamName()); assertEquals(vobName, repository.getVobName()); } public void testParsingUrlClearCaseUCMWithoutViewnameWithColonAndElement() throws ScmRepositoryException { Settings settings = new Settings(); settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_UCM ); String delimiter = ":"; String configSpecPath = "//myserver/ClearCase/ConfigSpecs/mymodule.txt"; String vobName = "pvob_alliance"; String streamName = "INT_COMMUN_V1.0"; String elementName = "/main/element/LATEST"; String url = configSpecPath + delimiter + vobName + delimiter + streamName + delimiter + elementName; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertEquals( new File( configSpecPath ).getPath(), repository.getConfigSpec().getPath() ); assertNotNull( repository.getViewName( "bla" ) ); assertNull( repository.getLoadDirectory() ); assertEquals( streamName, repository.getStreamName() ); assertEquals( vobName, repository.getVobName() ); assertEquals( elementName, repository.getElementName() ); } public void testParsingUrlClearCaseUCMAutoConfig() throws ScmRepositoryException { Settings settings = new Settings(); settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM); String delimiter = "|"; String loadPath = "/ua/sub/project"; String vobName = "pvob_alliance"; String streamName = "INT_COMMUN_V1.0"; String url = "load " + loadPath + delimiter + vobName + delimiter + streamName; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertNull( repository.getConfigSpec() ); assertTrue( repository.isAutoConfigSpec() ); assertNotNull( repository.getViewName( "bla" ) ); assertEquals( loadPath, repository.getLoadDirectory() ); assertEquals(streamName, repository.getStreamName()); assertEquals(vobName, repository.getVobName()); } public void testParsingUrlClearCaseUCMAutoConfigWithElement() throws ScmRepositoryException { Settings settings = new Settings(); settings.setClearcaseType( ClearCaseScmProviderRepository.CLEARCASE_UCM ); String delimiter = "|"; String loadPath = "/ua/sub/project"; String vobName = "pvob_alliance"; String streamName = "INT_COMMUN_V1.0"; String elementName = "/main/element/LATEST"; String url = "load " + loadPath + delimiter + vobName + delimiter + streamName + delimiter + elementName; ClearCaseScmProviderRepository repository = new ClearCaseScmProviderRepository( new DefaultLog(), url, settings ); assertNull( repository.getConfigSpec() ); assertTrue( repository.isAutoConfigSpec() ); assertNotNull( repository.getViewName( "bla" ) ); assertEquals( loadPath, repository.getLoadDirectory() ); assertEquals( streamName, repository.getStreamName() ); assertEquals( vobName, repository.getVobName() ); assertEquals( elementName, repository.getElementName() ); } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/0000755000175000017500000000000011345536667026273 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/mdo/0000755000175000017500000000000011345536667027052 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/mdo/clearcase-settings.mdo0000644000175000017500000000514011315117331033307 0ustar twernertwerner clearcase Clearcase Clearcase Provider Model. package org.apache.maven.scm.providers.clearcase.settings Settings 1.0.0+ viewstore 1.0.0+ String Clearcase viewstore path useVWSParameter 1.0.0+ boolean true Do you want to use vws parameter when clearcase provider run mkview? clearcaseType 1.0.0+ String Are you using ClearCase LT or UCM version ? changelogUserFormat 1.1.0+ String The format of the USER pattern in lhistory command. For example, it can be "-8.8" maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/0000755000175000017500000000000011345536667030305 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/0000755000175000017500000000000011345536667031074 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/0000755000175000017500000000000011345536667032315 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/0000755000175000017500000000000011345536667033423 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000755000175000017500000000000011345536667033606 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000755000175000017500000000000011345536667033606 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/clearcase/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000755000175000017500000000000011345536667033606 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/clearcase/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000755000175000017500000000000011345536667033606 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/clearcase/command/clearcase_ja.propertiesmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000644000175000017500000000151211057212425033566 0ustar twernertwerner# 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. loading=\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/clearcase/command/clearcase_en.propertiesmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000644000175000017500000000227511057212425033575 0ustar twernertwerner# 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. # NOTE: # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It # must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the # JVM's default locale (which need not be "en"). See the method javadoc about # ResourceBundle.getBundle(String, Locale, ClassLoader) # for a full description of the lookup strategy. ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/scm/provider/clearcase/command/clearcase.propertiesmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/resources/org/apache/maven/s0000644000175000017500000000144011057212425033566 0ustar twernertwerner# 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. loading=Loadingmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/0000755000175000017500000000000011345536667027214 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/0000755000175000017500000000000011345536667030003 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/0000755000175000017500000000000011345536667031224 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/0000755000175000017500000000000011345536667032332 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536667033114 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/update/ClearCaseUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001005011057610744033441 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.command.changelog.ClearCaseChangeLogCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseUpdateCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseUpdateCommand extends AbstractUpdateCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing update command..." ); } Commandline cl = createCommandLine( fileSet ); ClearCaseUpdateConsumer consumer = new ClearCaseUpdateConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new UpdateScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() ); } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { ClearCaseChangeLogCommand changeLogCmd = new ClearCaseChangeLogCommand(); changeLogCmd.setLogger( getLogger() ); return changeLogCmd; } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "update" ); command.createArg().setValue( "-f" ); return command; } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/update/ClearCaseUpdateConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000530211176360443033445 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.update; /* * 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. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.clearcase.util.ClearCaseUtil; import org.codehaus.plexus.util.cli.StreamConsumer; /** * @author Wim Deblauwe * @version $Id: ClearCaseUpdateConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseUpdateConsumer implements StreamConsumer { private ScmLogger logger; private List updatedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseUpdateConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.indexOf( ClearCaseUtil.getLocalizedResource( "loading" ) ) > -1 ) { int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); updatedFiles.add( new ScmFile( fileName, ScmFileStatus.UPDATED ) ); } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000435611050561465033453 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseCheckOutConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class ClearCaseCheckOutConsumer implements StreamConsumer { private ScmLogger logger; private List checkedOutFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseCheckOutConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { checkedOutFiles.add( new ScmFile( line, ScmFileStatus.CHECKED_OUT ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getCheckedOutFiles() { return checkedOutFiles; } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkout/ClearCaseCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000003761511057610744033461 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkout; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Wim Deblauwe * @author Frederic Mura * @version $Id: ClearCaseCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseCheckOutCommand extends AbstractCheckOutCommand implements ClearCaseCommand { private Settings settings = null; // ---------------------------------------------------------------------- // AbstractCheckOutCommand Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkout command..." ); } ClearCaseScmProviderRepository repo = (ClearCaseScmProviderRepository) repository; File workingDirectory = fileSet.getBasedir(); if ( version != null && getLogger().isDebugEnabled() ) { getLogger().debug( version.getType() + ": " + version.getName() ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Running with CLEARCASE " + settings.getClearcaseType() ); } ClearCaseCheckOutConsumer consumer = new ClearCaseCheckOutConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; Commandline cl; String projectDirectory = ""; try { // Since clearcase only wants to checkout to a non-existent directory, first delete the working dir // if it already exists FileUtils.deleteDirectory( workingDirectory ); // First create the view String viewName = getUniqueViewName( repo, workingDirectory.getAbsolutePath() ); String streamIdentifier = getStreamIdentifier( repo.getStreamName(), repo.getVobName() ); cl = createCreateViewCommandLine( workingDirectory, viewName, streamIdentifier ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, new CommandLineUtils.StringStreamConsumer(), stderr ); if ( exitCode == 0 ) { File configSpecLocation; if ( !repo.isAutoConfigSpec() ) { configSpecLocation = repo.getConfigSpec(); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { // Another config spec is needed in this case. // // One option how to implement this would be to use a name convention for the config specs, // e.g. the tag name could be appended to the original config spec name. // If the config spec from the SCM URL would be \\myserver\configspecs\someproj.txt // and the tag name would be mytag, the new config spec location could be // \\myserver\configspecs\someproj-mytag.txt // throw new UnsupportedOperationException( "Building on a label not supported with user-specified config specs" ); } } else { // write config spec to temp file String configSpec; if ( repo.hasElements() ) { configSpec = createConfigSpec( repo.getLoadDirectory(), version ); } else { configSpec = createConfigSpec( repo.getLoadDirectory(), repo.getElementName(), version ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Created config spec for view '" + viewName + "':\n" + configSpec ); } configSpecLocation = writeTemporaryConfigSpecFile( configSpec, viewName ); // When checking out from ClearCase, the directory structure of the // SCM system is repeated within the checkout directory. E.g. if you check out the // project "my/project" to "/some/dir", the project sources are actually checked out // to "my/project/some/dir". projectDirectory = repo.getLoadDirectory(); // strip off leading / to make the path relative if ( projectDirectory.startsWith( "/" ) ) { projectDirectory = projectDirectory.substring( 1 ); } } cl = createUpdateConfigSpecCommandLine( workingDirectory, configSpecLocation, viewName ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } catch ( IOException ex ) { throw new ScmException( "Error while deleting working directory.", ex ); } if ( exitCode != 0 ) { return new CheckOutScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles(), projectDirectory ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Creates a temporary config spec file with the given contents that will be * deleted on VM exit. * * @param configSpecContents The contents for the file * @param viewName The name of the view; used to determine an appropriate file * name * @throws IOException */ protected File writeTemporaryConfigSpecFile( String configSpecContents, String viewName ) throws IOException { File configSpecLocation = File.createTempFile( "configspec-" + viewName, ".txt" ); FileWriter fw = new FileWriter( configSpecLocation ); try { fw.write( configSpecContents ); } finally { try { fw.close(); } catch ( IOException e ) { // ignore } } configSpecLocation.deleteOnExit(); return configSpecLocation; } /** * Creates a config spec that loads the given loadDirectory and uses the * given version tag * * @param loadDirectory the VOB directory to be loaded * @param version ClearCase label type; notice that branch types are not * supported * @return Config Spec as String */ protected String createConfigSpec( String loadDirectory, ScmVersion version ) { // create config spec StringBuffer configSpec = new StringBuffer(); configSpec.append( "element * CHECKEDOUT\n" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { configSpec.append( "element * " + version.getName() + "\n" ); configSpec.append( "element -directory * /main/LATEST\n" ); // configSpec.append( "element * /main/QualityControl_INT/RAD7_Migration/LATEST\n" ); } else { configSpec.append( "element * /main/LATEST\n" ); } configSpec.append( "load " + loadDirectory + "\n" ); return configSpec.toString(); } protected String createConfigSpec( String loadDirectory, String elementName, ScmVersion version ) { // create config spec StringBuffer configSpec = new StringBuffer(); configSpec.append( "element * CHECKEDOUT\n" ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { configSpec.append( "element * " + version.getName() + "\n" ); configSpec.append( "element * " + elementName + "\n" ); } else { configSpec.append( "element * /main/LATEST\n" ); } configSpec.append( "load " + loadDirectory + "\n" ); return configSpec.toString(); } // private static Commandline createDeleteViewCommandLine( ClearCaseScmProviderRepository repository, // File workingDirectory ) // { // Commandline command = new Commandline(); // // command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); // // command.setExecutable( "cleartool" ); // // command.createArg().setValue( "rmview" ); // command.createArg().setValue( "-force" ); // command.createArg().setValue( "-tag" ); // if ( isClearCaseLT() ) // { // command.createArg().setValue( getViewStore() ); // } // else // { // command.createArg().setValue( getUniqueViewName( repository, workingDirectory.getAbsolutePath() ) ); // } // // return command; // } protected Commandline createCreateViewCommandLine( File workingDirectory, String viewName, String streamIdentifier ) throws IOException { Commandline command = new Commandline(); // We have to execute from 1 level up from the working dir, since we had to delete the working dir command.setWorkingDirectory( workingDirectory.getParentFile().getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mkview" ); command.createArg().setValue( "-snapshot" ); command.createArg().setValue( "-tag" ); command.createArg().setValue( viewName ); if ( isClearCaseUCM() ) { command.createArg().setValue( "-stream" ); command.createArg().setValue( streamIdentifier ); } if ( !isClearCaseLT() ) { if ( useVWS() ) { command.createArg().setValue( "-vws" ); command.createArg().setValue( getViewStore() + viewName + ".vws" ); } } command.createArg().setValue( workingDirectory.getCanonicalPath() ); return command; } /** * Format the stream identifier for ClearCaseUCM * @param streamName * @param vobName * @return the formatted stream identifier if the two parameter are not null */ protected String getStreamIdentifier( String streamName, String vobName ) { if ( streamName == null || vobName == null ) { return null; } return "stream:" + streamName + "@" + vobName; } protected Commandline createUpdateConfigSpecCommandLine( File workingDirectory, File configSpecLocation, String viewName ) { Commandline command = new Commandline(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "setcs" ); command.createArg().setValue( "-tag" ); command.createArg().setValue( viewName ); command.createArg().setValue( configSpecLocation.getAbsolutePath() ); return command; } private String getUniqueViewName( ClearCaseScmProviderRepository repository, String absolutePath ) { String uniqueId; int lastIndexBack = absolutePath.lastIndexOf( '\\' ); int lastIndexForward = absolutePath.lastIndexOf( '/' ); if ( lastIndexBack != -1 ) { uniqueId = absolutePath.substring( lastIndexBack + 1 ); } else { uniqueId = absolutePath.substring( lastIndexForward + 1 ); } return repository.getViewName( uniqueId ); } protected String getViewStore() { String result = null; if ( settings.getViewstore() != null ) { result = settings.getViewstore(); } if ( result == null ) { result = "\\\\" + getHostName() + "\\viewstore\\"; } else { // If ClearCase LT are use, the View store is identify by the // username. if ( isClearCaseLT() ) { result = result + getUserName() + "\\"; } } return result; } protected boolean isClearCaseLT() { return ClearCaseScmProviderRepository.CLEARCASE_LT.equals( settings.getClearcaseType() ); } protected boolean isClearCaseUCM() { return ClearCaseScmProviderRepository.CLEARCASE_UCM.equals( settings.getClearcaseType() ); } /** * @return the value of the setting property 'useVWS' */ protected boolean useVWS() { return settings.isUseVWSParameter(); } private String getHostName() { String hostname; try { hostname = InetAddress.getLocalHost().getHostName(); } catch ( UnknownHostException e ) { // Should never happen throw new RuntimeException( e ); } return hostname; } private String getUserName() { String username; username = System.getProperty( "user.name" ); return username; } public void setSettings( Settings settings ) { this.settings = settings; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000500511057621704033443 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseStatusConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class ClearCaseStatusConsumer implements StreamConsumer { private ScmLogger logger; private File workingDirectory; private List checkedOutFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseStatusConsumer( ScmLogger logger, File workingDirectory ) { this.logger = logger; this.workingDirectory = workingDirectory; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } checkedOutFiles.add( new ScmFile( workingDirectory.getAbsolutePath() + line.substring( 1 ), ScmFileStatus.CHECKED_OUT ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getCheckedOutFiles() { return checkedOutFiles; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/status/ClearCaseStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000734411057610744033455 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseStatusCommand extends AbstractStatusCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository scmProviderRepository, ScmFileSet scmFileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing status command..." ); } Commandline cl = createCommandLine( scmFileSet ); ClearCaseStatusConsumer consumer = new ClearCaseStatusConsumer( getLogger(), scmFileSet.getBasedir() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getCheckedOutFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "lscheckout" ); command.createArg().setValue( "-cview" ); command.createArg().setValue( "-r" ); command.createArg().setValue( "-fmt" ); command.createArg().setValue( "%n\\n" ); return command; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000742311057610744033453 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.unedit.AbstractUnEditCommand; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseUnEditCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseUnEditCommand extends AbstractUnEditCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected ScmResult executeUnEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing unedit command..." ); } Commandline cl = createCommandLine( getLogger(), fileSet ); ClearCaseUnEditConsumer consumer = new ClearCaseUnEditConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getUnEditFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "unco" ); command.createArg().setValue( "-keep" ); File[] files = scmFileSet.getFiles(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; command.createArg().setValue( file.getName() ); } return command; } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/unedit/ClearCaseUnEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000514011176360443033445 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseUnEditConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseUnEditConsumer implements StreamConsumer { private ScmLogger logger; private List unEditFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseUnEditConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( line.indexOf( "Checkout cancelled" ) > -1 ) { int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); unEditFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) ); } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getUnEditFiles() { return unEditFiles; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000477711176360443033464 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseRemoveConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseRemoveConsumer implements StreamConsumer { private ScmLogger logger; private List removedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseRemoveConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); removedFiles.add( new ScmFile( fileName, ScmFileStatus.DELETED ) ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getRemovedFiles() { return removedFiles; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/remove/ClearCaseRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001402511057621704033445 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseRemoveCommand.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class ClearCaseRemoveCommand extends AbstractRemoveCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository scmProviderRepository, ScmFileSet scmFileSet, String string ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing remove command..." ); } Commandline cl = createCommandLine( getLogger(), scmFileSet ); ClearCaseRemoveConsumer consumer = new ClearCaseRemoveConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { // First we need to 'check out' the current directory Commandline checkoutCurrentDirCommandLine = ClearCaseEditCommand.createCheckoutCurrentDirCommandLine( scmFileSet ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + checkoutCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath() + ">>" + checkoutCurrentDirCommandLine.toString() ); } exitCode = CommandLineUtils.executeCommandLine( checkoutCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr ); if ( exitCode == 0 ) { // Then we add the file if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); if ( exitCode == 0 ) { // Then we check in the current directory again. Commandline checkinCurrentDirCommandLine = ClearCaseEditCommand.createCheckinCurrentDirCommandLine( scmFileSet ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + checkinCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath() + ">>" + checkinCurrentDirCommandLine.toString() ); } exitCode = CommandLineUtils.executeCommandLine( checkinCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr ); } } } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getRemovedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "rmname" ); command.createArg().setValue( "-nc" ); File[] files = scmFileSet.getFiles(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; if ( logger.isInfoEnabled() ) { logger.info( "Deleting file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getName() ); } return command; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000544211176360443033452 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: ClearCaseTagConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseTagConsumer implements StreamConsumer { private ScmLogger logger; private List taggedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseTagConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } int beginIndexTag = line.indexOf( '"' ); if ( beginIndexTag != -1 ) { int endIndexTag = line.indexOf( '"', beginIndexTag + 1 ); if ( endIndexTag != -1 ) { int beginIndex = line.indexOf( '"', endIndexTag + 1 ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); taggedFiles.add( new ScmFile( fileName, ScmFileStatus.TAGGED ) ); } } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getTaggedFiles() { return taggedFiles; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/tag/ClearCaseTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001330311157300235033435 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.command.checkin.ClearCaseCheckInConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseTagCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public class ClearCaseTagCommand extends AbstractTagCommand implements ClearCaseCommand { protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, String tag, String message ) throws ScmException { return executeTagCommand( scmProviderRepository, fileSet, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing tag command..." ); } Commandline cl = createCommandLine( fileSet, tag ); ClearCaseCheckInConsumer consumer = new ClearCaseCheckInConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Creating label: " + tag ); } Commandline newLabelCommandLine = createNewLabelCommandLine( fileSet, tag ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + newLabelCommandLine.getWorkingDirectory().getAbsolutePath() + ">>" + newLabelCommandLine.toString() ); } exitCode = CommandLineUtils.executeCommandLine( newLabelCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr ); if ( exitCode == 0 ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new TagScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new TagScmResult( cl.toString(), consumer.getCheckedInFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmFileSet scmFileSet, String tag ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mklabel" ); File[] files = scmFileSet.getFiles(); if ( files.length == 0 ) { command.createArg().setValue( "-recurse" ); } command.createArg().setValue( tag ); if ( files.length > 0 ) { for ( int i = 0; i < files.length; i++ ) { File file = files[i]; command.createArg().setValue( file.getName() ); } } else { command.createArg().setValue( "." ); } return command; } private static Commandline createNewLabelCommandLine( ScmFileSet scmFileSet, String tag ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mklbtype" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( tag ); return command; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000502211176360443033444 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Trygve Laugstøl * @version $Id: ClearCaseCheckInConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseCheckInConsumer implements StreamConsumer { private ScmLogger logger; private List checkedInFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseCheckInConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); checkedInFiles.add( new ScmFile( fileName, ScmFileStatus.CHECKED_IN ) ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getCheckedInFiles() { return checkedInFiles; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/checkin/ClearCaseCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001075711057610744033457 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseCheckInCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseCheckInCommand extends AbstractCheckInCommand implements ClearCaseCommand { // ---------------------------------------------------------------------- // AbstractCheckOutCommand Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkin command..." ); } Commandline cl = createCommandLine( fileSet, message ); ClearCaseCheckInConsumer consumer = new ClearCaseCheckInConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new CheckInScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new CheckInScmResult( cl.toString(), consumer.getCheckedInFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmFileSet scmFileSet, String message ) throws ScmException { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "ci" ); if ( message != null ) { command.createArg().setValue( "-c" ); command.createArg().setLine( "\"" + message + "\"" ); } else { command.createArg().setValue( "-nc" ); } File[] files = scmFileSet.getFiles(); if ( files.length == 0 ) { throw new ScmException( "There are no files in the fileset to check in!" ); } for ( int i = 0; i < files.length; i++ ) { File file = files[i]; command.createArg().setValue( file.getAbsolutePath() ); } return command; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/ClearCaseCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000204510535556312033446 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command; /* * 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. */ /** * @author Trygve Laugstøl * @version $Id: ClearCaseCommand.java 483105 2006-12-06 15:07:54Z evenisse $ */ public interface ClearCaseCommand { } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000475311176360443033456 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.edit; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseEditConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseEditConsumer implements StreamConsumer { private ScmLogger logger; private List editFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseEditConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getEditFiles() { return editFiles; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/edit/ClearCaseEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001170111057621704033443 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.edit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.edit.AbstractEditCommand; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseEditCommand.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class ClearCaseEditCommand extends AbstractEditCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing edit command..." ); } Commandline cl = createCommandLine( getLogger(), fileSet ); ClearCaseEditConsumer consumer = new ClearCaseEditConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new EditScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new EditScmResult( cl.toString(), consumer.getEditFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmLogger logger, ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "co" ); command.createArg().setValue( "-nc" ); File[] files = scmFileSet.getFiles(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; if ( logger.isInfoEnabled() ) { logger.info( "Checking out file: " + file.getAbsolutePath() ); } command.createArg().setValue( file.getAbsolutePath() ); } return command; } public static Commandline createCheckoutCurrentDirCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "co" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( "." ); return command; } public static Commandline createCheckinCurrentDirCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "ci" ); command.createArg().setValue( "-nc" ); command.createArg().setValue( "." ); return command; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001575711057610744033464 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import java.util.ArrayList; import java.util.List; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @version $Id: ClearCaseChangeLogConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseChangeLogConsumer extends AbstractConsumer { /** * Formatter used to parse Clearcase date/timestamp. */ private static final String CLEARCASE_TIMESTAMP_PATTERN = "yyyyMMdd.HHmmss"; private static final String NAME_TAG = "NAME:"; private static final String USER_TAG = "USER:"; private static final String DATE_TAG = "DATE:"; private static final String COMMENT_TAG = "COMM:"; private List entries = new ArrayList(); // state machine constants for reading clearcase lshistory command output /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting date */ private static final int GET_DATE = 2; /** * expecting comments */ private static final int GET_COMMENT = 3; /** * current status of the parser */ private int status = GET_FILE; /** * the current log entry being processed by the parser */ private ChangeSet currentChange = null; /** * the current file being processed by the parser */ private ChangeFile currentFile = null; private String userDatePattern; // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseChangeLogConsumer( ScmLogger logger, String userDatePattern ) { super( logger ); this.userDatePattern = userDatePattern; } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getModifications() { return entries; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( getStatus() ) { case GET_FILE: processGetFile( line ); break; case GET_DATE: processGetDate( line ); break; case GET_COMMENT: processGetCommentAndUser( line ); break; default: if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Unknown state: " + status ); } } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * Process the current input line in the Get File state. * * @param line a line of text from the clearcase log output */ private void processGetFile( String line ) { if ( line.startsWith( NAME_TAG ) ) { setCurrentChange( new ChangeSet() ); setCurrentFile( new ChangeFile( line.substring( NAME_TAG.length(), line.length() ) ) ); setStatus( GET_DATE ); } } /** * Process the current input line in the Get Date state. * * @param line a line of text from the clearcase log output */ private void processGetDate( String line ) { if ( line.startsWith( DATE_TAG ) ) { getCurrentChange().setDate( parseDate( line.substring( DATE_TAG.length() ), userDatePattern, CLEARCASE_TIMESTAMP_PATTERN ) ); setStatus( GET_COMMENT ); } } /** * Process the current input line in the Get Comment state. * * @param line a line of text from the clearcase log output */ private void processGetCommentAndUser( String line ) { if ( line.startsWith( COMMENT_TAG ) ) { String comm = line.substring( COMMENT_TAG.length() ); getCurrentChange().setComment( getCurrentChange().getComment() + comm + "\n" ); } else if ( line.startsWith( USER_TAG ) ) { getCurrentChange().setAuthor( line.substring( USER_TAG.length() ) ); // add entry, and set state to get file getCurrentChange().addFile( getCurrentFile() ); entries.add( getCurrentChange() ); setStatus( GET_FILE ); } else { // keep gathering comments getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" ); } } /** * Getter for property currentFile. * * @return Value of property currentFile. */ private ChangeFile getCurrentFile() { return currentFile; } /** * Setter for property currentFile. * * @param currentFile New value of property currentFile. */ private void setCurrentFile( ChangeFile currentFile ) { this.currentFile = currentFile; } /** * Getter for property currentChange. * * @return Value of property currentChange. */ private ChangeSet getCurrentChange() { return currentChange; } /** * Setter for property currentLogEntry. * * @param currentChange New value of property currentLogEntry. */ private void setCurrentChange( ChangeSet currentChange ) { this.currentChange = currentChange; } /** * Getter for property status. * * @return Value of property status. */ private int getStatus() { return status; } /** * Setter for property status. * * @param status New value of property status. */ private void setStatus( int status ) { this.status = status; } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/changelog/ClearCaseChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001374211057610744033454 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.util.ClearCaseUtil; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * @author Emmanuel Venisse * @author Trygve Laugstøl * @author Frederic Mura * @author Mark Holster * @version $Id: ClearCaseChangeLogCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseChangeLogCommand extends AbstractChangeLogCommand implements ClearCaseCommand { // ---------------------------------------------------------------------- // AbstractChangeLogCommand Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing changelog command..." ); } Commandline cl = createCommandLine( fileSet.getBasedir(), branch, startDate ); ClearCaseChangeLogConsumer consumer = new ClearCaseChangeLogConsumer( getLogger(), datePattern ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing cvs command.", ex ); } if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new ChangeLogScmResult( cl.toString(), new ChangeLogSet( consumer.getModifications(), startDate, endDate ) ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- /** * ClearCase LT version doesn't support the attribut -fmt and -since for command lhistory. * * @param workingDirectory * @param branch * @param startDate * @return The command line */ public static Commandline createCommandLine( File workingDirectory, ScmBranch branch, Date startDate ) { Commandline command = new Commandline(); command.setExecutable( "cleartool" ); command.createArg().setValue( "lshistory" ); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); Settings settings = ClearCaseUtil.getSettings(); String userFormat = StringUtils.isEmpty( settings.getChangelogUserFormat() ) ? "" : settings.getChangelogUserFormat(); StringBuffer format = new StringBuffer(); format.append( "NAME:%En\\n" ); format.append( "DATE:%Nd\\n" ); format.append( "COMM:%-12.12o - %o - %c - Activity: %[activity]p\\n" ); format.append( "USER:%" + userFormat + "u\\n" ); command.createArg().setValue( "-fmt" ); command.createArg().setValue( format.toString() ); command.createArg().setValue( "-recurse" ); command.createArg().setValue( "-nco" ); if ( startDate != null ) { SimpleDateFormat sdf = new SimpleDateFormat( "dd-MMM-yyyy", Locale.ENGLISH ); String start = sdf.format( startDate ); command.createArg().setValue( "-since" ); command.createArg().setValue( start ); } // TODO: End date? if ( branch != null && StringUtils.isNotEmpty( branch.getName() ) ) { command.createArg().setValue( "-branch" ); command.createArg().setValue( branch.getName() ); } return command; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000475111176360443033454 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Wim Deblauwe * @version $Id: ClearCaseAddConsumer.java 770340 2009-04-30 17:34:27Z olamy $ */ public class ClearCaseAddConsumer implements StreamConsumer { private ScmLogger logger; private List addedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public ClearCaseAddConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // Stream Consumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } int beginIndex = line.indexOf( '"' ); if ( beginIndex != -1 ) { String fileName = line.substring( beginIndex + 1, line.indexOf( '"', beginIndex + 1 ) ); addedFiles.add( new ScmFile( fileName, ScmFileStatus.ADDED ) ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public List getAddedFiles() { return addedFiles; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/command/add/ClearCaseAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001357711057610744033462 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.ClearCaseCommand; import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Wim Deblauwe * @version $Id: ClearCaseAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class ClearCaseAddCommand extends AbstractAddCommand implements ClearCaseCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository scmProviderRepository, ScmFileSet scmFileSet, String string, boolean b ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing add command..." ); } Commandline cl = createCommandLine( scmFileSet ); ClearCaseAddConsumer consumer = new ClearCaseAddConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; try { // First we need to 'check out' the current directory Commandline checkoutCurrentDirCommandLine = ClearCaseEditCommand.createCheckoutCurrentDirCommandLine( scmFileSet ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + checkoutCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath() + ">>" + checkoutCurrentDirCommandLine.toString() ); } exitCode = CommandLineUtils.executeCommandLine( checkoutCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr ); if ( exitCode == 0 ) { // Then we add the file if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); if ( exitCode == 0 ) { // Then we check in the current directory again. Commandline checkinCurrentDirCommandLine = ClearCaseEditCommand.createCheckinCurrentDirCommandLine( scmFileSet ); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + checkinCurrentDirCommandLine.getWorkingDirectory().getAbsolutePath() + ">>" + checkinCurrentDirCommandLine.toString() ); } exitCode = CommandLineUtils.executeCommandLine( checkinCurrentDirCommandLine, new CommandLineUtils.StringStreamConsumer(), stderr ); } } } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing clearcase command.", ex ); } if ( exitCode != 0 ) { return new StatusScmResult( cl.toString(), "The cleartool command failed.", stderr.getOutput(), false ); } return new StatusScmResult( cl.toString(), consumer.getAddedFiles() ); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static Commandline createCommandLine( ScmFileSet scmFileSet ) { Commandline command = new Commandline(); File workingDirectory = scmFileSet.getBasedir(); command.setWorkingDirectory( workingDirectory.getAbsolutePath() ); command.setExecutable( "cleartool" ); command.createArg().setValue( "mkelem" ); command.createArg().setValue( "-c" ); command.createArg().setValue( "new file" ); command.createArg().setValue( "-nco" ); File[] files = scmFileSet.getFiles(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; command.createArg().setValue( file.getName() ); } return command; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/ClearCaseScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000001502111051271441033433 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.clearcase.command.changelog.ClearCaseChangeLogCommand; import org.apache.maven.scm.provider.clearcase.command.checkin.ClearCaseCheckInCommand; import org.apache.maven.scm.provider.clearcase.command.checkout.ClearCaseCheckOutCommand; import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand; import org.apache.maven.scm.provider.clearcase.command.status.ClearCaseStatusCommand; import org.apache.maven.scm.provider.clearcase.command.tag.ClearCaseTagCommand; import org.apache.maven.scm.provider.clearcase.command.update.ClearCaseUpdateCommand; import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository; import org.apache.maven.scm.provider.clearcase.util.ClearCaseUtil; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @author Wim Deblauwe * @version $Id: ClearCaseScmProvider.java 686199 2008-08-15 12:14:25Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="clearcase" */ public class ClearCaseScmProvider extends AbstractScmProvider { // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- /** * Contains parameters loaded from clearcase-settings.xml */ private Settings settings; /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { settings = ClearCaseUtil.getSettings(); return new ClearCaseScmProviderRepository( getLogger(), scmSpecificUrl, settings ); } /** {@inheritDoc} */ public String getScmType() { return "clearcase"; } /** {@inheritDoc} */ public boolean requiresEditMode() { return true; } /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseChangeLogCommand command = new ClearCaseChangeLogCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseCheckInCommand command = new ClearCaseCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseCheckOutCommand command = new ClearCaseCheckOutCommand(); command.setLogger( getLogger() ); command.setSettings( settings ); return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseUpdateCommand command = new ClearCaseUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseTagCommand command = new ClearCaseTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseStatusCommand command = new ClearCaseStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { ClearCaseEditCommand command = new ClearCaseEditCommand(); command.setLogger( getLogger() ); return (EditScmResult) command.execute( repository, fileSet, parameters ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/util/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/util/ClearCaseUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000000632311057212425033443 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.util; /* * 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. */ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ResourceBundle; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.apache.maven.scm.providers.clearcase.settings.io.xpp3.ClearcaseXpp3Reader; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * @author Emmanuel Venisse * @version $Id: ClearCaseUtil.java 691185 2008-09-02 10:27:33Z vsiveton $ */ public class ClearCaseUtil { protected static final String CLEARCASE_SETTINGS_FILENAME = "clearcase-settings.xml"; public static final File DEFAULT_SETTINGS_DIRECTORY = new File( System.getProperty( "user.home" ), ".scm" ); private static File settingsDirectory = DEFAULT_SETTINGS_DIRECTORY; private static final String RESOURCE_FILENAME = "org.apache.maven.scm.provider.clearcase.command.clearcase"; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( RESOURCE_FILENAME ); private ClearCaseUtil() { } public static String getLocalizedResource( String key ) { return RESOURCE_BUNDLE.getString( key ); } public static Settings getSettings() { File settingsFile = new File( settingsDirectory, CLEARCASE_SETTINGS_FILENAME ); if ( !settingsFile.exists() ) { File scmGlobalDir = new File( System.getProperty( "maven.home" ), "conf" ); settingsFile = new File( scmGlobalDir, CLEARCASE_SETTINGS_FILENAME ); } if ( settingsFile.exists() ) { ClearcaseXpp3Reader reader = new ClearcaseXpp3Reader(); try { return reader.read( ReaderFactory.newXmlReader( settingsFile ) ); } catch ( FileNotFoundException e ) { // nop } catch ( IOException e ) { // nop } catch ( XmlPullParserException e ) { String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage(); System.out.println( message ); } } return new Settings(); } public static void setSettingsDirectory( File directory ) { settingsDirectory = directory; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000755000175000017500000000000011345536667033456 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/provider/clearcase/repository/ClearCaseScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/src/main/java/org/apache/maven/scm/pr0000644000175000017500000002722511057621704033453 0ustar twernertwernerpackage org.apache.maven.scm.provider.clearcase.repository; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.providers.clearcase.settings.Settings; import org.apache.maven.scm.repository.ScmRepositoryException; import java.io.File; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.UnknownHostException; import java.util.StringTokenizer; /** * Provider Repository for ClearCase (standard, LT, UCM) *

* Url format for ClearCase and ClearCaseLT :
* [view_name]:[configspec] or [view_name]|[configspec] *

* Url format for ClearCaseUCM :
* [view_name]|[configspec]|[vob_name]|[stream_name] or [view_name]:[configspec]:[vob_name]:[stream_name] *

* [configspec] can be used in two different ways: *

    *
  • Path to a config spec file that is * used when creating the snapshot view, e.g. * "\\myserver\clearcase\configspecs\my_module.txt", or:
  • *
  • A load rule that is used to automatically create a config spec, e.g. "load /MY_VOB/my/project/dir"
  • *
* Notice that checking out from a tag is currently only supported when the second option is used. * * @author Trygve Laugstøl * @version $Id: ClearCaseScmProviderRepository.java 483105 2006-12-06 15:07:54Z * evenisse $ */ public class ClearCaseScmProviderRepository extends ScmProviderRepository { private ScmLogger logger; private boolean viewNameGivenByUser = false; private String viewName; /** * The user-specified config spec; may be null. */ private File configSpec; /** * The directory to be loaded, when auto-generating the config spec. */ private String loadDirectory; /** * Describe the stream linked to the view. Only used with ClearCaseUCM */ private String streamName; /** * Describe the vob containing the stream. Only used with ClearCaseUCM */ private String vobName; /** * Provider configuration settings */ private Settings settings; /** * Describe the Element Name */ private String elementName; /** * Define the flag used in the clearcase-settings.xml when using ClearCaseLT */ public static final String CLEARCASE_LT = "LT"; /** * Define the flag used in the clearcase-settings.xml when using ClearCaseUCM */ public static final String CLEARCASE_UCM = "UCM"; /** * Define the default value from the clearcase-settings.xml when using ClearCase */ public static final String CLEARCASE_DEFAULT = null; public ClearCaseScmProviderRepository( ScmLogger logger, String url, Settings settings ) throws ScmRepositoryException { this.logger = logger; this.settings = settings; try { parseUrl( url ); } catch ( MalformedURLException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( URISyntaxException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } catch ( UnknownHostException e ) { throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" ); } } private void parseUrl( String url ) throws MalformedURLException, URISyntaxException, UnknownHostException { if ( url.indexOf( '|' ) != -1 ) { StringTokenizer tokenizer = new StringTokenizer( url, "|" ); fillInProperties( tokenizer ); } else { StringTokenizer tokenizer = new StringTokenizer( url, ":" ); fillInProperties( tokenizer ); } } private void fillInProperties( StringTokenizer tokenizer ) throws UnknownHostException, URISyntaxException, MalformedURLException { String configSpecString = null; if ( CLEARCASE_UCM.equals( settings.getClearcaseType() ) ) { configSpecString = fillUCMProperties( tokenizer ); } else { configSpecString = fillDefaultProperties( tokenizer ); } if ( !configSpecString.startsWith( "load " ) ) { configSpec = createConfigSpecFile( configSpecString ); loadDirectory = null; } else { configSpec = null; loadDirectory = configSpecString.substring( 5 ); } } private String fillDefaultProperties( StringTokenizer tokenizer ) throws UnknownHostException { int tokenNumber = tokenizer.countTokens(); String configSpecString; if ( tokenNumber == 1 ) { // No view name was given viewName = getDefaultViewName(); configSpecString = tokenizer.nextToken(); } else { configSpecString = checkViewName( tokenizer ); checkUnexpectedParameter( tokenizer, tokenNumber, 2 ); } if ( logger.isDebugEnabled() ) { logger.debug( "viewName = '" + viewName + "' ; configSpec = '" + configSpecString + "'" ); } return configSpecString; } private String fillUCMProperties( StringTokenizer tokenizer ) throws UnknownHostException, MalformedURLException { int tokenNumber = tokenizer.countTokens(); String directory; if ( tokenNumber <= 2 ) { throw new MalformedURLException( "ClearCaseUCM need more parameters. Expected url format : " + "[view_name]|[configspec]|[vob_name]|[stream_name]" ); } String configSpecString; if ( tokenNumber == 3 ) { // No view name was given viewName = getDefaultViewName(); configSpecString = tokenizer.nextToken(); vobName = tokenizer.nextToken(); streamName = tokenizer.nextToken(); } else if ( tokenNumber == 4 ) { String[] tokens = new String[4]; tokens[0] = tokenizer.nextToken(); tokens[1] = tokenizer.nextToken(); tokens[2] = tokenizer.nextToken(); tokens[3] = tokenizer.nextToken(); if ( tokens[3].startsWith( "/main/" ) ) { viewName = getDefaultViewName(); configSpecString = tokens[0]; vobName = tokens[1]; streamName = tokens[2]; elementName = tokens[3]; } else { viewName = tokens[0]; viewNameGivenByUser = true; configSpecString = tokens[1]; vobName = tokens[2]; streamName = tokens[3]; } } else { configSpecString = checkViewName( tokenizer ); vobName = tokenizer.nextToken(); streamName = tokenizer.nextToken(); elementName = tokenizer.nextToken(); checkUnexpectedParameter( tokenizer, tokenNumber, 5 ); } if ( logger.isInfoEnabled() ) { logger.info( "viewName = '" + viewName + "' ; configSpec = '" + configSpecString + "' ; vobName = '" + vobName + "' ; streamName = '" + streamName + "' ; elementName = '" + elementName + "'" ); } return configSpecString; } private String checkViewName( StringTokenizer tokenizer ) throws UnknownHostException { viewName = tokenizer.nextToken(); if ( viewName.length() > 0 ) { viewNameGivenByUser = true; } else { viewName = getDefaultViewName(); } return tokenizer.nextToken(); } private void checkUnexpectedParameter( StringTokenizer tokenizer, int tokenNumber, int maxTokenNumber ) { if ( tokenNumber > maxTokenNumber ) { String unexpectedToken = tokenizer.nextToken(); if ( logger.isInfoEnabled() ) { logger.info( "The SCM URL contains unused parameter : " + unexpectedToken ); } } } private File createConfigSpecFile( String spec ) throws URISyntaxException, MalformedURLException { File result; if ( spec.indexOf( ':' ) == -1 ) { result = new File( spec ); } else { result = new File( new URI( new URL( spec ).toString() ) ); } return result; } /** * Default: ${hostname}-{user.name}-maven * * @return the default view name */ private String getDefaultViewName() throws UnknownHostException { String username = System.getProperty( "user.name", "nouser" ); String hostname = getHostName(); return username + "-" + hostname + "-maven"; } private String getHostName() throws UnknownHostException { return InetAddress.getLocalHost().getHostName(); } /** * Returns the name of the view. If it is defined in the scm url, then it is returned as defined there. * If it is the default name, then the uniqueId is added * * @param uniqueId * @return the name of the view */ public String getViewName( String uniqueId ) { String result; if ( viewNameGivenByUser ) { result = viewName; } else { result = viewName + "-" + uniqueId; } return result; } /** * Returns the user-supplied config spec or null in case it * should be automatically generated * * @return File or null * @see #isAutoConfigSpec() */ public File getConfigSpec() { return configSpec; } /** * Returns true when the config spec has not been supplied by the user, but * instead should automatically be generated by the plugin * * @return true if auto config spec */ public boolean isAutoConfigSpec() { return configSpec == null; } /** * Returns the VOB directory to be loaded when auto-generating the config * spec. * * @return null when isAutoConfigSpec() returns false; * otherwise the VOB directory */ public String getLoadDirectory() { return loadDirectory; } public String getStreamName() { return streamName; } public String getVobName() { return vobName; } public String getElementName() { return elementName; } public boolean hasElements() { if ( elementName == null ) { return false; } return true; } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-clearcase/pom.xml0000644000175000017500000000452711322611461026062 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-clearcase Maven SCM Clearcase Provider SCM Provider implementation for Clearcase (http://www-306.ibm.com/software/awdtools/clearcase/). org.codehaus.plexus plexus-maven-plugin descriptor org.codehaus.modello modello-maven-plugin java xpp3-reader xsd 1.1.0 src/main/mdo/clearcase-settings.mdo maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/0000755000175000017500000000000011345536671023425 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/0000755000175000017500000000000011345536671024214 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/0000755000175000017500000000000011345536670025172 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/0000755000175000017500000000000011345536670026113 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/0000755000175000017500000000000011345536670026702 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/0000755000175000017500000000000011345536670030123 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/0000755000175000017500000000000011345536670031231 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536670032013 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536670033566 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536670033566 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536671033567 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000274511244567275033603 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsCheckInCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsCheckInCommand().createCommand( repo, getScmFileSet(), "A comment of many words" ).getCommandline(); String expected = "tf checkin -login:user,password -noprompt -comment:\"A comment of many words\" " + getFileList(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000001116711244567275033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; import org.codehaus.plexus.util.cli.Commandline; public class TfsCheckOutCommandTest extends TfsCommandTest { private FileListConsumer consumer; protected void setUp() throws Exception { super.setUp(); consumer = new FileListConsumer(); } public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); ScmRevision rev = new ScmRevision( "revision" ); String path = getScmFileSet().getBasedir().getAbsolutePath(); Commandline cmd = new TfsCheckOutCommand().createGetCommand( repo, getScmFileSet(), rev, true ).getCommandline(); String expected = "tf get -login:user,password -recursive -force -version:Crevision " + path; assertCommandLine( expected, getWorkingDirectory(), cmd ); } public void testCommand() { consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing .tpattributes" ); consumer.consumeLine( "Replacing .classpath" ); consumer.consumeLine( "Replacing .myclasspath" ); consumer.consumeLine( "Replacing .project" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8\\.settings:" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing .tpignore" ); consumer.consumeLine( "Replacing about.html" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8\\bin:" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing build.properties" ); consumer.consumeLine( "Replacing customBuildCallbacks.xml" ); consumer.consumeLine( "" ); String exp1 = new File( "C:\\temp\\maven\\c8", ".classpath" ).getAbsolutePath(); String exp2 = new File( "C:\\temp\\maven\\c8", "build.properties" ).getAbsolutePath(); ScmFile expFile1 = new ScmFile( exp1, ScmFileStatus.CHECKED_OUT ); ScmFile expFile2 = new ScmFile( exp2, ScmFileStatus.CHECKED_OUT ); assertNotNull( consumer.getFiles() ); assertEquals( 11, consumer.getFiles().size() ); assertTrue( consumer.getFiles().contains( expFile1 ) ); assertTrue( consumer.getFiles().contains( expFile2 ) ); } public void testMSCommand() { consumer.consumeLine( "c:\\temp\\maven:" ); consumer.consumeLine( "Replacing c10" ); consumer.consumeLine( "Replacing .classpath" ); consumer.consumeLine( "Replacing .myclasspath" ); consumer.consumeLine( "Replacing .project" ); consumer.consumeLine( "Replacing .settings" ); consumer.consumeLine( "Replacing .tpattributes" ); consumer.consumeLine( "Replacing .tpignore" ); consumer.consumeLine( "Replacing about.html" ); consumer.consumeLine( "Replacing bin" ); consumer.consumeLine( "Replacing build.properties" ); assertNotNull( consumer.getFiles() ); String exp1 = new File( "c:\\temp\\maven", ".classpath" ).getAbsolutePath(); String exp2 = new File( "c:\\temp\\maven", ".project" ).getAbsolutePath(); ScmFile expFile1 = new ScmFile( exp1, ScmFileStatus.CHECKED_OUT ); ScmFile expFile2 = new ScmFile( exp2, ScmFileStatus.CHECKED_OUT ); assertEquals( 11, consumer.getFiles().size() ); assertTrue( consumer.getFiles().contains( expFile1 ) ); assertTrue( consumer.getFiles().contains(expFile2) ); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsListCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000721011244567275033573 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ServerFileListConsumer; import org.codehaus.plexus.util.cli.Commandline; public class TfsListCommandTest extends TfsCommandTest { private ServerFileListConsumer consumer; protected void setUp() throws Exception { super.setUp(); consumer = new ServerFileListConsumer(); } public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsListCommand().createCommand( repo, getScmFileSet(), true ).getCommandline(); String expected = "tf dir -login:user,password -recursive " + getFileList(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } public void testMSCommand() { consumer.consumeLine( "$/junk/com.teamprise.core/libs/xstream-1.1.3/lib:" ); consumer.consumeLine( "xpp3-1.1.3.4d_b4_min.jar" ); consumer.consumeLine( "xpp3-license.txt" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/com.teamprise.core/messages:" ); consumer.consumeLine( "$com" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/com.teamprise.core/messages/com:" ); consumer.consumeLine( "$teamprise" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/com.teamprise.core/messages/com/teamprise:" ); consumer.consumeLine( "$core" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/com.teamprise.core/messages/com/teamprise/core:" ); consumer.consumeLine( "$pguidance" ); consumer.consumeLine( "$workitem" ); assertNotNull( consumer.getFiles() ); assertEquals( 9, consumer.getFiles().size() ); assertTrue( consumer.getFiles().contains( new ScmFile( "$/junk/com.teamprise.core/libs/xstream-1.1.3/lib/xpp3-license.txt", ScmFileStatus.CHECKED_OUT ) ) ); assertTrue( consumer.getFiles().contains( new ScmFile( "$/junk/com.teamprise.core/messages/com", ScmFileStatus.CHECKED_OUT ) ) ); assertTrue( consumer.getFiles().contains( new ScmFile( "$/junk/com.teamprise.core/messages/com/teamprise/core/pguidance", ScmFileStatus.CHECKED_OUT ) ) ); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsStatusCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000001416411244567275033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.util.List; import java.util.Locale; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer; import org.codehaus.plexus.util.cli.Commandline; public class TfsStatusCommandTest extends TfsCommandTest { private ChangedFileConsumer consumer; private Locale defaultLocale; protected void setUp() throws Exception { super.setUp(); consumer = new ChangedFileConsumer( new DefaultLog() ); defaultLocale = Locale.getDefault(); } public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsStatusCommand().createCommand( repo, getScmFileSet() ).getCommandline(); String expected = "tf status -login:user,password -workspace:workspace -recursive -format:detailed " + repo.getServerPath(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } protected void tearDown() throws Exception { Locale.setDefault( defaultLocale ); } public void testCommand() { consumer.consumeLine( "$/junk/pluginp/.classpath;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: Mar 12, 2009 2:18:31 AM" ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\.classpath" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/pluginp/.project;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: Mar 12, 2009 2:18:31 AM" ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\.project" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/pluginp/build.properties;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: Mar 12, 2009 2:18:31 AM" ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\build.properties" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/pluginp/META-INF/MANIFEST.MF;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: Mar 12, 2009 2:18:31 AM" ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\META-INF\\MANIFEST.MF" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); List changedFiles = consumer.getChangedFiles(); assertNotNull( changedFiles ); assertEquals( 4, changedFiles.size() ); assertTrue( changedFiles.contains( new ScmFile( "C:\\temp\\maven\\c4\\.classpath", ScmFileStatus.MODIFIED ) ) ); assertTrue( changedFiles.contains( new ScmFile( "C:\\temp\\maven\\c4\\META-INF\\MANIFEST.MF", ScmFileStatus.MODIFIED ) ) ); } public void testLocale() { Locale.setDefault( Locale.GERMAN ); String date = "12.03.2009 02:18:31"; consumer.consumeLine( "$/junk/pluginp/.classpath;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: " + date ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\.classpath" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); consumer.consumeLine( "$/junk/pluginp/.project;C1858" ); consumer.consumeLine( " User: CDESG\\subhash" ); consumer.consumeLine( " Date: " + date ); consumer.consumeLine( " Lock: none" ); consumer.consumeLine( " Change: edit" ); consumer.consumeLine( " Workspace: purinaTest" ); consumer.consumeLine( " Local item: [SUBHASH-PC] C:\\temp\\maven\\c4\\.project" ); consumer.consumeLine( " File type: windows-1252" ); consumer.consumeLine( "" ); List changedFiles = consumer.getChangedFiles(); assertNotNull( changedFiles ); assertEquals( 2, changedFiles.size() ); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000273311244567275033600 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsBranchCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsBranchCommand().createCommand( repo, getScmFileSet(), "branch" ).getCommandline(); String path = getScmFileSet().getBasedir().getAbsolutePath(); String expected = "tf branch -login:user,password " + path + " -checkin branch"; assertCommandLine( expected, getWorkingDirectory(), cmd ); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000001073511244567275033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; import org.codehaus.plexus.util.cli.Commandline; public class TfsChangeLogCommandTest extends TfsCommandTest { private FileListConsumer consumer; protected void setUp() throws Exception { super.setUp(); consumer = new FileListConsumer(); } public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); File f = new File( "file" ); Commandline cmd = new TfsChangeLogCommand().createCommand( repo, getScmFileSet(), f ).getCommandline(); String expected = "tf history -login:user,password -format:detailed " + f.getName(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } public void testCommand() { consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing .tpattributes" ); consumer.consumeLine( "Replacing .classpath" ); consumer.consumeLine( "Replacing .myclasspath" ); consumer.consumeLine( "Replacing .project" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8\\.settings:" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing .tpignore" ); consumer.consumeLine( "Replacing about.html" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8\\bin:" ); consumer.consumeLine( "" ); consumer.consumeLine( "C:\\temp\\maven\\c8:" ); consumer.consumeLine( "Replacing build.properties" ); consumer.consumeLine( "Replacing customBuildCallbacks.xml" ); consumer.consumeLine( "" ); String exp1 = new File( "C:\\temp\\maven\\c8", ".classpath" ).getAbsolutePath(); String exp2 = new File( "C:\\temp\\maven\\c8", "build.properties" ).getAbsolutePath(); ScmFile expFile1 = new ScmFile( exp1, ScmFileStatus.CHECKED_OUT ); ScmFile expFile2 = new ScmFile( exp2, ScmFileStatus.CHECKED_OUT ); assertNotNull( consumer.getFiles() ); assertEquals( 11, consumer.getFiles().size() ); assertTrue( consumer.getFiles().contains( expFile1 ) ); assertTrue( consumer.getFiles().contains( expFile2 ) ); } public void testMSCommand() { consumer.consumeLine( "c:\\temp\\maven:" ); consumer.consumeLine( "Replacing c10" ); consumer.consumeLine( "Replacing .classpath" ); consumer.consumeLine( "Replacing .myclasspath" ); consumer.consumeLine( "Replacing .project" ); consumer.consumeLine( "Replacing .settings" ); consumer.consumeLine( "Replacing .tpattributes" ); consumer.consumeLine( "Replacing .tpignore" ); consumer.consumeLine( "Replacing about.html" ); consumer.consumeLine( "Replacing bin" ); consumer.consumeLine( "Replacing build.properties" ); String exp1 = new File( "c:\\temp\\maven", ".classpath" ).getAbsolutePath(); String exp2 = new File( "c:\\temp\\maven", ".project" ).getAbsolutePath(); ScmFile expFile1 = new ScmFile( exp1, ScmFileStatus.CHECKED_OUT ); ScmFile expFile2 = new ScmFile( exp2, ScmFileStatus.CHECKED_OUT ); assertNotNull( consumer.getFiles() ); assertEquals( 11, consumer.getFiles().size() ); assertTrue( consumer.getFiles().contains( expFile1 ) ); assertTrue( consumer.getFiles().contains( expFile2 ) ); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000425211263356573033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; import org.codehaus.plexus.util.cli.Commandline; public class TfsEditCommandTest extends TfsCommandTest { private FileListConsumer consumer; protected void setUp() throws Exception { super.setUp(); consumer = new FileListConsumer(); } public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsEditCommand().createCommand( repo, getScmFileSet() ).getCommandline(); String expected = "tf checkout -login:user,password " + getFileList(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } public void testCommand() { consumer.consumeLine( ".classpath" ); consumer.consumeLine( ".project" ); consumer.consumeLine( "build.properties" ); consumer.consumeLine( "" ); consumer.consumeLine( "META-INF:" ); consumer.consumeLine( "MANIFEST.MF" ); consumer.consumeLine( "" ); consumer.consumeLine( "src\\pluginp:" ); consumer.consumeLine( "Activator.java" ); assertNotNull( consumer.getFiles() ); assertEquals( 7, consumer.getFiles().size() ); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsUnEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000257511244567275033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsUnEditCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsUnEditCommand().createCommand( repo, getScmFileSet() ).getCommandline(); String expected = "tf undo -login:user,password " + getFileList(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000303611244567275033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsUpdateCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); ScmRevision rev = new ScmRevision( "revision" ); Commandline cmd = new TfsUpdateCommand().createCommand( repo, getScmFileSet(), rev ).getCommandline(); String path = repo.getServerPath(); String expected = "tf get -login:user,password " + path + " -version:Crevision"; assertCommandLine( expected, getWorkingDirectory(), cmd ); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000256611244567275033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsAddCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); Commandline cmd = new TfsAddCommand().createCommand( repo, getScmFileSet() ).getCommandline(); String expected = "tf add -login:user,password " + getFileList(); assertCommandLine( expected, getWorkingDirectory(), cmd ); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000344111244566320033563 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.io.File; import java.util.Iterator; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; public class TfsCommandTest extends ScmTestCase { protected TfsScmProviderRepository getScmProviderRepository() { return new TfsScmProviderRepository( "http://tfsurl", "user", "password", "serverpath", "workspace" ); } protected String getFileList() { String path = ""; for ( Iterator i = getScmFileSet().getFileList().iterator(); i.hasNext(); ) { File f = (File) i.next(); path += f.getName() + " "; } return path.trim(); } protected ScmFileSet getScmFileSet() { return new ScmFileSet( getWorkingDirectory(), new File( "file" ) ); } public void testFileList() { assertTrue( getScmFileSet().getFileList().size() > 0 ); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider/tfs/command/TfsTagCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000315711244567275033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.codehaus.plexus.util.cli.Commandline; public class TfsTagCommandTest extends TfsCommandTest { public void testCommandline() { TfsScmProviderRepository repo = getScmProviderRepository(); ScmTagParameters param = new ScmTagParameters( "Message of many words" ); Commandline cmd = new TfsTagCommand().createCommand( repo, getScmFileSet(), "tag", param ).getCommandline(); String expected = "tf label -login:user,password tag " + repo.getServerPath() + " -recursive -child:replace -comment:\"Message of many words\""; assertCommandLine( expected, getWorkingDirectory(), cmd ); } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/0000755000175000017500000000000011345536671025140 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/0000755000175000017500000000000011345536671026061 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/0000755000175000017500000000000011345536671026650 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/0000755000175000017500000000000011345536671030071 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/0000755000175000017500000000000011345536671031177 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536671031761 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536671033534 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536671033534 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002410011263356573033533 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs; /* * 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. */ import java.net.URI; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.TfsAddCommand; import org.apache.maven.scm.provider.tfs.command.TfsBranchCommand; import org.apache.maven.scm.provider.tfs.command.TfsChangeLogCommand; import org.apache.maven.scm.provider.tfs.command.TfsCheckInCommand; import org.apache.maven.scm.provider.tfs.command.TfsCheckOutCommand; import org.apache.maven.scm.provider.tfs.command.TfsEditCommand; import org.apache.maven.scm.provider.tfs.command.TfsListCommand; import org.apache.maven.scm.provider.tfs.command.TfsStatusCommand; import org.apache.maven.scm.provider.tfs.command.TfsTagCommand; import org.apache.maven.scm.provider.tfs.command.TfsUnEditCommand; import org.apache.maven.scm.provider.tfs.command.TfsUpdateCommand; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="tfs" */ public class TfsScmProvider extends AbstractScmProvider { public static final String TFS_URL_FORMAT = "[[domain\\]username[;password]@]http[s]://server_name[:port]:workspace:$/TeamProject/Path/To/Project"; // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- public String getScmType() { return "tfs"; } public ScmProviderRepository makeProviderScmRepository( String scmUrl, char delimiter ) throws ScmRepositoryException { // Look for the TFS URL after any '@' delmiter used to pass // usernames/password etc // We deliberately look for the last '@' character as username could // contain an '@' also. int lastAtPos = scmUrl.lastIndexOf( '@' ); getLogger().info( "scmUrl - " + scmUrl ); String tfsUrl = ( lastAtPos < 0 ) ? scmUrl : scmUrl.substring( lastAtPos + 1 ); String usernamePassword = ( lastAtPos < 0 ) ? null : scmUrl.substring( 0, lastAtPos ); // Look for TFS path after the end of the TFS URL int tfsPathPos = tfsUrl.lastIndexOf( delimiter + "$/" ); String serverPath = "$/"; if ( tfsPathPos > 0 ) { serverPath = tfsUrl.substring( tfsPathPos + 1 ); tfsUrl = tfsUrl.substring( 0, tfsPathPos ); } // Look for workspace ater the end of the TFS URL int workspacePos = tfsUrl.lastIndexOf( delimiter ); String workspace = tfsUrl.substring( workspacePos + 1 ); tfsUrl = tfsUrl.substring( 0, workspacePos ); try { // Use URI's validation to determine if valid URI. URI tfsUri = URI.create( tfsUrl ); String scheme = tfsUri.getScheme(); getLogger().info( "Scheme - " + scheme ); if ( scheme == null || !( scheme.equalsIgnoreCase( "http" ) || scheme.equalsIgnoreCase( "https" ) ) ) { throw new ScmRepositoryException( "TFS Url \"" + tfsUrl + "\" is not a valid URL. " + "The TFS Url syntax is " + TFS_URL_FORMAT ); } } catch ( IllegalArgumentException e ) { throw new ScmRepositoryException( "TFS Url \"" + tfsUrl + "\" is not a valid URL. The TFS Url syntax is " + TFS_URL_FORMAT ); } String username = null; String password = null; if ( usernamePassword != null ) { // Deliberately not using .split here in case password contains a // ';' int delimPos = usernamePassword.indexOf( ';' ); username = ( delimPos < 0 ) ? usernamePassword : usernamePassword.substring( 0, delimPos ); password = ( delimPos < 0 ) ? null : usernamePassword.substring( delimPos + 1 ); } return new TfsScmProviderRepository( tfsUrl, username, password, serverPath, workspace ); } protected ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsChangeLogCommand command = new TfsChangeLogCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsCheckOutCommand command = new TfsCheckOutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); } protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsEditCommand command = new TfsEditCommand(); command.setLogger( getLogger() ); return (EditScmResult) command.execute( repository, fileSet, parameters ); } protected UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsUnEditCommand command = new TfsUnEditCommand(); command.setLogger( getLogger() ); return (UnEditScmResult) command.execute( repository, fileSet, parameters ); } protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsStatusCommand command = new TfsStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, parameters ); } protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsUpdateCommand command = new TfsUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, parameters ); } protected CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsCheckInCommand command = new TfsCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, parameters ); } protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsAddCommand command = new TfsAddCommand(); command.setLogger( getLogger() ); return (AddScmResult) command.execute( repository, fileSet, parameters ); } protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsTagCommand command = new TfsTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, parameters ); } protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsBranchCommand command = new TfsBranchCommand(); command.setLogger( getLogger() ); return (BranchScmResult) command.execute( repository, fileSet, parameters ); } protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { TfsListCommand command = new TfsListCommand(); command.setLogger( getLogger() ); return (ListScmResult) command.execute( repository, fileSet, parameters ); } protected DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { // Because tf launches only external diffs return super.diff( repository, fileSet, parameters ); } protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { // Use checkout instead return super.export( repository, fileSet, parameters ); } }././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536671033534 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000476711244567275033556 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; public class TfsCheckInCommand extends AbstractCheckInCommand { protected CheckInScmResult executeCheckInCommand( ScmProviderRepository r, ScmFileSet f, String m, ScmVersion v ) throws ScmException { TfsCommand command = createCommand( r, f, m ); FileListConsumer fileConsumer = new FileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( fileConsumer, err ); if ( status != 0 || err.hasBeenFed() ) { return new CheckInScmResult( command.getCommandString(), "Error code for TFS checkin command - " + status, err.getOutput(), false ); } return new CheckInScmResult( command.getCommandString(), fileConsumer.getFiles() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String m ) { TfsCommand command = new TfsCommand( "checkin", r, f, getLogger() ); command.addArgument( "-noprompt" ); if ( m != null && !m.equals( "" ) ) { command.addArgument( "-comment:" + m + "" ); } command.addArgument( f ); return command; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000630511244567275033544 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.TfsChangeLogConsumer; public class TfsChangeLogCommand extends AbstractChangeLogCommand { protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository r, ScmFileSet f, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { ArrayList changeLogs = new ArrayList(); Iterator iter = f.getFileList().iterator(); if ( !iter.hasNext() ) { ArrayList dir = new ArrayList(); // No files to iterate dir.add( f.getBasedir() ); iter = dir.iterator(); } TfsCommand command = null; // tf history takes only one file arg while ( iter.hasNext() ) { TfsChangeLogConsumer out = new TfsChangeLogConsumer( getLogger() ); ErrorStreamConsumer err = new ErrorStreamConsumer(); command = createCommand( r, f, ( (File) iter.next() ) ); int status = command.execute( out, err ); if ( status != 0 || ( !out.hasBeenFed() && err.hasBeenFed() ) ) return new ChangeLogScmResult( command.getCommandString(), "Error code for TFS changelog command - " + status, err.getOutput(), false ); changeLogs.addAll( out.getLogs() ); } return new ChangeLogScmResult( command.getCommandString(), new ChangeLogSet( changeLogs, startDate, endDate ) ); } protected TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, File file ) { TfsCommand command = new TfsCommand( "history", r, f, getLogger() ); command.addArgument( "-format:detailed" ); command.addArgument( file.getName() ); return command; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536671033534 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000442511250043347033527 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command.consumer; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.codehaus.plexus.util.cli.StreamConsumer; public class FileListConsumer implements StreamConsumer { private boolean fed = false; protected String currentDir = ""; private ArrayList files = new ArrayList(); public void consumeLine( String line ) { fed = true; if ( line.endsWith( ":" ) ) { currentDir = line.substring( 0, line.lastIndexOf( ':' ) ); ScmFile scmFile = new ScmFile( currentDir, ScmFileStatus.CHECKED_OUT ); if ( !files.contains( scmFile ) ) { files.add( scmFile ); } } else if ( line.trim().equals( "" ) ) { currentDir = ""; } else if ( !currentDir.equals( "" ) && line.indexOf( " " ) >= 0 ) { String filename = line.split( " " )[1]; files.add( getScmFile( filename ) ); } else { files.add( getScmFile( line ) ); } } protected ScmFile getScmFile( String filename ) { return new ScmFile( new File( currentDir, filename ).getAbsolutePath(), ScmFileStatus.CHECKED_OUT ); } public List getFiles() { return files; } public boolean hasBeenFed() { return fed; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ErrorStreamConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000231111244566320033523 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command.consumer; /* * 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. */ import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; public class ErrorStreamConsumer extends StringStreamConsumer { private boolean fed = false; public void consumeLine( String line ) { fed = true; super.consumeLine( line ); } public boolean hasBeenFed() { return fed; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/TfsChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001407011244567275033542 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command.consumer; /* * 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. */ import java.text.DateFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; public class TfsChangeLogConsumer extends AbstractConsumer { private static final String PATTERN = "^[^:]*:[ \t]([0-9]*)\n" + "[^:]*:[ \t](.*)\n[^:]*:[ \t](.*)\n" + "[^:]*:((?:\n.*)*)\n\n[^\n :]*:(?=\n )((?:\n[ \t]+.*)*)"; private static final String PATTERN_ITEM = "\n ([^$]+) (\\$/.*)"; ArrayList logs = new ArrayList(); String buffer = ""; boolean fed = false; public TfsChangeLogConsumer( ScmLogger logger ) { super( logger ); } public void consumeLine( String line ) { fed = true; if ( line.startsWith( "-----" ) ) { addChangeLog(); } buffer += line + "\n"; } public List getLogs() { addChangeLog(); return logs; } private void addChangeLog() { if ( !buffer.equals( "" ) ) { Pattern p = Pattern.compile( PATTERN ); Matcher m = p.matcher( buffer ); if ( m.find() ) { String revision = m.group( 1 ).trim(); String username = m.group( 2 ).trim(); String dateString = m.group( 3 ).trim(); String comment = m.group( 4 ).trim(); Pattern itemPattern = Pattern.compile( PATTERN_ITEM ); Matcher itemMatcher = itemPattern.matcher( m.group( 5 ) ); List files = new ArrayList(); while ( itemMatcher.find() ) { ChangeFile file = new ChangeFile( itemMatcher.group( 2 ).trim(), revision ); files.add( file ); } Date date; try { date = parseDate( dateString ); } catch ( ParseException e ) { getLogger().error( "Date parse error", e ); throw new RuntimeException( e ); } ChangeSet change = new ChangeSet( date, comment, username, files ); logs.add( change ); } buffer = ""; } } public boolean hasBeenFed() { return fed; } protected static Date parseDate( String dateString ) throws ParseException { Date date = null; try { // Use the depricated Date.parse method as this is very good at // detecting // dates commonly output by the US and UK standard locales of // dotnet that // are output by the Microsoft command line client. date = new Date( Date.parse( dateString ) ); } catch ( IllegalArgumentException e ) { // ignore - parse failed. } if ( date == null ) { // The old fashioned way did not work. Let's try it using a more // complex // alternative. DateFormat[] formats = createDateFormatsForLocaleAndTimeZone( null, null ); return parseWithFormats( dateString, formats ); } return date; } private static Date parseWithFormats( String input, DateFormat[] formats ) throws ParseException { ParseException parseException = null; for ( int i = 0; i < formats.length; i++ ) { try { return formats[i].parse( input ); } catch ( ParseException ex ) { parseException = ex; } } throw parseException; } /** * Build an array of DateFormats that are commonly used for this locale and timezone. */ private static DateFormat[] createDateFormatsForLocaleAndTimeZone( Locale locale, TimeZone timeZone ) { if ( locale == null ) { locale = Locale.getDefault(); } if ( timeZone == null ) { timeZone = TimeZone.getDefault(); } List formats = new ArrayList(); for ( int dateStyle = DateFormat.FULL; dateStyle <= DateFormat.SHORT; dateStyle++ ) { for ( int timeStyle = DateFormat.FULL; timeStyle <= DateFormat.SHORT; timeStyle++ ) { DateFormat df = DateFormat.getDateTimeInstance( dateStyle, timeStyle, locale ); if ( timeZone != null ) { df.setTimeZone( timeZone ); } formats.add( df ); } } for ( int dateStyle = DateFormat.FULL; dateStyle <= DateFormat.SHORT; dateStyle++ ) { DateFormat df = DateFormat.getDateInstance( dateStyle, locale ); df.setTimeZone( timeZone ); formats.add( df ); } return (DateFormat[]) formats.toArray( new DateFormat[formats.size()] ); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ServerFileListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000261611250043347033527 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command.consumer; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.codehaus.plexus.util.StringUtils; public class ServerFileListConsumer extends FileListConsumer { protected ScmFile getScmFile( String filename ) { if ( filename.startsWith( "$" ) ) { filename = StringUtils.replace( filename, "$", "", -1 ); //filename = filename.replace( "$", "" ); } String path = currentDir + "/" + filename; return new ScmFile( path, ScmFileStatus.UNKNOWN ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000601111250043347033520 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command.consumer; /* * 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. */ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.StreamConsumer; public class ChangedFileConsumer implements StreamConsumer { private ScmLogger logger; private static final String KEY_CHANGE = "Change"; private static final String KEY_LOCAL_ITEM = "Local item"; private static final String CHANGE_EDIT = "edit"; private static final String CHANGE_ADD = "add"; private HashMap values = new HashMap(); private ArrayList changedFiles = new ArrayList(); public ChangedFileConsumer( ScmLogger logger ) { this.logger = logger; } public void consumeLine( String line ) { if ( line.indexOf( ":" ) >= 0 ) { String[] s = line.split( ":", 2 ); if ( s.length > 1 ) values.put( s[0].trim(), s[1].trim() ); } if ( line.trim().equals( "" ) ) { extractChangedFile(); } logger.debug( "line -" + line ); } private void extractChangedFile() { String change = getChange(); if ( change != null ) { ScmFileStatus stat = ScmFileStatus.UNKNOWN; if ( change.equals( ChangedFileConsumer.CHANGE_EDIT ) ) stat = ScmFileStatus.MODIFIED; if ( change.equals( ChangedFileConsumer.CHANGE_ADD ) ) stat = ScmFileStatus.ADDED; changedFiles.add( new ScmFile( getLocalPath(), stat ) ); values.clear(); } } public List getChangedFiles() { if ( values.size() > 0 ) { extractChangedFile(); } return changedFiles; } private String getChange() { return (String) values.get( KEY_CHANGE ); } private String getLocalPath() { String local = (String) values.get( KEY_LOCAL_ITEM ); if ( local != null ) { local = local.split( "]", 2 )[1].trim(); } return local; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000447111244567275033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.edit.AbstractEditCommand; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; //Usage: mvn scm:edit -DworkingDirectory= -Dincludes=* public class TfsEditCommand extends AbstractEditCommand { protected ScmResult executeEditCommand( ScmProviderRepository r, ScmFileSet f ) throws ScmException { FileListConsumer out = new FileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); TfsCommand command = createCommand( r, f ); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new EditScmResult( command.getCommandString(), "Error code for TFS edit command - " + status, err.getOutput(), false ); } return new EditScmResult( command.getCommandString(), out.getFiles() ); } protected TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f ) { TfsCommand command = new TfsCommand( "checkout", r, f, getLogger() ); command.addArgument( f ); return command; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000770411244567275033550 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.io.File; import java.util.Iterator; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; public class TfsCommand { private ScmLogger logger; private Commandline command; public TfsCommand( String cmd, ScmProviderRepository r, ScmFileSet f, ScmLogger logger ) { command = new Commandline(); command.setExecutable( "tf" ); if ( f != null ) { command.setWorkingDirectory( f.getBasedir().getAbsolutePath() ); } command.createArg().setValue( cmd ); if ( r.getUser() != null ) { command.createArg().setValue( "-login:" + r.getUser() + "," + r.getPassword() ); } this.logger = logger; } public void addArgument( ScmFileSet f ) { info( "files: " + f.getBasedir().getAbsolutePath() ); Iterator iter = f.getFileList().iterator(); while ( iter.hasNext() ) { command.createArg().setValue( ( (File) iter.next() ).getPath() ); } } public void addArgument( String s ) { command.createArg().setValue( s ); } public int execute( StreamConsumer out, ErrorStreamConsumer err ) throws ScmException { info( "Command line - " + getCommandString() ); int status; try { status = CommandLineUtils.executeCommandLine( command, out, err ); } catch ( CommandLineException e ) { throw new ScmException( "Error while executing TFS command line - " + getCommandString(), e ); } info( "err - " + err.getOutput() ); if ( out instanceof StringStreamConsumer ) { StringStreamConsumer sc = (StringStreamConsumer) out; debug( sc.getOutput() ); } if ( out instanceof FileListConsumer ) { FileListConsumer f = (FileListConsumer) out; for ( Iterator i = f.getFiles().iterator(); i.hasNext(); ) { ScmFile file = (ScmFile) i.next(); debug( file.getPath() ); } } return status; } public String getCommandString() { return command.toString(); } public Commandline getCommandline() { return command; } private void info( String message ) { if ( logger != null ) logger.info( message ); } private void debug( String message ) { if ( logger != null ) logger.debug( message ); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001346111244567275033545 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; // Usage: mvn scm:checkout -DcheckoutDirectory= public class TfsCheckOutCommand extends AbstractCheckOutCommand { protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository r, ScmFileSet f, ScmVersion v, boolean recursive ) throws ScmException { TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r; String url = tfsRepo.getServerPath(); String tfsUrl = tfsRepo.getTfsUrl(); String workspace = tfsRepo.getWorkspace(); // Try creating workspace boolean workspaceProvided = workspace != null && !workspace.trim().equals( "" ); if ( workspaceProvided ) { createWorkspace( r, f, workspace, tfsUrl ); } TfsCommand command; int status; if ( workspaceProvided ) { status = executeUnmapCommand( r, f ); } ErrorStreamConsumer out = new ErrorStreamConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); if ( workspaceProvided ) { command = new TfsCommand( "workfold", r, null, getLogger() ); command.addArgument( "-workspace:" + workspace ); command.addArgument( "-map" ); command.addArgument( url ); command.addArgument( f.getBasedir().getAbsolutePath() ); status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new CheckOutScmResult( command.getCommandString(), "Error code for TFS checkout (workfold map) command - " + status, err.getOutput(), false ); } } FileListConsumer fileConsumer = new FileListConsumer(); err = new ErrorStreamConsumer(); command = createGetCommand( r, f, v, recursive ); status = command.execute( fileConsumer, err ); if ( status != 0 || err.hasBeenFed() ) { return new CheckOutScmResult( command.getCommandString(), "Error code for TFS checkout (get) command - " + status, err.getOutput(), false ); } return new CheckOutScmResult( command.getCommandString(), fileConsumer.getFiles() ); } public TfsCommand createGetCommand( ScmProviderRepository r, ScmFileSet f, ScmVersion v, boolean recursive ) { TfsCommand command = new TfsCommand( "get", r, f, getLogger() ); if ( recursive ) { command.addArgument( "-recursive" ); } command.addArgument( "-force" ); if ( v != null && !v.equals( "" ) ) { String vType = ""; if ( v.getType().equals( "Tag" ) ) { vType = "L"; } if ( v.getType().equals( "Revision" ) ) { vType = "C"; } command.addArgument( "-version:" + vType + v.getName() ); } command.addArgument( f.getBasedir().getAbsolutePath() ); return command; } public int executeUnmapCommand( ScmProviderRepository r, ScmFileSet f ) throws ScmException { TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r; String url = tfsRepo.getServerPath(); String workspace = tfsRepo.getWorkspace(); ErrorStreamConsumer out = new ErrorStreamConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); TfsCommand command = new TfsCommand( "workfold", r, null, getLogger() ); command.addArgument( "-workspace:" + workspace ); command.addArgument( "-unmap" ); command.addArgument( url ); return command.execute( out, err ); } private void createWorkspace( ScmProviderRepository r, ScmFileSet f, String workspace, String url ) throws ScmException { ErrorStreamConsumer out = new ErrorStreamConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); // Checkout dir may not exist yet TfsCommand command = new TfsCommand( "workspace", r, null, getLogger() ); command.addArgument( "-new" ); command.addArgument( "-comment:Creating workspace for maven command" ); command.addArgument( "-server:" + url ); command.addArgument( workspace ); command.execute( out, err ); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000606111244567275033543 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.util.Iterator; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; public class TfsStatusCommand extends AbstractStatusCommand { protected StatusScmResult executeStatusCommand( ScmProviderRepository r, ScmFileSet f ) throws ScmException { TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r; TfsCommand command = createCommand( tfsRepo, f ); ChangedFileConsumer out = new ChangedFileConsumer( getLogger() ); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new StatusScmResult( command.getCommandString(), "Error code for TFS status command - " + status, err.getOutput(), false ); } Iterator iter = out.getChangedFiles().iterator(); getLogger().debug( "Iterating" ); while ( iter.hasNext() ) { ScmFile file = (ScmFile) iter.next(); getLogger().debug( file.getPath() + ":" + file.getStatus() ); } return new StatusScmResult( command.getCommandString(), out.getChangedFiles() ); } public TfsCommand createCommand( TfsScmProviderRepository r, ScmFileSet f ) { String url = r.getServerPath(); String workspace = r.getWorkspace(); TfsCommand command = new TfsCommand( "status", r, f, getLogger() ); if ( workspace != null && !workspace.trim().equals( "" ) ) { command.addArgument( "-workspace:" + workspace ); } command.addArgument( "-recursive" ); command.addArgument( "-format:detailed" ); command.addArgument( url ); return command; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsBranchCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000470511244567275033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import java.util.ArrayList; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.branch.AbstractBranchCommand; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; public class TfsBranchCommand extends AbstractBranchCommand { protected ScmResult executeBranchCommand( ScmProviderRepository r, ScmFileSet f, String branch, String message ) throws ScmException { TfsCommand command = createCommand( r, f, branch ); StringStreamConsumer out = new StringStreamConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new BranchScmResult( command.getCommandString(), "Error code for TFS branch command - " + status, err.getOutput(), false ); } return new BranchScmResult( command.getCommandString(), new ArrayList() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String branch ) { TfsCommand command = new TfsCommand( "branch", r, f, getLogger() ); command.addArgument( f.getBasedir().getAbsolutePath() ); command.addArgument( "-checkin" ); command.addArgument( branch ); return command; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000627211244567275033547 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; public class TfsTagCommand extends AbstractTagCommand { protected ScmResult executeTagCommand( ScmProviderRepository r, ScmFileSet f, String tag, String message ) throws ScmException { return executeTagCommand( r, f, tag, new ScmTagParameters( message ) ); } protected ScmResult executeTagCommand( ScmProviderRepository r, ScmFileSet f, String tag, ScmTagParameters scmTagParameters ) throws ScmException { TfsCommand command = createCommand( r, f, tag, scmTagParameters ); StringStreamConsumer out = new StringStreamConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new TagScmResult( command.getCommandString(), "Error code for TFS label command - " + status, err.getOutput(), false ); } return new TagScmResult( command.getCommandString(), f.getFileList() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, String tag, ScmTagParameters scmTagParameters ) { TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r; String url = tfsRepo.getServerPath(); TfsCommand command = new TfsCommand( "label", r, f, getLogger() ); command.addArgument( tag ); command.addArgument( url ); command.addArgument( "-recursive" ); command.addArgument( "-child:replace" ); String message = scmTagParameters.getMessage(); if ( message != null && !message.equals( "" ) ) { command.addArgument( "-comment:" + message ); } return command; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsUnEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000446011244567275033544 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.unedit.AbstractUnEditCommand; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; // Usage: mvn scm:unedit -DworkingDirectory= -Dincludes=* public class TfsUnEditCommand extends AbstractUnEditCommand { protected ScmResult executeUnEditCommand( ScmProviderRepository r, ScmFileSet f ) throws ScmException { FileListConsumer out = new FileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); TfsCommand command = createCommand( r, f ); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new UnEditScmResult( command.getCommandString(), "Error code for TFS unedit command - " + status, err.getOutput(), false ); } return new UnEditScmResult( command.getCommandString(), out.getFiles() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f ) { TfsCommand command = new TfsCommand( "undo", r, f, getLogger() ); command.addArgument( f ); return command; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000475011244567275033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.list.AbstractListCommand; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.ServerFileListConsumer; public class TfsListCommand extends AbstractListCommand { protected ListScmResult executeListCommand( ScmProviderRepository r, ScmFileSet f, boolean recursive, ScmVersion v ) throws ScmException { FileListConsumer out = new ServerFileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); TfsCommand command = createCommand( r, f, recursive ); int status = command.execute( out, err ); if ( status != 0 || err.hasBeenFed() ) { return new ListScmResult( command.getCommandString(), "Error code for TFS list command - " + status, err.getOutput(), false ); } return new ListScmResult( command.getCommandString(), out.getFiles() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, boolean recursive ) { TfsCommand command = new TfsCommand( "dir", r, f, getLogger() ); if ( recursive ) { command.addArgument( "-recursive" ); } command.addArgument( f ); return command; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000443311244567275033544 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; public class TfsAddCommand extends AbstractAddCommand { protected ScmResult executeAddCommand( ScmProviderRepository r, ScmFileSet f, String m, boolean b ) throws ScmException { TfsCommand command = createCommand( r, f ); FileListConsumer fileConsumer = new FileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); int status = command.execute( fileConsumer, err ); if ( status != 0 || err.hasBeenFed() ) { return new AddScmResult( command.getCommandString(), "Error code for TFS add command - " + status, err.getOutput(), false ); } return new AddScmResult( command.getCommandString(), fileConsumer.getFiles() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f ) { TfsCommand command = new TfsCommand( "add", r, f, getLogger() ); command.addArgument( f ); return command; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/TfsUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000615711244567275033551 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs.command; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.tfs.TfsScmProviderRepository; import org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer; import org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer; public class TfsUpdateCommand extends AbstractUpdateCommand { protected UpdateScmResult executeUpdateCommand( ScmProviderRepository r, ScmFileSet f, ScmVersion v ) throws ScmException { FileListConsumer fileConsumer = new FileListConsumer(); ErrorStreamConsumer err = new ErrorStreamConsumer(); TfsCommand command = createCommand( r, f, v ); int status = command.execute( fileConsumer, err ); if ( status != 0 || err.hasBeenFed() ) { return new UpdateScmResult( command.getCommandString(), "Error code for TFS update command - " + status, err.getOutput(), false ); } return new UpdateScmResult( command.getCommandString(), fileConsumer.getFiles() ); } public TfsCommand createCommand( ScmProviderRepository r, ScmFileSet f, ScmVersion v ) { String serverPath = ( (TfsScmProviderRepository) r ).getServerPath(); TfsCommand command = new TfsCommand( "get", r, f, getLogger() ); command.addArgument( serverPath ); if ( v != null && !v.equals( "" ) ) { String vType = ""; if ( v.getType().equals( "Tag" ) ) { vType = "L"; } if ( v.getType().equals( "Revision" ) ) { vType = "C"; } command.addArgument( "-version:" + vType + v.getName() ); } return command; } protected ChangeLogCommand getChangeLogCommand() { TfsChangeLogCommand changeLogCommand = new TfsChangeLogCommand(); changeLogCommand.setLogger( getLogger() ); return changeLogCommand; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/TfsScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000375211244566320033535 0ustar twernertwernerpackage org.apache.maven.scm.provider.tfs; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepository; import org.codehaus.plexus.util.StringUtils; public class TfsScmProviderRepository extends ScmProviderRepository { private final String tfsUrl; private final String serverPath; private final String workspace; public TfsScmProviderRepository( String tfsUrl, String user, String password, String serverPath, String workspace ) { super(); setUser( user ); setPassword( password ); this.tfsUrl = tfsUrl; this.serverPath = serverPath; this.workspace = workspace; } public String getTfsUrl() { return tfsUrl; } public String getWorkspace() { return workspace; } public String getServerPath() { return serverPath; } public String getUserPassword() { String userPassword = null; if ( !StringUtils.isEmpty( getUser() ) ) { userPassword = getUser(); if ( !StringUtils.isEmpty( getPassword() ) ) { userPassword += ";" + getPassword(); } } return userPassword; } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-tfs/pom.xml0000644000175000017500000000505511322611461024731 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-tfs Maven SCM TFS Provider http://labs.teamprise.com/maven A Maven 2 SCM Provider for Microsoft Visual Studio Team Foundation Server. martin Martin Woodward martin@teamprise.com http://www.woodwardweb.com Teamprise http://www.teamprise.com developer 0 subhashgo Subhash Gopalakrishnan subhash@teamprise.com Teamprise http://www.teamprise.com developer +5.5 org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/src/0000755000175000017500000000000011345536665017707 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/src/site/0000755000175000017500000000000011345536665020653 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/src/site/site.xml0000644000175000017500000000215411051127665022331 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/0000755000175000017500000000000011345536671024071 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/Readme.txt0000644000175000017500000000171010412044353026007 0ustar twernertwernerHow to build bazaar scm provider? You must have bazaar installed on your machine. Bazaar is available at (http://bazaar-vcs.org/) It requires Python and some other modules (http://bazaar-vcs.org/Installation). For bazaar version 0.8+ consult (http://bazaar-vcs.org/Installation). For bazaar pre 0.8 on windows: For windows users, you'll need, after installation to create a bzr.bat file added in your path with the following content: ---------- python \bzr %* ---------- Unfortunately, you can't use the Cygwin bzr at this time. While it will start with a batch file called: ---------- c:\cygwin\bin\python2.4.exe /usr/bin/bzr %* ---------- Any of the arguments that are files cannot be translated to cygwin paths. What is required is support in Commandline to recognise a cygwin environment, and for anything that was created with createArgument().setFile(...), it should be translated with cygpath -w. Commands would be executed with "sh". maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/0000755000175000017500000000000011345536671024660 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/site/0000755000175000017500000000000011345536671025624 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/site/site.xml0000644000175000017500000000212611051127665027304 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/0000755000175000017500000000000011345536671025637 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/resources/0000755000175000017500000000000011345536671027651 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/resources/bazaar/0000755000175000017500000000000011345536671031111 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/resources/bazaar/changeLogWithMerge.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/resources/bazaar/changeLogWithM0000644000175000017500000000254610412044353033664 0ustar twernertwerner------------------------------------------------------------ revno: 4 committer: tsmoergrav@slb.com branch nick: bzr.test2 timestamp: Fri 2006-03-24 21:51:36 +0100 message: Hello modified: changeLogWithMerge.txt ------------------------------------------------------------ merged: tsmoergrav@slb.com-20060324204530-b95bda1a51d98560 committer: tsmoergrav@slb.com branch nick: BZR~1.TES timestamp: Fri 2006-03-24 21:45:30 +0100 message: Great! ------------------------------------------------------------ merged: tsmoergrav@slb.com-20060324204323-8143a4e84f876d8e committer: tsmoergrav@slb.com branch nick: bzr.test timestamp: Fri 2006-03-24 21:43:23 +0100 message: Go Girl! ------------------------------------------------------------ revno: 3 committer: tsmoergrav@slb.com branch nick: BZR~2.TES timestamp: Fri 2006-03-24 21:39:57 +0100 message: Third modified: changeLogWithMerge.txt ------------------------------------------------------------ revno: 2 committer: tsmoergrav@slb.com branch nick: BZR~2.TES timestamp: Fri 2006-03-24 21:39:31 +0100 message: Second modified: changeLogWithMerge.txt ------------------------------------------------------------ revno: 1 committer: tsmoergrav@slb.com branch nick: BZR~1.TES timestamp: Fri 2006-03-24 21:37:51 +0100 message: Init added: changeLogWithMerge.txt maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/0000755000175000017500000000000011345536671026560 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/0000755000175000017500000000000011345536671027347 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/0000755000175000017500000000000011345536671030570 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/0000755000175000017500000000000011345536671031676 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536671032460 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/update/BazaarUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000253710613620134033532 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.update; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest; /** * @author Torbjørn Eikli Smørgrav */ public class BazaarUpdateCommandTckTest extends UpdateCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000255110613620134033526 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.checkout; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; /** * @author Torbjørn Eikli Smørgrav */ public class BazaarCheckOutCommandTckTest extends CheckOutCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/status/BazaarStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000253710613620134033532 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.status; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.status.StatusCommandTckTest; /** * @author Torbjørn Eikli Smørgrav */ public class BazaarStatusCommandTckTest extends StatusCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/tag/BazaarTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000255711243206053033534 0ustar twernertwerner/* * 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. */ package org.apache.maven.scm.provider.bazaar.command.tag; import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.tag.TagCommandTckTest; /** * Tests for bzr tag command requiring an actual bzr client. * * @author Johan Walles */ public class BazaarTagCommandTckTest extends TagCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/checkin/BazaarCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000254410613620134033530 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.checkin; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest; /** * @author Torbjørn Eikli Smørgrav */ public class BazaarCheckInCommandTckTest extends CheckInCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000237710613620134033534 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.diff; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest; public class BazaarDiffCommandTckTest extends DiffCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/changelog/BazaarChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000350310535556312033535 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.changelog; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.List; public class BazaarChangeLogConsumerTest extends ScmTestCase { public void testChanglogWithMergeEntries() throws IOException { File testFile = getTestFile( "src/test/resources/bazaar/changeLogWithMerge.txt" ); BazaarChangeLogConsumer consumer = new BazaarChangeLogConsumer( new DefaultLog(), null ); FileInputStream fis = new FileInputStream( testFile ); BufferedReader in = new BufferedReader( new InputStreamReader( fis ) ); String s = in.readLine(); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } List mods = consumer.getModifications(); assertEquals( 4, mods.size() ); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/command/changelog/BazaarChangeLogCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000000243010613620134033522 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.changelog; /* * 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. */ import org.apache.maven.scm.provider.bazaar.BazaarRepoUtils; import org.apache.maven.scm.tck.command.changelog.ChangeLogCommandTckTest; public class BazaarChangeLogCommandTckTest extends ChangeLogCommandTckTest { public String getScmUrl() throws Exception { return BazaarRepoUtils.getScmUrl(); } public void initRepo() throws Exception { BazaarRepoUtils.initRepo(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/BazaarRepoUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000001063711050663315033536 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * Common code used in all tests. * * @author Torbjørn Eikli Smørgrav */ public class BazaarRepoUtils extends PlexusTestCase { public static final String[] filesInTestBranch = new String[] { "pom.xml", "readme.txt", "src/main/java/Application.java", "src/test/java/Test.java" }; public static final String TCK_FILE_CONSTANT = "/"; public static final String BRANCH_NAME = "target" + File.separator + "test-branch"; public static final File WORKING_DIR = new File( getBasedir(), BRANCH_NAME ); public static final String COMMIT_MESSAGE = "Add files to test branch"; public static String getScmUrl() throws Exception { return "scm:bazaar:file://" + WORKING_DIR.getAbsolutePath(); } public static void initRepo() throws Exception { // Prepare tmp directory if ( WORKING_DIR.exists() ) { FileUtils.deleteDirectory( WORKING_DIR ); if ( WORKING_DIR.exists() ) { throw new IOException( WORKING_DIR.getAbsolutePath() + " wasn't deleted." ); } } boolean workingDirReady = WORKING_DIR.mkdirs(); if ( !workingDirReady ) { throw new IOException( "Could not initiate test branch at: " + WORKING_DIR ); } // Init repository String[] init_cmd = new String[]{BazaarConstants.INIT_CMD}; BazaarUtils.execute( WORKING_DIR, init_cmd ); // Create and add files to repository List files = new ArrayList(); for ( int i = 0; i < filesInTestBranch.length; i++ ) { File file = new File( WORKING_DIR.getAbsolutePath(), filesInTestBranch[i] ); if ( file.getParentFile() != null && !file.getParentFile().exists() ) { boolean success = file.getParentFile().mkdirs(); if ( !success ) { throw new IOException( "Could not create directories in branch for: " + file ); } } file.createNewFile(); FileUtils.fileWrite( file.getAbsolutePath(), TCK_FILE_CONSTANT + filesInTestBranch[i] ); files.add( file ); } //Add to repository String[] add_cmd = new String[] { BazaarConstants.ADD_CMD }; ScmFileSet filesToAdd = new ScmFileSet( new File( "" ), files ); add_cmd = BazaarUtils.expandCommandLine( add_cmd, filesToAdd ); ScmResult result = BazaarUtils.execute( WORKING_DIR, add_cmd ); if ( !result.isSuccess() ) { String message = "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput(); throw new Exception( message ); } // Commit the initial repository String[] commit_cmd = new String[]{BazaarConstants.COMMIT_CMD, BazaarConstants.MESSAGE_OPTION, COMMIT_MESSAGE}; result = BazaarUtils.execute( WORKING_DIR, commit_cmd ); if ( !result.isSuccess() ) { String message = "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput(); throw new Exception( message ); } } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/test/java/org/apache/maven/scm/provi0000644000175000017500000001411011241364500033520 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.repository; /* * 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. */ import junit.framework.TestCase; public class BazaarScmProviderRepositoryTest extends TestCase { public void testInvalidRepo() { //No protocol - makes it invalid String url = "username:password@myhost.com/~/dev/maven"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); assertNotNull( repo.validateURI() ); } public void testFileRepo() { //1. Test *nix like paths String url = "file:///home/username/dev/maven"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //2. Test windows like paths (with slash) url = "file://C:/Documents and Settings/username/dev/maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); url = "file:///c:/program files/cygwin/tmp/test"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //3. Test windows like paths (with backslash) url = "file://C:\\Documents and Settings\\username\\dev\\maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //4. Test invalid file url url = "file:/C:\\Documents and Settings\\username\\dev\\maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNotNull( repo.validateURI() ); } public void testSFTPRepo() { //1. Test with relativ path String url = "sftp://username:password@myhost.com/~/dev/maven"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //2. Test with absolute path url = "sftp://username:password@myhost.com/home/username/dev/maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //3. Test with incomplete URL but set password later String incompleteUrl = "sftp://username@myhost.com/home/username/dev/maven"; repo = new BazaarScmProviderRepository( incompleteUrl ); assertEquals( incompleteUrl, repo.getURI() ); //This should still work... assertNotNull( repo.validateURI() ); //Set password repo.setPassword( "password" ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); } public void testHTTPRepo() { //1. Test with relativ path String url = "http://www.myhost.com/~username/dev/maven"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //2. Test with absolute path url = "http://www.myhost.com/dev/maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( url, repo.getURI() ); assertNull( repo.validateURI() ); //3. Test with unessesary authentication information repo.setPassword( "Password" ); repo.setUser( "User" ); repo.setPassphrase( "Passphrase" ); assertEquals( "http://www.myhost.com/dev/maven", repo.getURI() ); assertNull( repo.validateURI() ); repo.setPort( 81 ); assertEquals( "http://www.myhost.com:81/dev/maven", repo.getURI() ); assertNull( repo.validateURI() ); } public void testBzrRepo() { testAuthenticationProtocolRepo( "bzr" ); } public void testBzrPlusSshRepo() { testAuthenticationProtocolRepo( "bzr+ssh" ); } public void testSshRepo() { testAuthenticationProtocolRepo( "ssh" ); } private void testAuthenticationProtocolRepo(String protocol) { String url = protocol + "://myserver.net/testroot/myproject/trunk/"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); repo.setPassword( "Password" ); repo.setUser( "User" ); repo.setPassphrase( "Passphrase" ); assertNull( repo.validateURI() ); assertEquals( protocol + "://User:Password@myserver.net/testroot/myproject/trunk/", repo.getURI() ); assertNull( repo.validateURI() ); repo.setPort( 4776 ); assertEquals( protocol + "://User:Password@myserver.net:4776/testroot/myproject/trunk/", repo.getURI() ); assertNull( repo.validateURI() ); } /** * @throws Exception */ public void testParseHostAndPort() throws Exception { String url = "http://localhost:8000/"; BazaarScmProviderRepository repo = new BazaarScmProviderRepository( url ); System.out.println(repo.getURI()); assertEquals( repo.getURI(), url ); url = "http://localhost/"; repo = new BazaarScmProviderRepository( url ); assertEquals( repo.getURI(), url ); url = "http://www.myhost.com:81/dev/maven"; repo = new BazaarScmProviderRepository( url ); assertEquals( repo.getURI(), url ); } }maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/0000755000175000017500000000000011345536671025604 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/0000755000175000017500000000000011345536671026525 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/0000755000175000017500000000000011345536671027314 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/0000755000175000017500000000000011345536671030535 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/0000755000175000017500000000000011345536671031643 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536671032425 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/BazaarConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001323511241362724033502 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command; /* * 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. */ import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Base consumer to do common parsing for all bazaar commands. *

* More specific: log line each line if debug is enabled, get file status * and detect warnings from bazaar * * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarConsumer.java 804398 2009-08-14 22:31:48Z struberg $ */ public class BazaarConsumer extends AbstractConsumer { /** * A list of known keywords from bazaar */ private static final Map IDENTIFIERS = new HashMap(); /** * A list of known message prefixes from bazaar */ private static final Map MESSAGES = new HashMap(); /** * Number of lines to keep from Std.Err * This size is set to ensure that we capture enough info * but still keeps a low memory footprint. */ private static final int MAX_STDERR_SIZE = 10; /** * A list of the MAX_STDERR_SIZE last errors or warnings. */ private final List stderr = new ArrayList(); static { IDENTIFIERS.put( "added", ScmFileStatus.ADDED ); IDENTIFIERS.put( "adding", ScmFileStatus.ADDED ); IDENTIFIERS.put( "unknown", ScmFileStatus.UNKNOWN ); IDENTIFIERS.put( "modified", ScmFileStatus.MODIFIED ); IDENTIFIERS.put( "removed", ScmFileStatus.DELETED ); IDENTIFIERS.put( "renamed", ScmFileStatus.MODIFIED ); MESSAGES.put( "bzr: WARNING:", "WARNING" ); MESSAGES.put( "bzr: ERROR:", "ERROR" ); MESSAGES.put( "'bzr' ", "ERROR" ); // bzr isn't found in windows path } public BazaarConsumer( ScmLogger logger ) { super( logger ); } public void doConsume( ScmFileStatus status, String trimmedLine ) { //override this } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } String trimmedLine = line.trim(); String statusStr = processInputForKnownIdentifiers( trimmedLine ); //If its not a status report - then maybe its a message? if ( statusStr == null ) { boolean isMessage = processInputForKnownMessages( trimmedLine ); //If it is then its already processed and we can ignore futher processing if ( isMessage ) { return; } } else { //Strip away identifier trimmedLine = trimmedLine.substring( statusStr.length() ); trimmedLine = trimmedLine.trim(); //one or more spaces } ScmFileStatus status = statusStr != null ? ( (ScmFileStatus) IDENTIFIERS.get( statusStr.intern() ) ) : null; doConsume( status, trimmedLine ); } /** * Warnings and errors is usually printed out in Std.Err, thus for derived consumers * operating on Std.Out this would typically return an empty string. * * @return Return the last lines interpreted as an warning or an error */ public String getStdErr() { String str = ""; for ( Iterator it = stderr.iterator(); it.hasNext(); ) { str += it.next(); } return str; } private static String processInputForKnownIdentifiers( String line ) { for ( Iterator it = IDENTIFIERS.keySet().iterator(); it.hasNext(); ) { String id = (String) it.next(); if ( line.startsWith( id ) ) { return id; } } return null; } private boolean processInputForKnownMessages( String line ) { for ( Iterator it = MESSAGES.keySet().iterator(); it.hasNext(); ) { String prefix = (String) it.next(); if ( line.startsWith( prefix ) ) { stderr.add( line ); //Add line if ( stderr.size() > MAX_STDERR_SIZE ) { stderr.remove( 0 ); //Rotate list } String message = line.substring( prefix.length() ); if ( MESSAGES.get( prefix ).equals( "WARNING" ) ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( message ); } } else { if ( getLogger().isErrorEnabled() ) { getLogger().error( message ); } } return true; } } return false; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/update/BazaarUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001110011051271420033456 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.apache.maven.scm.provider.bazaar.command.changelog.BazaarChangeLogCommand; import org.apache.maven.scm.provider.bazaar.command.diff.BazaarDiffConsumer; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarUpdateCommand.java 686198 2008-08-15 12:14:08Z vsiveton $ */ public class BazaarUpdateCommand extends AbstractUpdateCommand implements Command { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { throw new ScmException( "This provider can't handle tags." ); } File workingDir = fileSet.getBasedir(); // Update branch String[] updateCmd = new String[] { BazaarConstants.PULL_CMD }; ScmResult updateResult = BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), workingDir, updateCmd ); if ( !updateResult.isSuccess() ) { return new UpdateScmResult( null, null, updateResult ); } // Find changes from last revision int currentRevision = BazaarUtils.getCurrentRevisionNumber( getLogger(), workingDir ); int previousRevision = currentRevision - 1; String[] diffCmd = new String[] { BazaarConstants.DIFF_CMD, BazaarConstants.REVISION_OPTION, "" + previousRevision }; BazaarDiffConsumer diffConsumer = new BazaarDiffConsumer( getLogger(), workingDir ); ScmResult diffResult = BazaarUtils.execute( diffConsumer, getLogger(), workingDir, diffCmd ); // Now translate between diff and update file status List updatedFiles = new ArrayList(); List changes = new ArrayList(); List diffFiles = diffConsumer.getChangedFiles(); Map diffChanges = diffConsumer.getDifferences(); for ( Iterator it = diffFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); changes.add( diffChanges.get( file ) ); if ( file.getStatus() == ScmFileStatus.MODIFIED ) { updatedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.PATCHED ) ); } else { updatedFiles.add( file ); } } return new UpdateScmResultWithRevision( updatedFiles, changes, String.valueOf( currentRevision ), diffResult ); } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { BazaarChangeLogCommand command = new BazaarChangeLogCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000753311243206053033500 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.apache.maven.scm.provider.bazaar.repository.BazaarScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarCheckOutCommand.java 806087 2009-08-20 08:41:15Z struberg $ */ public class BazaarCheckOutCommand extends AbstractCheckOutCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { BazaarScmProviderRepository repository = (BazaarScmProviderRepository) repo; String url = repository.getURI(); File checkoutDir = fileSet.getBasedir(); try { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Removing " + checkoutDir ); } FileUtils.deleteDirectory( checkoutDir ); } catch ( IOException e ) { throw new ScmException( "Cannot remove " + checkoutDir ); } // Do the actual checkout ArrayList checkoutCmd = new ArrayList(); checkoutCmd.add( BazaarConstants.BRANCH_CMD ); checkoutCmd.add( url ); checkoutCmd.add( checkoutDir.getAbsolutePath() ); if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { checkoutCmd.add( BazaarConstants.REVISION_OPTION ); checkoutCmd.add( "tag:" + version.getName() ); } BazaarConsumer checkoutConsumer = new BazaarConsumer( getLogger() ); BazaarUtils.execute( checkoutConsumer, getLogger(), checkoutDir.getParentFile(), (String[]) checkoutCmd.toArray( new String[0] ) ); // Do inventory to find list of checkedout files String[] inventoryCmd = new String[]{BazaarConstants.INVENTORY_CMD}; BazaarCheckOutConsumer consumer = new BazaarCheckOutConsumer( getLogger(), checkoutDir ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), checkoutDir, inventoryCmd ); if ( !result.isSuccess() ) { throw new ScmException( result.getProviderMessage() ); } return new CheckOutScmResult( consumer.getCheckedOutFiles(), result ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkout/BazaarCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000371511050561465033505 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarCheckOutConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class BazaarCheckOutConsumer extends BazaarConsumer { private final File workingDirectory; private final ArrayList checkedOut = new ArrayList(); public BazaarCheckOutConsumer( ScmLogger logger, File workingDirectory ) { super( logger ); this.workingDirectory = workingDirectory; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String line ) { File file = new File( workingDirectory, line ); if ( file.isFile() ) { checkedOut.add( new ScmFile( line, ScmFileStatus.CHECKED_OUT ) ); } } List getCheckedOutFiles() { return checkedOut; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/status/BazaarStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000551411057610744033506 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarStatusConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ class BazaarStatusConsumer extends BazaarConsumer { private final List repositoryStatus = new ArrayList(); private final File workingDir; /** * State currently consuming (one of the identifieres or null) */ private ScmFileStatus currentState = null; BazaarStatusConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( status != null ) { currentState = status; return; } if ( currentState == null ) { return; } //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Not a file: " + tmpFile + ". Ignoring" ); } } else if ( tmpFile.isDirectory() ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "New directory added: " + tmpFile ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, currentState ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } repositoryStatus.add( scmFile ); } } List getStatus() { return repositoryStatus; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/status/BazaarStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000430011050663315033471 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import java.io.File; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarStatusCommand.java 685721 2008-08-13 22:57:17Z olamy $ */ public class BazaarStatusCommand extends AbstractStatusCommand implements Command { public BazaarStatusCommand() { super(); } /** {@inheritDoc} */ public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { File workingDir = fileSet.getBasedir(); BazaarStatusConsumer consumer = new BazaarStatusConsumer( getLogger(), workingDir ); String[] statusCmd = new String[] { BazaarConstants.STATUS_CMD }; ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, statusCmd ); return new StatusScmResult( consumer.getStatus(), result ); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/remove/BazaarRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000432111050663315033474 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.remove; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarRemoveCommand.java 685721 2008-08-13 22:57:17Z olamy $ */ public class BazaarRemoveCommand extends AbstractRemoveCommand implements Command { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message ) throws ScmException { String[] command = new String[] { BazaarConstants.REMOVE_CMD }; BazaarUtils.expandCommandLine( command, fileSet ); File workingDir = fileSet.getBasedir(); BazaarRemoveConsumer consumer = new BazaarRemoveConsumer( getLogger(), workingDir ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, command ); return new RemoveScmResult( consumer.getRemovedFiles(), result ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/remove/BazaarRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000476511057610744033515 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarRemoveConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class BazaarRemoveConsumer extends BazaarConsumer { private final File workingDir; private final List removedFiles = new ArrayList(); public BazaarRemoveConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( status != null && status == ScmFileStatus.DELETED ) { //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Not a file: " + tmpFile + ". Ignored" ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, ScmFileStatus.DELETED ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } removedFiles.add( scmFile ); } } } public List getRemovedFiles() { return removedFiles; } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/tag/BazaarTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001020411243206053033465 0ustar twernertwerner/* * 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. */ package org.apache.maven.scm.provider.bazaar.command.tag; import java.io.File; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.apache.maven.scm.provider.bazaar.repository.BazaarScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * @author Johan Walles * @version $Id: BazaarTagCommand.java 806087 2009-08-20 08:41:15Z struberg $ */ public class BazaarTagCommand extends AbstractTagCommand { protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException { if ( tagName == null || StringUtils.isEmpty( tagName.trim() ) ) { throw new ScmException( "tag name must be specified" ); } if ( !fileSet.getFileList().isEmpty() ) { throw new ScmException( "tagging specific files is not allowed" ); } // Perform the tagging operation File bazaarRoot = fileSet.getBasedir(); BazaarConsumer consumer = new BazaarConsumer( getLogger() ); String[] tagCmd = new String[] { BazaarConstants.TAG_CMD, tagName }; ScmResult tagResult = BazaarUtils.execute( consumer, getLogger(), bazaarRoot, tagCmd ); if ( !tagResult.isSuccess() ) { return new TagScmResult( null, tagResult ); } // Do "bzr ls -R -r tag:tagName" to get a list of the tagged files BazaarLsConsumer lsConsumer = new BazaarLsConsumer( getLogger(), bazaarRoot, ScmFileStatus.TAGGED ); String[] lsCmd = new String[] { BazaarConstants.LS_CMD, BazaarConstants.RECURSIVE_OPTION, BazaarConstants.REVISION_OPTION, "tag:" + tagName }; ScmResult lsResult = BazaarUtils.execute(lsConsumer, getLogger(), bazaarRoot, lsCmd); if ( !lsResult.isSuccess() ) { return new TagScmResult( null, lsResult ); } // Push new tags to parent branch if any BazaarScmProviderRepository bazaarRepository = (BazaarScmProviderRepository) repository; if ( !bazaarRepository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) ) { String[] pushCmd = new String[] { BazaarConstants.PUSH_CMD, bazaarRepository.getURI() }; ScmResult pushResult = BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd ); if ( !pushResult.isSuccess() ) { return new TagScmResult( null, pushResult ); } } return new TagScmResult( lsConsumer.getListedFiles(), tagResult ); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/tag/BazaarLsConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000467211243206053033501 0ustar twernertwerner/* * 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. */ package org.apache.maven.scm.provider.bazaar.command.tag; import java.io.File; import java.util.LinkedList; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; /** * Parse output from "bzr ls". * @author Johan Walles * @version $Id: BazaarLsConsumer.java 806087 2009-08-20 08:41:15Z struberg $ */ class BazaarLsConsumer extends BazaarConsumer { /** * The root directory of this bazaar repository. */ private File repositoryRoot; /** * A list of the files found by ls. */ private List files; /** * Create a new "bzr ls" consumer. * @param repositoryRoot The root directory of this bazaar repository. * @param wantedStatus The status we'll report for the files listed. */ public BazaarLsConsumer(ScmLogger logger, File repositoryRoot, ScmFileStatus wantedStatus) { super( logger ); files = new LinkedList(); } public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( trimmedLine.endsWith( File.separator ) ) { // Don't report directories return; } String path = new File( repositoryRoot, trimmedLine ).toString(); files.add( new ScmFile( path, ScmFileStatus.TAGGED ) ); } /** * Answer what files were listed by bzr ls. * @return A list of files listed by bzr ls. */ public List getListedFiles() { return files; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/checkin/BazaarCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001110111243206602033462 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.apache.maven.scm.provider.bazaar.command.status.BazaarStatusCommand; import org.apache.maven.scm.provider.bazaar.repository.BazaarScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarCheckInCommand.java 806089 2009-08-20 08:46:58Z struberg $ */ public class BazaarCheckInCommand extends AbstractCheckInCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) { throw new ScmException( "This provider can't handle tags." ); } // Get files that will be committed (if not specified in fileSet) List commitedFiles = new ArrayList(); File[] files = fileSet.getFiles(); if ( files.length == 0 ) { //Either commit all changes BazaarStatusCommand statusCmd = new BazaarStatusCommand(); statusCmd.setLogger( getLogger() ); StatusScmResult status = statusCmd.executeStatusCommand( repo, fileSet ); List statusFiles = status.getChangedFiles(); for ( Iterator it = statusFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); if ( file.getStatus() == ScmFileStatus.ADDED || file.getStatus() == ScmFileStatus.DELETED || file.getStatus() == ScmFileStatus.MODIFIED ) { commitedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) ); } } } else { //Or commit spesific files for ( int i = 0; i < files.length; i++ ) { commitedFiles.add( new ScmFile( files[i].getPath(), ScmFileStatus.CHECKED_IN ) ); } } // Commit to local branch String[] commitCmd = new String[]{BazaarConstants.COMMIT_CMD, BazaarConstants.MESSAGE_OPTION, message}; commitCmd = BazaarUtils.expandCommandLine( commitCmd, fileSet ); ScmResult result = BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), commitCmd ); // Push to parent branch if any BazaarScmProviderRepository repository = (BazaarScmProviderRepository) repo; if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) ) { String[] pushCmd = new String[] { BazaarConstants.PUSH_CMD, BazaarConstants.NO_STRICT_OPTION, repository.getURI() }; result = BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd ); } return new CheckInScmResult( commitedFiles, result ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001364011057621704033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class BazaarDiffConsumer extends BazaarConsumer { private static final String MODIFIED_FILE_TOKEN = "=== modified file "; private static final String ADDED_FILE_TOKEN = "=== added file "; private static final String DELETED_FILE_TOKEN = "=== deleted file "; private static final String NO_NEWLINE_TOKEN = "\\ No newline at end of file"; private static final String FROM_FILE_TOKEN = "---"; private static final String TO_FILE_TOKEN = "+++"; private static final String ADDED_LINE_TOKEN = "+"; private static final String REMOVED_LINE_TOKEN = "-"; private static final String UNCHANGED_LINE_TOKEN = " "; private static final String RANGE_TOKEN = "@@"; private ScmLogger logger; private File workingDirectory; private String currentFile; private StringBuffer currentDifference; private List changedFiles = new ArrayList(); private Map differences = new HashMap(); private StringBuffer patch = new StringBuffer(); public BazaarDiffConsumer( ScmLogger logger, File workingDirectory ) { super( logger ); this.logger = logger; this.workingDirectory = workingDirectory; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String line ) { String tmpLine = new String( line ); patch.append( line ).append( "\n" ); // Parse line if ( line.startsWith( MODIFIED_FILE_TOKEN ) ) { tmpLine = line.substring( MODIFIED_FILE_TOKEN.length() ); tmpLine = tmpLine.trim(); status = ScmFileStatus.MODIFIED; addChangedFile( status, line, tmpLine ); } else if ( line.startsWith( ADDED_FILE_TOKEN ) ) { tmpLine = line.substring( ADDED_FILE_TOKEN.length() ); tmpLine = tmpLine.trim(); status = ScmFileStatus.ADDED; addChangedFile( status, line, tmpLine ); } else if ( line.startsWith( DELETED_FILE_TOKEN ) ) { tmpLine = line.substring( DELETED_FILE_TOKEN.length() ); tmpLine = tmpLine.trim(); status = ScmFileStatus.DELETED; addChangedFile( status, line, tmpLine ); } else if ( line.startsWith( TO_FILE_TOKEN ) || line.startsWith( FROM_FILE_TOKEN ) ) { // ignore (to avoid conflicts with add and remove tokens) } else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) || line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( RANGE_TOKEN ) || line.startsWith( NO_NEWLINE_TOKEN ) ) { currentDifference.append( line ).append( "\n" ); } } /** * This method takes into account two types of diff output.
* - Bazaar 0.7 format: dir/dir/myfile
* - Bazaar 0.8 format: a/dir/dir/myfile
* * @param status Eg. modified or added * @param line The original bazaar output to process (for logging) * @param tmpLine The bazaar output to process */ private void addChangedFile( ScmFileStatus status, String line, String tmpLine ) { tmpLine = tmpLine.substring( 1, tmpLine.length() - 1 ); boolean ok = addChangedFile( status, tmpLine ); if ( !ok ) { int index = tmpLine.indexOf( "/" ); if ( index > -1 ) { tmpLine = tmpLine.substring( index + 1 ); ok = addChangedFile( status, tmpLine ); } } if ( !ok ) { if ( logger.isWarnEnabled() ) { logger.warn( "Could not figure out of line: " + line ); } } } /** * @param status * @param tmpLine * @return True if tmpLine was a valid file and thus added to the changeset */ private boolean addChangedFile( ScmFileStatus status, String tmpLine ) { File tmpFile = new File( workingDirectory, tmpLine ); if ( status.equals( ScmFileStatus.DELETED ) ) { return true; } if ( tmpFile.isFile() ) { currentFile = tmpLine; currentDifference = new StringBuffer(); differences.put( currentFile, currentDifference ); changedFiles.add( new ScmFile( tmpLine, status ) ); return true; } return false; } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch.toString(); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000552011050663315033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.codehaus.plexus.util.StringUtils; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarDiffCommand.java 685721 2008-08-13 22:57:17Z olamy $ */ public class BazaarDiffCommand extends AbstractDiffCommand implements Command { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision ) throws ScmException { String[] diffCmd; if ( startRevision != null && StringUtils.isNotEmpty( startRevision.getName() ) ) { String revArg = startRevision.getName(); if ( endRevision != null && StringUtils.isNotEmpty( endRevision.getName() ) ) { revArg += ".." + endRevision.getName(); } diffCmd = new String[]{BazaarConstants.DIFF_CMD, BazaarConstants.REVISION_OPTION, revArg}; } else { diffCmd = new String[]{BazaarConstants.DIFF_CMD}; } diffCmd = BazaarUtils.expandCommandLine( diffCmd, fileSet ); BazaarDiffConsumer consumer = new BazaarDiffConsumer( getLogger(), fileSet.getBasedir() ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), fileSet.getBasedir(), diffCmd ); return new DiffScmResult( consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/changelog/BazaarChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001353511057610744033510 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarChangeLogConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class BazaarChangeLogConsumer extends BazaarConsumer { private static final String BAZAAR_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss Z"; private static final String START_LOG_TAG = "-----"; private static final String REVNO_TAG = "revno: "; private static final String AUTHOR_TAG = "committer: "; private static final String TIME_STAMP_TOKEN = "timestamp: "; private static final String MESSAGE_TOKEN = "message:"; private static final String BRANCH_NICK_TOKEN = "branch nick: "; private static final String MERGED_TOKEN = "merged: "; private List logEntries = new ArrayList(); private ChangeSet currentChange; private ChangeSet lastChange; private boolean isMergeEntry; private String currentRevision; private StringBuffer currentComment; private String userDatePattern; /** * Null means not parsing message nor files, UNKNOWN means parsing message */ private ScmFileStatus currentStatus = null; public BazaarChangeLogConsumer( ScmLogger logger, String userDatePattern ) { super( logger ); this.userDatePattern = userDatePattern; } public List getModifications() { return logEntries; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String line ) { String tmpLine = line; // Parse line if ( line.startsWith( START_LOG_TAG ) ) { //If last entry was part a merged entry if ( isMergeEntry && lastChange != null ) { String comment = lastChange.getComment(); comment += "\n[MAVEN]: Merged from " + currentChange.getAuthor(); comment += "\n[MAVEN]: " + currentChange.getDateFormatted(); comment += "\n[MAVEN]: " + currentChange.getComment(); lastChange.setComment( comment ); } //Init a new changeset currentChange = new ChangeSet(); currentChange.setFiles( new ArrayList() ); logEntries.add( currentChange ); //Reset memeber vars currentComment = new StringBuffer(); currentStatus = null; currentRevision = ""; isMergeEntry = false; } else if ( line.startsWith( MERGED_TOKEN ) ) { //This is part of lastChange and is not a separate log entry isMergeEntry = true; logEntries.remove( currentChange ); if ( logEntries.size() > 0 ) { lastChange = (ChangeSet) logEntries.get( logEntries.size() - 1 ); } else { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "First entry was unexpectedly a merged entry" ); } lastChange = null; } } else if ( line.startsWith( REVNO_TAG ) ) { tmpLine = line.substring( REVNO_TAG.length() ); tmpLine = tmpLine.trim(); currentRevision = tmpLine; } else if ( line.startsWith( AUTHOR_TAG ) ) { tmpLine = line.substring( AUTHOR_TAG.length() ); tmpLine = tmpLine.trim(); currentChange.setAuthor( tmpLine ); } else if ( line.startsWith( TIME_STAMP_TOKEN ) ) { tmpLine = line.substring( TIME_STAMP_TOKEN.length() + 3 ); tmpLine = tmpLine.trim(); Date date = parseDate( tmpLine, userDatePattern, BAZAAR_TIME_PATTERN ); currentChange.setDate( date ); } else if ( line.startsWith( MESSAGE_TOKEN ) ) { currentStatus = ScmFileStatus.UNKNOWN; } else if ( status != null ) { currentStatus = status; } else if ( currentStatus == ScmFileStatus.UNKNOWN ) { currentComment.append( line ); currentChange.setComment( currentComment.toString() ); currentComment.append( "\n" ); } else if ( currentStatus != null ) { tmpLine = tmpLine.trim(); ChangeFile changeFile = new ChangeFile( tmpLine, currentRevision ); currentChange.addFile( changeFile ); } else if ( line.startsWith( BRANCH_NICK_TOKEN ) ) { //ignore } else { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Could not figure out of: " + line ); } } } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/changelog/BazaarChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000642011050663315033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarChangeLogCommand.java 685721 2008-08-13 22:57:17Z olamy $ */ public class BazaarChangeLogCommand extends AbstractChangeLogCommand implements Command { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { String[] cmd = new String[]{BazaarConstants.LOG_CMD, BazaarConstants.VERBOSE_OPTION}; BazaarChangeLogConsumer consumer = new BazaarChangeLogConsumer( getLogger(), datePattern ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd ); List logEntries = consumer.getModifications(); List inRangeAndValid = new ArrayList(); startDate = startDate == null ? new Date( 0 ) : startDate; //From 1. Jan 1970 endDate = endDate == null ? new Date() : endDate; //Upto now for ( Iterator it = logEntries.iterator(); it.hasNext(); ) { ChangeSet change = (ChangeSet) it.next(); if ( change.getFiles().size() > 0 ) { if ( !change.getDate().before( startDate ) && !change.getDate().after( endDate ) ) { inRangeAndValid.add( change ); } } } ChangeLogSet changeLogSet = new ChangeLogSet( inRangeAndValid, startDate, endDate ); return new ChangeLogScmResult( changeLogSet, result ); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/add/BazaarAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000473611057610744033513 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarAddConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class BazaarAddConsumer extends BazaarConsumer { private final File workingDir; private final List addedFiles = new ArrayList(); public BazaarAddConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( status != null && status == ScmFileStatus.ADDED ) { //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Not a file: " + tmpFile + ". Ignored" ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, ScmFileStatus.ADDED ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } addedFiles.add( scmFile ); } } } public List getAddedFiles() { return addedFiles; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/add/BazaarAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000443211050663315033477 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command.add; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.BazaarUtils; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; /** * Add no recursive. * * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarAddCommand.java 685721 2008-08-13 22:57:17Z olamy $ */ public class BazaarAddCommand extends AbstractAddCommand implements Command { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { String[] addCmd = new String[]{BazaarConstants.ADD_CMD, BazaarConstants.NO_RECURSE_OPTION}; addCmd = BazaarUtils.expandCommandLine( addCmd, fileSet ); File workingDir = fileSet.getBasedir(); BazaarAddConsumer consumer = new BazaarAddConsumer( getLogger(), workingDir ); ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, addCmd ); return new AddScmResult( consumer.getAddedFiles(), result ); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/BazaarConstants.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000000702511243206602033474 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.command; /* * 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. */ /** * Available/Used bazaar commands. *

* These commands does not necessarily correspond to the SCM API. * Eg. "check in" is translated to be "commit" and "push". * * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarConstants.java 806089 2009-08-20 08:46:58Z struberg $ */ public class BazaarConstants { /** * Executable for Bazaar */ public static final String EXEC = "bzr"; /** * Use to create an empty branch or before importing an existing project */ public static final String INIT_CMD = "init"; /** * Default recursive. Common option: --dry-run and --no-recursive */ public static final String ADD_CMD = "add"; /** * Reports the following states: added, removed, modified, unchanged, unknown */ public static final String STATUS_CMD = "status"; /** * Make a file unversioned */ public static final String REMOVE_CMD = "remove"; /** * Create a new copy of a branch. Alias get or clone */ public static final String BRANCH_CMD = "branch"; /** * Commit changes into a new revision */ public static final String COMMIT_CMD = "commit"; /** * Pull any changes from another branch into the current one */ public static final String PULL_CMD = "pull"; /** * Show log of this branch Common option: --revision */ public static final String LOG_CMD = "log"; /** * Show differences in workingtree. Common option: --revision */ public static final String DIFF_CMD = "diff"; /** * Push this branch into another branch */ public static final String PUSH_CMD = "push"; /** * Show current revision number */ public static final String REVNO_CMD = "revno"; /** * Create a tag */ public static final String TAG_CMD = "tag"; /** * List directory contents, bazaar style. */ public static final String LS_CMD = "ls"; /** * Show inventory of the current working copy or a revision */ public static final String INVENTORY_CMD = "inventory"; public static final String NO_RECURSE_OPTION = "--no-recurse"; public static final String NO_STRICT_OPTION = "--no-strict"; public static final String MESSAGE_OPTION = "--message"; public static final String REVISION_OPTION = "--revision"; public static final String VERBOSE_OPTION = "--verbose"; /** * Option to enable recursing into subdirectories. */ public static final String RECURSIVE_OPTION = "--recursive"; public static final String VERSION = "version"; public static final String CHECK = "check"; }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000755000175000017500000000000011345536671033505 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000002071611241364500033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarScmProviderRepository.java 804401 2009-08-14 22:46:24Z struberg $ */ public class BazaarScmProviderRepository extends ScmProviderRepositoryWithHost { //Known and tested protocols private static final String FILE = "file://"; private static final String SFTP = "sftp://"; private static final String FTP = "ftp://"; private static final String AFTP = "aftp://"; private static final String HTTP = "http://"; private static final String HTTPS = "https://"; private static final String BZR = "bzr://"; private static final String BZR_SSH = "bzr+ssh://"; /** this is basically an abbreviation of {@value #BZR_SSH} */ private static final String SSH = "ssh://"; private static final String UNKNOWN = ""; private final String path; private final String protocol; private final String orgUrl; public BazaarScmProviderRepository( String url ) { orgUrl = url; protocol = getProtocol( url ); path = parseUrl( url ); } public String getURI() { if ( FILE.equals( protocol ) ) { return orgUrl; } else { return protocol + ( needsAuthentication() ? addUser() + addPassword() + addAt() : "" ) + addHost() + addPort() + addPath(); } } /** * @return A message if the repository as an invalid URI, null if the URI seems fine. */ public String validateURI() { String msg = null; if ( UNKNOWN.equals( protocol ) ) { msg = "Unknown protocol (URL should start with something like 'sftp://' or 'file://'"; } else if ( needsAuthentication() ) { if ( getUser() == null ) { msg = "Username is missing for protocol " + protocol; } else if ( getPassword() == null ) { msg = "Password is missing for protocol " + protocol; } else if ( getHost() == null ) { msg = "Host (eg. www.myhost.com) is missing for protocol " + protocol; } } else if ( getPort() != 0 && getHost() == null ) { msg = "Got port information without any host for protocol " + protocol; } if ( msg != null ) { msg = "Something could be wrong about the repository URL: " + orgUrl + "\nReason: " + msg + "\nCheck http://maven.apache.org/scm for usage and hints."; } return msg; } private String getProtocol( String url ) { String prot = UNKNOWN; if ( url.startsWith( FILE ) ) { prot = FILE; } else if ( url.startsWith( FTP ) ) { prot = FTP; } else if ( url.startsWith( SFTP ) ) { prot = SFTP; } else if ( url.startsWith( AFTP ) ) { prot = AFTP; } else if ( url.startsWith( HTTP ) ) { prot = HTTP; } else if ( url.startsWith( HTTPS ) ) { prot = HTTPS; } else if ( url.startsWith( BZR ) ) { prot = BZR; } else if ( url.startsWith( BZR_SSH ) ) { prot = BZR_SSH; } else if ( url.startsWith( SSH ) ) { prot = SSH; } return prot; } private String parseUrl( String url ) { if ( UNKNOWN.equals( protocol ) ) { return url; } //Strip protocol url = url.substring( protocol.length() ); url = parseUsernameAndPassword( url ); url = parseHostAndPort( url ); url = parsePath( url ); return url; //is now only the path } private String parseHostAndPort( String url ) { if ( !FILE.equals( protocol ) ) { int indexSlash = url.indexOf( "/" ); String hostPort = url; if ( indexSlash > 0 ) { hostPort = url.substring( 0, indexSlash ); } int indexColon = hostPort.indexOf( ":" ); if ( indexColon > 0 ) { setHost( hostPort.substring( 0, indexColon ) ); url = StringUtils.replace( url, getHost(), "" ); setPort( Integer.parseInt( hostPort.substring( indexColon + 1 ) ) ); url = StringUtils.replace( url, ":" + getPort(), "" ); } else { setHost( hostPort ); url = StringUtils.replace( url, getHost(), "" ); } } return url; } private String parseUsernameAndPassword( String url ) { if ( needsAuthentication() ) { String[] split = url.split( "@" ); if ( split.length == 2 ) { url = split[1]; //Strip away 'username:password@' from url split = split[0].split( ":" ); if ( split.length == 2 ) { //both username and password setUser( split[0] ); setPassword( split[1] ); } else { //only username setUser( split[0] ); } } } return url; } private String parsePath( String url ) { if ( FILE.equals( protocol ) ) { //Use OS dependent path separator url = StringUtils.replace( url, "/", File.separator ); //Test first path separator (*nix systems use them to denote root) File tmpFile = new File( url ); //most likly a *nix system String url2 = url.substring( File.pathSeparator.length() ); File tmpFile2 = new File( url2 ); //most likly a windows system if ( !tmpFile.exists() && !tmpFile2.exists() ) { // This is trouble - Trouble is reported in validateURI() } url = tmpFile2.exists() ? url2 : url; //Use URL path separator url = StringUtils.replace( url, File.separator, "/" ); } return url; } private String addUser() { return ( getUser() == null ) ? "" : getUser(); } private String addPassword() { return ( getPassword() == null ) ? "" : ":" + getPassword(); } private String addAt() { return needsAuthentication() ? "@" : ""; } private String addHost() { return ( getHost() == null ) ? "" : getHost(); } private String addPort() { return ( getPort() == 0 ) ? "" : ":" + getPort(); } private String addPath() { return path; } private boolean needsAuthentication() { return SFTP.equals( protocol ) || FTP.equals( protocol ) || HTTPS.equals( protocol ) || AFTP.equals( protocol ) || BZR.equals( protocol ) || BZR_SSH.equals( protocol ) || SSH.equals( protocol ); } /** {@inheritDoc} */ public String toString() { return "Bazaar Repository Interpreted from: " + orgUrl + ":\nProtocol: " + protocol + "\nHost: " + getHost() + "\nPort: " + getPort() + "\nUsername: " + getUser() + "\nPassword: " + getPassword() + "\nPath: " + path; } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/BazaarScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000002052711243206053033476 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.add.BazaarAddCommand; import org.apache.maven.scm.provider.bazaar.command.changelog.BazaarChangeLogCommand; import org.apache.maven.scm.provider.bazaar.command.checkin.BazaarCheckInCommand; import org.apache.maven.scm.provider.bazaar.command.checkout.BazaarCheckOutCommand; import org.apache.maven.scm.provider.bazaar.command.diff.BazaarDiffCommand; import org.apache.maven.scm.provider.bazaar.command.remove.BazaarRemoveCommand; import org.apache.maven.scm.provider.bazaar.command.status.BazaarStatusCommand; import org.apache.maven.scm.provider.bazaar.command.tag.BazaarTagCommand; import org.apache.maven.scm.provider.bazaar.command.update.BazaarUpdateCommand; import org.apache.maven.scm.provider.bazaar.repository.BazaarScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Bazaar NG http://bazaar-vcs.org/ is a decentralized revision control system.
* * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarScmProvider.java 806087 2009-08-20 08:41:15Z struberg $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="bazaar" */ public class BazaarScmProvider extends AbstractScmProvider { /** {@inheritDoc} */ public String getScmSpecificFilename() { return ".bzr"; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { return new BazaarScmProviderRepository( scmSpecificUrl ); } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null || !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File bzrDir = new File( path, ".bzr" ); if ( !bzrDir.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a bazaar directory." ); } return makeProviderScmRepository( "file:///" + path.getAbsolutePath(), ':' ); } /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { List errorMessages = new ArrayList(); String[] checkCmd = new String[]{BazaarConstants.CHECK, scmSpecificUrl}; ScmResult result; try { File tmpDir = new File( System.getProperty( "java.io.tmpdir" ) ); result = BazaarUtils.execute( tmpDir, checkCmd ); if ( !result.isSuccess() ) { errorMessages.add( result.getCommandOutput() ); errorMessages.add( result.getProviderMessage() ); } } catch ( ScmException e ) { errorMessages.add( e.getMessage() ); } return errorMessages; } /** {@inheritDoc} */ public String getScmType() { return "bazaar"; } /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarAddCommand command = new BazaarAddCommand(); command.setLogger( getLogger() ); return (AddScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarChangeLogCommand command = new BazaarChangeLogCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarCheckInCommand command = new BazaarCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarCheckOutCommand command = new BazaarCheckOutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarDiffCommand command = new BazaarDiffCommand(); command.setLogger( getLogger() ); return (DiffScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarRemoveCommand command = new BazaarRemoveCommand(); command.setLogger( getLogger() ); return (RemoveScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarStatusCommand command = new BazaarStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarTagCommand command = new BazaarTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { BazaarUpdateCommand command = new BazaarUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, parameters ); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/BazaarConfig.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000002141011243206053033466 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Check bazaar installation. * * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarConfig.java 806087 2009-08-20 08:41:15Z struberg $ */ public class BazaarConfig { //Minimum version for the Bazaar SCM private static final float BAZAAR_REQ = 0.7f; private static final float PYTHON_REQ = 2.4f; //Bazaar specific private static final String BAZAAR_VERSION_TAG = "bzr (bazaar-ng) "; private static final String BAZAAR_INSTALL_URL = "'http://bazaar-vcs.org/Installation'"; //Python specific private static final String PYTHON_EXEC = "python"; private static final String PYTHON_VERSION = "-V"; private static final String PYTHON_VERSION_TAG = "Python "; //Python modules private static final String PARAMIKO = "\"import paramiko\""; private static final String CCRYPT = "\"import Crypto\""; private static final String CELEMENTREE = "\"import cElementTree\""; //Configuration to check with default values (not installed) private VersionConsumer bazaarVersion = new VersionConsumer( null ); private VersionConsumer pythonVersion = new VersionConsumer( null ); private boolean cElementTree = false; private boolean paramiko = false; private boolean cCrypt = false; BazaarConfig( File workingDir ) { try { pythonVersion = getPythonVersion( workingDir ); paramiko = checkPyModules( workingDir, PARAMIKO ); //does not throw cCrypt = checkPyModules( workingDir, CCRYPT ); //does not throw cElementTree = checkPyModules( workingDir, CELEMENTREE ); //does not throw bazaarVersion = getBazaarVersion( workingDir ); } catch ( ScmException e ) { //Ignore - Either python and/or bazaar is not installed. //This is already recorded thus we do not generate more info. } } private boolean checkPyModules( File workingDir, String cmd ) { PythonConsumer consumer = new PythonConsumer(); int exitCode; try { Commandline cmdLine = buildPythonCmd( workingDir, new String[]{"-c", cmd} ); exitCode = BazaarUtils.executeCmd( consumer, cmdLine ); } catch ( ScmException e ) { //Ignore - error here is likly to manifest itself when checking python anyway. exitCode = -1; } return exitCode == 0 && consumer.getConsumedAndClear().equals( "" ); } /** * @return True if one can run basic bazaar commands */ private boolean isInstalled() { return pythonVersion.isVersionOk( PYTHON_REQ ) && bazaarVersion.isVersionOk( BAZAAR_REQ ); } /** * @return True if all modules for bazaar are installed. */ private boolean isComplete() { return isInstalled() && cElementTree && paramiko && cCrypt; } public static VersionConsumer getBazaarVersion( File workingDir ) throws ScmException { String[] versionCmd = new String[]{BazaarConstants.VERSION}; VersionConsumer consumer = new VersionConsumer( BAZAAR_VERSION_TAG ); Commandline cmd = BazaarUtils.buildCmd( workingDir, versionCmd ); // Execute command BazaarUtils.executeCmd( consumer, cmd ); // Return result return consumer; } public static VersionConsumer getPythonVersion( File workingDir ) throws ScmException { String[] versionCmd = new String[]{PYTHON_VERSION}; VersionConsumer consumer = new VersionConsumer( PYTHON_VERSION_TAG ); Commandline cmd = buildPythonCmd( workingDir, versionCmd ); // Execute command BazaarUtils.executeCmd( consumer, cmd ); // Return result return consumer; } private static Commandline buildPythonCmd( File workingDir, String[] cmdAndArgs ) throws ScmException { Commandline cmd = new Commandline(); cmd.setExecutable( PYTHON_EXEC ); cmd.setWorkingDirectory( workingDir.getAbsolutePath() ); cmd.addArguments( cmdAndArgs ); if ( !workingDir.exists() ) { boolean success = workingDir.mkdirs(); if ( !success ) { String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir; throw new ScmException( msg ); } } return cmd; } /** * Get version of the executable. * Version is resolved to the last match of a defined regexp in the command output. */ private static class VersionConsumer extends BazaarConsumer { private static final Pattern VERSION_PATTERN = Pattern.compile( "[\\d]+.?[\\d]*" ); private final String versionTag; private String versionStr = "NA"; private float version = -1; VersionConsumer( String aVersionTag ) { super( new DefaultLog() ); this.versionTag = aVersionTag; } public void doConsume( ScmFileStatus status, String line ) { if ( line.startsWith( versionTag ) ) { versionStr = line.substring( versionTag.length() ); } } String getVersion() { return versionStr; } boolean isVersionOk( float min ) { Matcher matcher = VERSION_PATTERN.matcher( versionStr ); if ( matcher.find() ) { String subStr = versionStr.substring( matcher.start(), matcher.end() ); try { version = Float.valueOf( subStr ).floatValue(); } catch ( NumberFormatException e ) { //Print diagnostics and continue (this is not a major error) if ( getLogger().isErrorEnabled() ) { getLogger().error( "Regexp for version did not result in a number: " + subStr, e ); } } } return min <= version; } } private static class PythonConsumer extends BazaarConsumer { private String consumed = ""; PythonConsumer() { super( new DefaultLog() ); } public void doConsume( ScmFileStatus status, String line ) { consumed = line; } String getConsumedAndClear() { String tmp = consumed; consumed = ""; return tmp; } } private String getInstalledStr() { if ( isComplete() ) { return "valid and complete."; } return ( isInstalled() ? "incomplete. " : "invalid. " ) + "Consult " + BAZAAR_INSTALL_URL; } public String toString( File workingDir ) { boolean bzrOk = bazaarVersion.isVersionOk( BAZAAR_REQ ); boolean pyOk = pythonVersion.isVersionOk( PYTHON_REQ ); return "\n Your Bazaar installation seems to be " + getInstalledStr() + "\n Python version: " + pythonVersion.getVersion() + ( pyOk ? " (OK)" : " (May be INVALID)" ) + "\n Bazaar version: " + bazaarVersion.getVersion() + ( bzrOk ? " (OK)" : " (May be INVALID)" ) + "\n Paramiko installed: " + paramiko + " (For remote access eg. sftp) " + "\n cCrypt installed: " + cCrypt + " (For remote access eg. sftp) " + "\n cElementTree installed: " + cElementTree + " (Not mandatory) " + "\n"; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/BazaarUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provi0000644000175000017500000001715011057621704033503 0ustar twernertwernerpackage org.apache.maven.scm.provider.bazaar; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; import org.apache.maven.scm.provider.bazaar.command.BazaarConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Common code for executing bazaar commands. * * @author Torbj�rn Eikli Sm�rgrav * @version $Id: BazaarUtils.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class BazaarUtils { /** * Map between command and its valid exit codes */ private static final Map EXITCODEMAP = new HashMap(); /** * Default exit codes for entries not in exitCodeMap */ private static final List DEFAULTEEXITCODES = new ArrayList(); /** Setup exit codes*/ static { DEFAULTEEXITCODES.add( new Integer( 0 ) ); //Diff is different List diffExitCodes = new ArrayList(); diffExitCodes.add( new Integer( 0 ) ); //No difference diffExitCodes.add( new Integer( 1 ) ); //Conflicts in merge-like or changes in diff-like diffExitCodes.add( new Integer( 2 ) ); //Unrepresentable diff changes EXITCODEMAP.put( BazaarConstants.DIFF_CMD, diffExitCodes ); } public static ScmResult execute( BazaarConsumer consumer, ScmLogger logger, File workingDir, String[] cmdAndArgs ) throws ScmException { try { //Build commandline Commandline cmd = buildCmd( workingDir, cmdAndArgs ); if ( logger.isInfoEnabled() ) { logger.info( "EXECUTING: " + cmd ); } //Execute command int exitCode = executeCmd( consumer, cmd ); //Return result List exitCodes = DEFAULTEEXITCODES; if ( EXITCODEMAP.containsKey( cmdAndArgs[0] ) ) { exitCodes = (List) EXITCODEMAP.get( cmdAndArgs[0] ); } boolean success = exitCodes.contains( new Integer( exitCode ) ); //On failure (and not due to exceptions) - run diagnostics String providerMsg = "Execution of bazaar command succeded"; if ( !success ) { BazaarConfig config = new BazaarConfig( workingDir ); providerMsg = "\nEXECUTION FAILED" + "\n Execution of cmd : " + cmdAndArgs[0] + " failed with exit code: " + exitCode + "." + "\n Working directory was: " + "\n " + workingDir.getAbsolutePath() + config.toString( workingDir ) + "\n"; if ( logger.isErrorEnabled() ) { logger.error( providerMsg ); } } return new ScmResult( cmd.toString(), providerMsg, consumer.getStdErr(), success ); } catch ( ScmException se ) { String msg = "EXECUTION FAILED\n Execution failed before invoking the Bazaar command. Last exception:" + "\n " + se.getMessage(); //Add nested cause if any if ( se.getCause() != null ) { msg += "\n Nested exception:" + "\n " + se.getCause().getMessage(); } //log and return if ( logger.isErrorEnabled() ) { logger.error( msg ); } throw se; } } static Commandline buildCmd( File workingDir, String[] cmdAndArgs ) throws ScmException { Commandline cmd = new Commandline(); cmd.setExecutable( BazaarConstants.EXEC ); cmd.setWorkingDirectory( workingDir.getAbsolutePath() ); cmd.addArguments( cmdAndArgs ); if ( !workingDir.exists() ) { boolean success = workingDir.mkdirs(); if ( !success ) { String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir; throw new ScmException( msg ); } } return cmd; } static int executeCmd( BazaarConsumer consumer, Commandline cmd ) throws ScmException { final int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cmd, consumer, consumer ); } catch ( CommandLineException ex ) { throw new ScmException( "Command could not be executed: " + cmd, ex ); } return exitCode; } public static ScmResult execute( File workingDir, String[] cmdAndArgs ) throws ScmException { ScmLogger logger = new DefaultLog(); return execute( new BazaarConsumer( logger ), logger, workingDir, cmdAndArgs ); } public static String[] expandCommandLine( String[] cmdAndArgs, ScmFileSet additionalFiles ) { File[] files = additionalFiles.getFiles(); String[] cmd = new String[files.length + cmdAndArgs.length]; // Copy command into array System.arraycopy( cmdAndArgs, 0, cmd, 0, cmdAndArgs.length ); // Add files as additional parameter into the array for ( int i = 0; i < files.length; i++ ) { String file = files[i].getPath().replace( '\\', File.separatorChar ); cmd[i + cmdAndArgs.length] = file; } return cmd; } public static int getCurrentRevisionNumber( ScmLogger logger, File workingDir ) throws ScmException { String[] revCmd = new String[]{BazaarConstants.REVNO_CMD}; BazaarRevNoConsumer consumer = new BazaarRevNoConsumer( logger ); BazaarUtils.execute( consumer, logger, workingDir, revCmd ); return consumer.getCurrentRevisionNumber(); } /** * Get current (working) revision. *

* Resolve revision to the last integer found in the command output. */ private static class BazaarRevNoConsumer extends BazaarConsumer { private int revNo; BazaarRevNoConsumer( ScmLogger logger ) { super( logger ); } public void doConsume( ScmFileStatus status, String line ) { try { revNo = Integer.valueOf( line ).intValue(); } catch ( NumberFormatException e ) { // ignore } } int getCurrentRevisionNumber() { return revNo; } } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-bazaar/pom.xml0000644000175000017500000000363011322611461025372 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-bazaar Maven SCM Bazaar Provider SCM Provider implementation for Bazaar (http://bazaar-vcs.org/). regexp regexp org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/0000755000175000017500000000000011345536667024266 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/0000755000175000017500000000000011345536667025055 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/site/0000755000175000017500000000000011345536667026021 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/site/site.xml0000644000175000017500000000212711051127665027475 0ustar twernertwerner

maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/0000755000175000017500000000000011345536667026034 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/0000755000175000017500000000000011345536667026755 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/0000755000175000017500000000000011345536667027544 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/0000755000175000017500000000000011345536667030765 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/0000755000175000017500000000000011345536667032073 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536667032655 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033564 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033564 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/AccurevScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000644000175000017500000001414511051264477033562 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.scm.repository.ScmRepositoryException; public class AccurevScmProviderTest extends TestCase { public void testMakeProviderScmRepository() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "user|passwd@testhost.com|5060|TestDepot|TestStream|TestWorkspace", '|' ); assertEquals( "user", repository.getUser() ); assertEquals( "passwd", repository.getPassword() ); assertEquals( "testhost.com", repository.getHost() ); assertEquals( 5060, repository.getPort() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( "TestWorkspace", repository.getWorkspaceName() ); } public void testMakeProviderScmRepositoryColumnDelimeter() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "user:passwd@testhost.com:5060:TestDepot:TestStream:TestWorkspace", ':' ); assertEquals( "user", repository.getUser() ); assertEquals( "passwd", repository.getPassword() ); assertEquals( "testhost.com", repository.getHost() ); assertEquals( 5060, repository.getPort() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( "TestWorkspace", repository.getWorkspaceName() ); } public void testMakeProviderScmRepositoryNoPassword() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "user@testhost.com:5060:TestDepot:TestStream:TestWorkspace", ':' ); assertEquals( "user", repository.getUser() ); assertNull( repository.getPassword() ); assertEquals( "testhost.com", repository.getHost() ); assertEquals( 5060, repository.getPort() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( "TestWorkspace", repository.getWorkspaceName() ); } public void testDefaultCheckoutMethod() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "TestDepot:TestStream:TestWorkspace", ':' ); assertEquals( "pop", repository.getCheckoutMethod() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( "TestWorkspace", repository.getWorkspaceName() ); } public void testMakeProviderScmRepositoryWithoutAccountInfo() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "TestDepot:TestStream:TestWorkspace", ':' ); assertEquals( null, repository.getHost() ); assertEquals( AccuRevScmProviderRepository.DEFAULT_PORT, repository.getPort() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( "TestWorkspace", repository.getWorkspaceName() ); } public void testMakeProviderScmRepositoryWithoutWorkspace() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository repository = (AccuRevScmProviderRepository) provider.makeProviderScmRepository( "TestDepot:TestStream", ':' ); assertEquals( null, repository.getHost() ); assertEquals( AccuRevScmProviderRepository.DEFAULT_PORT, repository.getPort() ); assertEquals( "TestDepot", repository.getDepot() ); assertEquals( "TestStream", repository.getStreamName() ); assertEquals( null, repository.getWorkspaceName() ); } public void testMakeProviderScmRepositoryWithoutStream() { AccuRevScmProvider provider = new AccuRevScmProvider(); try { provider.makeProviderScmRepository( "TestDepot", ':' ); assertFalse( "Stream name should be required", true ); } catch ( ScmRepositoryException e ) { //good } } public void testMakeProviderScmRepositoryWithParams() throws ScmRepositoryException { AccuRevScmProvider provider = new AccuRevScmProvider(); AccuRevScmProviderRepository rep = (AccuRevScmProviderRepository) provider .makeProviderScmRepository( "TestDepot:Stream?param=value¶m2=value2¶m3=", ':' ); assertEquals( "value", rep.getParams().get( "param" ) ); assertEquals( "value2", rep.getParams().get( "param2" ) ); assertEquals( "", rep.getParams().get( "param3" ) ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/commands/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033564 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/commands/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033564 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevScmTckTestCase.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/prov0000644000175000017500000002612611051264477033564 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.checkout; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.manager.BasicScmManager; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProvider; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; public class AccuRevScmTckTestCase extends CheckOutCommandTckTest { private String username; private String password; private String host; private Integer port; private String depot; private String stream; private String initWorkspaceName; private String workspaceName; private MyAccuRevScmProvider scmProvider = new MyAccuRevScmProvider(); private BasicScmManager scmManager; protected ScmManager getScmManager() throws Exception { if ( null == scmManager ) { scmManager = new BasicScmManager(); scmManager.setScmProvider( "accurev", scmProvider ); } return scmManager; } protected void setUp() throws Exception { username = System.getProperty( "test.accurev.username", "test" ); password = System.getProperty( "test.accurev.password", "" ); host = System.getProperty( "test.accurev.host", "localhost" ); port = Integer.getInteger( "test.accurev.port", 5050 ); depot = System.getProperty( "test.accurev.depot", "Test" ); stream = System.getProperty( "test.accurev.stream", "Test" ); initWorkspaceName = "workspace." + System.currentTimeMillis() + "_" + username; workspaceName = "workspace." + ( System.currentTimeMillis() + 1 ) + "_" + username; super.setUp(); } public String getScmUrl( String workspaceName, String checkoutMethod ) throws Exception { // return StringUtils.join( new String[]{ // "scm", "accurev", username, password + "@" + host, String.valueOf( port ), depot, stream, workspaceName // }, ':' ) + "?checkoutMethod=" + checkoutMethod; return new StringBuffer("scm:accurev:") // .append(username) // .append(':') // .append(password) // .append('@') // .append(host) // .append(':') // .append(String.valueOf(port)) // .append(':') // .append(depot) // .append(':') // .append(stream) // .append(':') // .append(workspaceName) // .append("?checkoutMethod=") // .append(checkoutMethod) // .toString(); } public String getScmUrl() throws Exception { return getScmUrl( this.workspaceName, "pop" ); } public void initRepo() throws Exception { String scmUrl = getScmUrl( initWorkspaceName, "mkws" ); //Login ScmRepository scmRepository = getScmManager().makeScmRepository( scmUrl ); scmProvider.login( scmRepository.getProviderRepository(), getScmFileSet(), new CommandParameters() ); File basedir = getScmFileSet().getBasedir(); if ( !basedir.exists() ) { basedir.mkdir(); basedir.mkdirs(); } else { cleanDir( basedir ); } //Check if the base folder is not assosiated with workspace Commandline cl = makeCommandLine( basedir, "info" ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); InfoCommandStreamConsumer infoCommandStreamConsumer = new InfoCommandStreamConsumer(); executeCommandLine( cl, infoCommandStreamConsumer, stdout ); String workspace = infoCommandStreamConsumer.getWorkspace(); if ( null != workspace ) { //Pop everything cl = makeCommandLine( basedir, "pop" ); cl.addArguments( new String[]{"-R", "."} ); executeCommandLine( cl, stdout, stdout ); } else { workspace = initWorkspaceName; //Checkout the test stream CheckOutScmResult result = getScmManager().checkOut( scmRepository, getScmFileSet() ); if ( !result.isSuccess() ) { throw new IllegalStateException( "Cannot checkout the stream" ); } } File[] files = basedir.listFiles(); List filesToDefunct = new ArrayList( files.length ); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; filesToDefunct.add( file.getAbsolutePath() ); } //Clean the test stream if ( filesToDefunct.size() > 0 ) { //Defunct all elements in stream cl = makeCommandLine( basedir, "defunct" ); cl.addArguments( (String[]) filesToDefunct.toArray( new String[filesToDefunct.size()] ) ); stdout = new CommandLineUtils.StringStreamConsumer(); executeCommandLine( cl, stdout, stdout ); //Promote defuncted files promote( filesToDefunct, basedir ); } //Add files expected by the tests to the repository String[] filesToCreate = { "/pom.xml", "/readme.txt", "/src/main/java/Application.java", "/src/test/java/Test.java" }; List filesToPromote = new ArrayList(); for ( int i = 0; i < filesToCreate.length; i++ ) { String fileToCreate = filesToCreate[i]; File file = new File( basedir.getAbsolutePath() + fileToCreate.replace( '/', File.separatorChar ) ); file.getParentFile().mkdirs(); writeContentsToFile( file, fileToCreate ); addToWorkingTree( basedir, file, scmRepository ); filesToPromote.add( file.getAbsolutePath() ); } promote( filesToPromote, basedir ); //remove the workspace removeWorkspace( basedir, workspace ); cleanDir( basedir ); } private void promote( List files, File basedir ) throws CommandLineException { Commandline cl = makeCommandLine( basedir, "promote" ); cl.addArguments( (String[]) files.toArray( new String[files.size()] ) ); CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); executeCommandLine( cl, stdout, stdout ); } private void writeContentsToFile( File file, String contents ) throws IOException { FileWriter fileWriter = new FileWriter( file, false ); fileWriter.write( contents ); fileWriter.close(); } private void removeWorkspace( File commandBasedir, String workspace ) throws CommandLineException { CommandLineUtils.StringStreamConsumer stdout; Commandline cl; stdout = new CommandLineUtils.StringStreamConsumer(); cl = makeCommandLine( commandBasedir, "rmws" ); cl.addArguments( new String[]{"-s", workspace} ); executeCommandLine( cl, stdout, stdout ); } private void cleanDir( File basedir ) { if ( !removeFilesInDir( basedir ) ) { throw new IllegalStateException( "Files in checkout directory cannot be deleted" ); } } private boolean removeFilesInDir( File dir ) { if ( !dir.isDirectory() ) { throw new IllegalArgumentException( "\"" + dir + "\" not a directory" ); } boolean res = true; File[] files = dir.listFiles(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; if ( file.isDirectory() ) { res &= removeFilesInDir( file ); continue; } res &= file.delete(); } return res; } private Commandline makeCommandLine( File basedir, String command ) { Commandline cl; cl = new Commandline(); cl.setWorkingDirectory( basedir.getAbsolutePath() ); cl.setExecutable( "accurev" ); cl.addArguments( new String[]{command, "-H", host + ":" + port} ); return cl; } private static void executeCommandLine( Commandline cl, CommandLineUtils.StringStreamConsumer stdOutConsumer, CommandLineUtils.StringStreamConsumer errOutConsumer ) throws CommandLineException { int exitCode = CommandLineUtils.executeCommandLine( cl, stdOutConsumer, errOutConsumer ); if ( exitCode != 0 ) { throw new IllegalStateException( "Cannot execute command: \"" + cl.toString() + "\"." + "\nOutput: \n" + stdOutConsumer.getOutput() + "\nError output: \n" + errOutConsumer.getOutput() + "" ); } } public class MyAccuRevScmProvider extends AccuRevScmProvider { public LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { return super.login( repository, fileSet, parameters ); } } private class InfoCommandStreamConsumer extends CommandLineUtils.StringStreamConsumer { private String workspace; private final Pattern pattern = Pattern.compile( "Workspace/ref:\\s*(.*)" ); public InfoCommandStreamConsumer() { } public void consumeLine( String line ) { super.consumeLine( line ); Matcher m = pattern.matcher( line ); if ( m.matches() ) { workspace = m.group( 1 ); } } public String getWorkspace() { return workspace; } } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/0000755000175000017500000000000011345536667026001 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/0000755000175000017500000000000011345536667026722 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/0000755000175000017500000000000011345536667027511 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/0000755000175000017500000000000011345536667030732 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/0000755000175000017500000000000011345536667032040 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536667032622 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000003402311057610744033522 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.commands.add.AccuRevAddCommand; import org.apache.maven.scm.provider.accurev.commands.login.AccuRevLoginCommand; import org.apache.maven.scm.provider.accurev.commands.checkout.BaseAccuRevCheckOutCommand; import org.apache.maven.scm.provider.accurev.commands.checkout.AccuRevCheckOutWorkspaceCommand; import org.apache.maven.scm.provider.accurev.commands.checkout.AccuRevCheckOutUsingPopCommand; import org.apache.maven.scm.repository.ScmRepositoryException; import org.codehaus.plexus.util.Os; import org.codehaus.plexus.util.StringUtils; import java.util.LinkedList; import java.util.List; /** * Implementation of Accurev integration with Maven SCM * * @version $Id: AccuRevScmProvider.java 691810 2008-09-03 22:38:28Z vsiveton $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="accurev" */ public class AccuRevScmProvider extends AbstractScmProvider { private final String accurevExecutable; private AccuRevAddCommand addCommand; private AccuRevLoginCommand loginCommand; private BaseAccuRevCheckOutCommand[] checkOutCommands; private static final String CHECKOUT_METHOD_PARAM_NAME = "checkoutMethod"; private static final String CHECKOUT_METHOD_SYS_PROPERTY = "accurev.checkout.method"; public AccuRevScmProvider() { this.accurevExecutable = resolveAccurevExecutable( Os.isFamily( "windows" ) ); } /** {@inheritDoc} */ public String getScmType() { return "accurev"; } protected String getAccurevExecutable() { return this.accurevExecutable; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { AccuRevScmProviderRepository rep = new AccuRevScmProviderRepository(); int atSignIdx = scmSpecificUrl.indexOf( '@' ); if ( atSignIdx != -1 ) { //User, password, host and port are specified String beforeAt = scmSpecificUrl.substring( 0, atSignIdx ); String afterAt = scmSpecificUrl.substring( atSignIdx + 1 ); LinkedList parts = splitString( beforeAt, delimiter, true ); if ( parts.isEmpty() ) { throw new ScmRepositoryException( "Username is required" ); } rep.setUser( (String) parts.removeFirst() ); if ( !parts.isEmpty() ) { rep.setPassword( (String) parts.removeFirst() ); } int hostEndIdx = afterAt.indexOf( delimiter ); if ( hostEndIdx == -1 ) { throw new ScmRepositoryException( "Invalid SCM URL" ); } String host = afterAt.substring( 0, hostEndIdx ); rep.setHost( host ); int idx = afterAt.indexOf( delimiter, hostEndIdx + 1 ); if ( idx == -1 ) { throw new ScmRepositoryException( "Invalid SCM URL" ); } String eitherPortOrNextToken = afterAt.substring( hostEndIdx + 1, idx ); try { rep.setPort( Integer.parseInt( eitherPortOrNextToken ) ); } catch ( NumberFormatException e ) { idx = hostEndIdx; } scmSpecificUrl = afterAt.substring( idx + 1 ); } int paramStartIdx = scmSpecificUrl.indexOf( '?' ); if ( paramStartIdx != -1 ) { String params = scmSpecificUrl.substring( paramStartIdx + 1 ); scmSpecificUrl = scmSpecificUrl.substring( 0, paramStartIdx ); processParams( params, rep ); } processDepotStreamAndWorkspace( scmSpecificUrl, delimiter, rep ); String checkoutMethodParam = (String) rep.getParams().get( CHECKOUT_METHOD_PARAM_NAME ); if ( StringUtils.isNotEmpty( checkoutMethodParam ) ) { //Set checkout method from the SCM URL parameter rep.setCheckoutMethod( checkoutMethodParam.trim() ); } if ( rep.getCheckoutMethod() == null ) { //Get from system property or use "pop" by default rep.setCheckoutMethod( System.getProperty( CHECKOUT_METHOD_SYS_PROPERTY, "pop" ) ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Repository created: " + rep.toString() ); } return rep; } private void processParams( String params, AccuRevScmProviderRepository rep ) { //Parse params String[] paramKeyValuePairs = StringUtils.split( params, "&" ); for ( int i = 0; i < paramKeyValuePairs.length; i++ ) { String keyValuePair = paramKeyValuePairs[i]; int delimiterIdx = keyValuePair.indexOf( '=' ); if ( delimiterIdx == -1 ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Invalid parameter \"" + keyValuePair + "\" at position " + i ); } continue; } String key = keyValuePair.substring( 0, delimiterIdx ); String value = keyValuePair.substring( delimiterIdx + 1 ); //Store parameter rep.getParams().put( key, value ); } } /** {@inheritDoc} */ protected LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { if ( null == this.loginCommand ) { //Lazy command instantiation this.loginCommand = new AccuRevLoginCommand( this.accurevExecutable ); this.loginCommand.setLogger( getLogger() ); } return (LoginScmResult) this.loginCommand.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { AccuRevScmProviderRepository rep = (AccuRevScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "accurev.checkout.method = " + rep.getCheckoutMethod() ); } BaseAccuRevCheckOutCommand[] checkOutCmds = getCheckoutCommands(); //Find check-out command that supports specified method for ( int i = 0; i < checkOutCmds.length; i++ ) { BaseAccuRevCheckOutCommand checkOutCommand = checkOutCmds[i]; if ( checkOutCommand.getMethodName().equalsIgnoreCase( rep.getCheckoutMethod() ) ) { return (CheckOutScmResult) checkOutCommand.execute( repository, fileSet, parameters ); } } throw new ScmRepositoryException( "accurev.checkout.method=" + rep.getCheckoutMethod() + " is not supported" ); } /** {@inheritDoc} */ protected AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { //Lazy command creation if ( null == addCommand ) { addCommand = new AccuRevAddCommand( this.accurevExecutable ); addCommand.setLogger( getLogger() ); } return (AddScmResult) addCommand.execute( repository, fileSet, parameters ); } private BaseAccuRevCheckOutCommand[] getCheckoutCommands() { if ( null == this.checkOutCommands ) { //Lazy command instantiation this.checkOutCommands = buildCheckOutCommands(); } return this.checkOutCommands; } protected BaseAccuRevCheckOutCommand[] buildCheckOutCommands() { BaseAccuRevCheckOutCommand[] commands = { new AccuRevCheckOutUsingPopCommand( this.accurevExecutable ), new AccuRevCheckOutWorkspaceCommand( this.accurevExecutable ) }; for ( int i = 0; i < commands.length; i++ ) { BaseAccuRevCheckOutCommand command = commands[i]; command.setLogger( getLogger() ); } return commands; } /** * Append host (-H) parameter to the params list if the repository has this information * * @param repository AccuRevScmProviderRepository * @param params Parameters */ public static void appendHostToParamsIfNeeded( AccuRevScmProviderRepository repository, List params ) { if ( repository.getHost() != null ) { params.add( "-H" ); params.add( repository.getHost() + ":" + String.valueOf( repository.getPort() ) ); } } /** * Resolves accurev executable * * @param windows Is OS is windows * @return AccuRev executable * @throws IllegalStateException If the executable cannot be resolved */ private static String resolveAccurevExecutable( boolean windows ) { String executable = "accurev"; //Append ".exe" suffix if the OS is Windows if ( windows ) { executable += ".exe"; } //Grab exeucutable from system variable if specified String accurevExecutable = System.getProperty( "accurevExecutable" ); if ( accurevExecutable != null ) { executable = accurevExecutable; } return executable; } /** * Split the given string with separator char * * @param string String to be splitted * @param separatorChar separator char * @param blankIsNull If the parameter is true then if the substring is blank then it will be considered as null * @return Linked list which contains strings */ private static LinkedList splitString( String string, char separatorChar, boolean blankIsNull ) { LinkedList parts = new LinkedList(); int fromIdx = 0; for ( int idx; ( idx = string.indexOf( separatorChar, fromIdx ) ) != -1; fromIdx = ++idx ) { parts.add( getSubstring( string, fromIdx, idx, blankIsNull ) ); } //Add last token parts.add( getSubstring( string, fromIdx, string.length(), blankIsNull ) ); return parts; } /** * Get substring from string * * @param string source string * @param fromIdx from index * @param toIdx to index * @param blankIsNull If the parameter is true then if the substring is blank then null will be returned * @return Substring or the null if the substring is empty and the blankIsNull parameter is true * @see String#substring(int,int) * @see StringUtils#isBlank(String) */ private static String getSubstring( String string, int fromIdx, int toIdx, boolean blankIsNull ) { String substring = string.substring( fromIdx, toIdx ); return ( blankIsNull && StringUtils.isEmpty( substring ) ) ? null : substring; } /** * Process depot, stream and workspace from the given string * * @param depotStreamWorkspace String that contains depot, stream and workspace name information * @param delimeter Delimeter char * @param repRef AccuRevScmProviderRepository reference where the information will be stored * @throws ScmRepositoryException If there was a validation error while processing the URL */ private void processDepotStreamAndWorkspace( final String depotStreamWorkspace, final char delimeter, final AccuRevScmProviderRepository repRef ) throws ScmRepositoryException { LinkedList parts = splitString( depotStreamWorkspace, delimeter, true ); if ( parts.size() < 2 ) { throw new ScmRepositoryException( "Invalid scmUrl. Depot and stream names are required" ); } //Set depot String depot = (String) parts.removeFirst(); if ( null == depot ) { throw new ScmRepositoryException( "Depot name is missing" ); } repRef.setDepot( depot ); //Set stream String streamName = (String) parts.removeFirst(); if ( null == streamName ) { throw new ScmRepositoryException( "Stream name is missing" ); } repRef.setStreamName( streamName ); //Set workspace if specified if ( !parts.isEmpty() ) { repRef.setWorkspaceName( (String) parts.removeFirst() ); } if ( !parts.isEmpty() ) { throw new ScmRepositoryException( "Invalid workspace assosiation path: " + depotStreamWorkspace + ". Should be in format \"" + delimeter + "" + delimeter + "\"" ); } if ( repRef.getWorkspaceName() == null ) { //TODO Use 'accurev show wspaces' to resolve the workspace name by the workspace path } } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/AccuRevScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000575311051264477033534 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepository; import java.util.Map; import java.util.HashMap; /** * @version $Id: AccuRevScmProviderRepository.java 686195 2008-08-15 11:32:15Z vsiveton $ */ public class AccuRevScmProviderRepository extends ScmProviderRepository { public static final int DEFAULT_PORT = 5050; private String depot; private String streamName; private String workspaceName; private String host; private int port = DEFAULT_PORT; private String checkoutMethod; private Map params = new HashMap(); public String getDepot() { return depot; } public void setDepot( String depot ) { this.depot = depot; } public String getStreamName() { return streamName; } public void setStreamName( String streamName ) { this.streamName = streamName; } public String getWorkspaceName() { return workspaceName; } public void setWorkspaceName( String workspaceName ) { this.workspaceName = workspaceName; } public String getHost() { return host; } public void setHost( String host ) { this.host = host; } public int getPort() { return port; } public void setPort( int port ) { this.port = port; } public String getCheckoutMethod() { return checkoutMethod; } public void setCheckoutMethod( String checkoutMethod ) { this.checkoutMethod = checkoutMethod; } public Map getParams() { return params; } public void setParams( Map params ) { this.params = params; } /** {@inheritDoc} */ public String toString() { return new StringBuffer().append( "host:" ).append( this.host ).append( ", port:" ).append( this.port ) .append( ", depot:" ).append( this.depot ).append( ", streamName:" ).append( this.streamName ) .append( ", workspaceName:" ).append( this.workspaceName ).append( ", checkoutMethod:" ) .append( this.checkoutMethod ).append( ", params:" ).append( this.params ).toString(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/login/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/login/AccuRevLoginCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000767411051264477033540 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.login; /* * 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. */ import java.util.ArrayList; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.login.AbstractLoginCommand; import org.apache.maven.scm.command.login.LoginScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProvider; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @version $Id: AccuRevLoginCommand.java 686195 2008-08-15 11:32:15Z vsiveton $ */ public class AccuRevLoginCommand extends AbstractLoginCommand { private String executable; public AccuRevLoginCommand( String executable ) { this.executable = executable; } /** {@inheritDoc} */ public LoginScmResult executeLoginCommand( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); String username = repository.getUser(); if ( null == username ) { //No need to login return new LoginScmResult( null, null, null, true ); } //Do the login Commandline cl = createLoginCommandLine( (AccuRevScmProviderRepository) repository ); try { int exitCode = CommandLineUtils.executeCommandLine( cl, stderr, stderr ); //Create result based on exit code LoginScmResult scmResult; if ( exitCode != 0 ) { scmResult = new LoginScmResult( cl.toString(), null, stderr.getOutput(), false ); } else { scmResult = new LoginScmResult( cl.toString(), null, null, true ); } return scmResult; } catch ( CommandLineException e ) { throw new ScmException( e.getMessage(), e ); } } /** * Creates the login command line * * @param repository AccuRevScmProviderRepository object * @return Commadline object to perform login */ protected Commandline createLoginCommandLine( AccuRevScmProviderRepository repository ) { Commandline cl = new Commandline(); cl.setExecutable( this.executable ); ArrayList params = new ArrayList(); params.add( "login" ); //Append host info AccuRevScmProvider.appendHostToParamsIfNeeded( repository, params ); //Append command params params.add( repository.getUser() ); String password = repository.getPassword(); params.add( StringUtils.isEmpty( password ) ? "\"\"" : password ); //Set arguments to command line cl.addArguments( (String[]) params.toArray( new String[params.size()] ) ); return cl; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/BaseAccuRevCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000212511051264477033522 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.checkout; /* * 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. */ import org.apache.maven.scm.command.Command; /** * @version $Id: BaseAccuRevCheckOutCommand.java 686195 2008-08-15 11:32:15Z vsiveton $ */ public interface BaseAccuRevCheckOutCommand extends Command { String getMethodName(); } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutWorkspaceCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001525511057002547033524 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProvider; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @version $Id: AccuRevCheckOutWorkspaceCommand.java 690992 2008-09-01 15:08:23Z vsiveton $ */ public class AccuRevCheckOutWorkspaceCommand extends AbstractCheckOutCommand implements BaseAccuRevCheckOutCommand { private String accuRevExecutable; public AccuRevCheckOutWorkspaceCommand( String executable ) { this.accuRevExecutable = executable; } /** {@inheritDoc} */ public String getMethodName() { return "mkws"; } /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { try { final CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); //Create checkout folder if missing if ( !fileSet.getBasedir().exists() ) { fileSet.getBasedir().mkdirs(); } //Make new workspace AccuRevScmProviderRepository accurevRepository = (AccuRevScmProviderRepository) repository; Commandline makeCommandline = createMakeWorkspaceCommandLine( accurevRepository, fileSet, version ); int exitCode = CommandLineUtils.executeCommandLine( makeCommandline, stdout, stdout ); if ( exitCode != 0 ) { return new CheckOutScmResult( makeCommandline.toString(), "The AccuRev command failed. Cannot create workspace: " + stdout.getOutput(), stdout.getOutput(), false ); } //Update the workspace Commandline updateCommandline = createUpdateWorkspaceCommand( accurevRepository, fileSet, version ); final ArrayList checkedFiles = new ArrayList(); exitCode = CommandLineUtils.executeCommandLine( updateCommandline, new AbstractConsumer( getLogger() ) { private Pattern pattern = Pattern.compile( "Updating element (.*)" ); public void consumeLine( String line ) { //Consume line to stdout consumer stdout.consumeLine( line ); //Check if the line is matching pattern Matcher m = pattern.matcher( line ); if ( m.matches() ) { checkedFiles.add( m.group( 1 ) ); } } }, stdout ); //Check if the update command successeed if ( exitCode != 0 ) { return new CheckOutScmResult( updateCommandline.toString(), "The AccuRev command failed. Cannot update workspace", stdout.getOutput(), false ); } return new CheckOutScmResult( makeCommandline.toString() + " & " + updateCommandline.toString(), checkedFiles ); } catch ( CommandLineException e ) { throw new ScmException( "internal error" ); } } protected Commandline createUpdateWorkspaceCommand( AccuRevScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) { //TODO Implement support of fileSet, version if applyable Commandline commandline = new Commandline(); commandline.setExecutable( this.accuRevExecutable ); ArrayList params = new ArrayList(); //Append command name params.add( "update" ); //Append host if needed AccuRevScmProvider.appendHostToParamsIfNeeded( repository, params ); //Append command parameters params.add( "-r" ); params.add( repository.getWorkspaceName() ); //Set command parameters commandline.addArguments( (String[]) params.toArray( new String[params.size()] ) ); return commandline; } protected Commandline createMakeWorkspaceCommandLine( AccuRevScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) { //TODO Implement support of fileSet, version if applyable Commandline cmd = new Commandline(); cmd.setExecutable( this.accuRevExecutable ); //Append command name cmd.addArguments( new String[] { "mkws" } ); //Append host param if needed List params = new ArrayList(); AccuRevScmProvider.appendHostToParamsIfNeeded( repository, params ); cmd.addArguments( (String[]) params.toArray( new String[params.size()] ) ); //Append command arguments cmd.addArguments( new String[] { "-w", repository.getWorkspaceName(), "-b", repository.getStreamName(), "-l", fileSet.getBasedir().getAbsolutePath() } ); return cmd; } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/checkout/AccuRevCheckOutUsingPopCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001403511057002547033517 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProvider; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import java.util.regex.Matcher; /** * @version $Id: AccuRevCheckOutUsingPopCommand.java 690992 2008-09-01 15:08:23Z vsiveton $ */ public class AccuRevCheckOutUsingPopCommand extends AbstractCheckOutCommand implements BaseAccuRevCheckOutCommand { private String accuRevExecutable; public AccuRevCheckOutUsingPopCommand( String executable ) { this.accuRevExecutable = executable; } /** {@inheritDoc} */ public String getMethodName() { return "pop"; } /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { try { AccuRevScmProviderRepository accurevRepository = (AccuRevScmProviderRepository) repository; final CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); //Update the workspace Commandline popCommandline = createPopStreamCommand( accurevRepository, fileSet, version ); //Create checkout folder if missing if ( !fileSet.getBasedir().exists() ) { fileSet.getBasedir().mkdirs(); } final ArrayList checkedFiles = new ArrayList(); int exitCode = CommandLineUtils.executeCommandLine( popCommandline, new StreamConsumer() { Pattern pattern = Pattern.compile( "Populating element (.*)" ); public void consumeLine( String line ) { stdout.consumeLine( line ); //Collect list of files poped from the stream Matcher m = pattern.matcher( line ); if ( m.matches() ) { checkedFiles.add( m.group( 1 ) ); } } }, stdout ); //Check if the update command successeed if ( exitCode != 0 ) { return new CheckOutScmResult( popCommandline.toString(), "The AccuRev command failed", stdout .getOutput(), false ); } if ( getLogger().isInfoEnabled() ) { getLogger().info( "Checked out stream \"" + accurevRepository.getStreamName() + "\" contents to folder " + fileSet.getBasedir() ); //TODO notify user that the checked files are not in workspace and no changes can be propagated to SCM } return new CheckOutScmResult( popCommandline.toString(), checkedFiles ); } catch ( CommandLineException e ) { throw new ScmException( "internal error" ); } } protected Commandline createPopStreamCommand( AccuRevScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) { //TODO Implement support of fileSet, version if applyable Commandline commandline = new Commandline(); commandline.setExecutable( this.accuRevExecutable ); ArrayList params = new ArrayList(); //Append command name params.add( "pop" ); //Append host if needed AccuRevScmProvider.appendHostToParamsIfNeeded( repository, params ); //Set command parameters commandline.addArguments( (String[]) params.toArray( new String[params.size()] ) ); //Append command parameters commandline.addArguments( new String[] { "-v", repository.getStreamName(), //name of the stream "-L", fileSet.getBasedir().getAbsolutePath(), //into folder "-R" //get files recursively } ); List fileSetArguments = new ArrayList(); String filelistParam = (String) repository.getParams().get( "include" ); if ( null == filelistParam ) { //Add all by default fileSetArguments.add( "." ); } else { String[] elements = StringUtils.split( filelistParam, "," ); fileSetArguments.addAll( Arrays.asList( elements ) ); } commandline.addArguments( (String[]) fileSetArguments.toArray( new String[fileSetArguments.size()] ) ); return commandline; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536667033531 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AccuRevAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000707111051264477033527 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.add; /* * 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. */ import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository; import org.apache.maven.scm.provider.accurev.AccuRevScmProvider; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineException; import java.util.ArrayList; import java.util.List; import java.io.File; /** * @version $Id: AccuRevAddCommand.java 686195 2008-08-15 11:32:15Z vsiveton $ */ public class AccuRevAddCommand extends AbstractAddCommand { private final String accurevExecutable; public AccuRevAddCommand( String accurevExec ) { accurevExecutable = accurevExec; } /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { Commandline cl = new Commandline(); cl.setExecutable( accurevExecutable ); cl.setWorkingDirectory( fileSet.getBasedir().getPath() ); cl.addArguments( new String[]{"add"} ); ArrayList params = new ArrayList(); AccuRevScmProvider.appendHostToParamsIfNeeded( (AccuRevScmProviderRepository) repository, params ); cl.addArguments( (String[]) params.toArray( new String[params.size()] ) ); cl.addArguments( makeFileArgs( fileSet.getFileList() ) ); final List filesAdded = new ArrayList(); final CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); try { if ( 0 != CommandLineUtils.executeCommandLine( cl, new AddCommandStreamConsumer( stdout, filesAdded ), stdout ) ) { return new AddScmResult( cl.toString(), null, stdout.getOutput(), false ); } } catch ( CommandLineException e ) { throw new ScmRepositoryException( "Cannot exeucute add command", e ); } return new AddScmResult( cl.toString(), filesAdded ); } private String[] makeFileArgs( List/*File*/ fileList ) { ArrayList res = new ArrayList(); for ( int i = 0; i < fileList.size(); i++ ) { File file = (File) fileList.get( i ); res.add( file.getAbsolutePath() ); } return (String[]) res.toArray( new String[res.size()] ); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/provider/accurev/commands/add/AddCommandStreamConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000375711051264477033536 0ustar twernertwernerpackage org.apache.maven.scm.provider.accurev.commands.add; /* * 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. */ import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Stream consumer for collecting files that were added with the add command * * @version $Id: AddCommandStreamConsumer.java 686195 2008-08-15 11:32:15Z vsiveton $ */ class AddCommandStreamConsumer implements StreamConsumer { private static final Pattern PATTERN = Pattern.compile( "Added and kept element\\s*(.*)" ); private final StreamConsumer stdout; private final List filesAdded; /** * @param stdout The delegating stream consumer * @param filesAdded A collection in which added elements should be stored */ public AddCommandStreamConsumer( StreamConsumer stdout, List filesAdded ) { this.stdout = stdout; this.filesAdded = filesAdded; } /** {@inheritDoc} */ public void consumeLine( String line ) { stdout.consumeLine( line ); Matcher m = PATTERN.matcher( line ); if ( m.matches() ) { String element = m.group( 1 ); this.filesAdded.add( element ); } } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-accurev/pom.xml0000644000175000017500000001076011322611461025564 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-accurev Maven SCM AccuRev Provider SCM Provider implementation for AccuRev (http://www.accurev.com/). test localhost 5050 TestDepot TestStream org.apache.maven.scm maven-scm-api junit junit test org.apache.maven.scm maven-scm-test test org.codehaus.plexus plexus-maven-plugin descriptor org.apache.maven.plugins maven-surefire-plugin **/*TckTest*.java TckTests org.apache.maven.plugins maven-surefire-plugin none **/*TckTest*.java test.accurev.username ${test.accurev.username} test.accurev.password ${test.accurev.password} test.accurev.host ${test.accurev.host} test.accurev.port ${test.accurev.port} test.accurev.stream ${test.accurev.stream} test.accurev.depot ${test.accurev.depot} maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/0000755000175000017500000000000011345536665023447 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/0000755000175000017500000000000011345536665024236 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/site/0000755000175000017500000000000011345536665025202 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/site/site.xml0000644000175000017500000000212311051127665026654 0ustar twernertwerner maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/0000755000175000017500000000000011345536664025214 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/resources/0000755000175000017500000000000011345536664027226 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/resources/test.txt0000644000175000017500000001065511304273113030733 0ustar twernertwernerDiffing: $/Data Against: C:\Java\my-little-test-project\target\working-directory\11 Local files not in the current project: log.txt release.properties Diffing: $/Data/.settings Against: C:\Java\my-little-test-project\target\working-directory\11\.settings Diffing: $/Data/HOW_TO Against: C:\Java\my-little-test-project\target\working-directory\11\HOW_TO Diffing: $/Data/JavaSource Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource Diffing: $/Data/JavaSource/com Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com Diffing: $/Data/JavaSource/com/company Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company Diffing: $/Data/JavaSource/com/company/data Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data Diffing: $/Data/JavaSource/com/company/data/caller Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\caller Diffing: $/Data/JavaSource/com/company/data/dal Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\dal Diffing: $/Data/JavaSource/com/company/data/dal/dao Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\dal\dao Diffing: $/Data/JavaSource/com/company/data/dal/stub Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\dal\stub Diffing: $/Data/JavaSource/com/company/data/dataholder Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\dataholder Diffing: $/Data/JavaSource/com/company/data/exception Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\exception Diffing: $/Data/JavaSource/com/company/data/factory Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\factory Diffing: $/Data/JavaSource/com/company/data/handler Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\handler Diffing: $/Data/JavaSource/com/company/data/message Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\message Diffing: $/Data/JavaSource/com/company/data/testharness Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\testharness Diffing: $/Data/JavaSource/com/company/data/testharness/dataholder Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\testharness\dataholder Diffing: $/Data/JavaSource/com/company/data/testharness/test Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\testharness\test Diffing: $/Data/JavaSource/com/company/data/util Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\util Diffing: $/Data/JavaSource/com/company/data/webservice Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice Diffing: $/Data/JavaSource/com/company/data/webservice/config Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\config Diffing: $/Data/JavaSource/com/company/data/webservice/exception Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\exception Diffing: $/Data/JavaSource/com/company/data/webservice/ICan Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\ICan Diffing: $/Data/JavaSource/com/company/data/webservice/parser Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\parser Diffing: $/Data/JavaSource/com/company/data/webservice/service Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\service Diffing: $/Data/JavaSource/com/company/data/webservice/service/flow Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\service\flow Diffing: $/Data/JavaSource/com/company/data/webservice/service/pstep Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\com\company\ data\webservice\service\pstep Diffing: $/Data/JavaSource/META-INF Against: C:\Java\my-little-test-project\target\working-directory\11\JavaSource\META-INF maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/0000755000175000017500000000000011345536664026135 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/0000755000175000017500000000000011345536664026724 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/0000755000175000017500000000000011345536664030145 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/0000755000175000017500000000000011345536664031253 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536664032035 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/VssScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000565610535556312033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; /** * @author Emmanuel Venisse * @version $Id: VssScmProviderTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class VssScmProviderTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testScmUrl() throws Exception { testUrl( "scm:vss|vssdir|projectPath", "vssdir", "projectPath", null, null ); testUrl( "scm:vss|username@vssdir|projectPath", "vssdir", "projectPath", "username", null ); testUrl( "scm:vss|username|password@vssdir|projectPath", "vssdir", "projectPath", "username", "password" ); } private void testUrl( String scmUrl, String expectedVssDir, String expectedProjectPath, String expectedUser, String expectedPassword ) throws Exception { ScmRepository repository = scmManager.makeScmRepository( scmUrl ); assertNotNull( "ScmManager.makeScmRepository() returned null", repository ); assertNotNull( "The provider repository was null.", repository.getProviderRepository() ); assertTrue( "The SCM Repository isn't a " + VssScmProviderRepository.class.getName() + ".", repository.getProviderRepository() instanceof VssScmProviderRepository ); VssScmProviderRepository providerRepository = (VssScmProviderRepository) repository.getProviderRepository(); assertEquals( "vssdir is incorrect", expectedVssDir, providerRepository.getVssdir() ); assertEquals( "projectPath is incorrect", expectedProjectPath, providerRepository.getProject() ); assertEquals( "User is incorrect", expectedUser, providerRepository.getUser() ); assertEquals( "Password is incorrect", expectedPassword, providerRepository.getPassword() ); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000447011015073323033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.update; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: VssUpdateCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class VssUpdateCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testCommandLine() throws Exception { ScmRepository repository = scmManager.makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssUpdateCommand command = new VssUpdateCommand(); Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet, null ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Get $D:/myProject -Yusername,password -R -I- -GWS", fileSet.getBasedir(), cl ); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000450211015073323033571 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.checkout; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: VssCheckOutCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class VssCheckOutCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testCommandLine() throws Exception { ScmRepository repository = scmManager.makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssCheckOutCommand command = new VssCheckOutCommand(); Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet, null ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Get $D:/myProject -Yusername,password -R -I- -GWR", fileSet.getBasedir(), cl ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000553311304273113033576 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.status; /* * 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. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.NoSuchScmProviderException; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.manager.plexus.PlexusLogger; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.codehaus.plexus.util.IOUtil; /** * @author Mateus Pimenta * */ public class VssStatusConsumerTest extends ScmTestCase { private ScmManager scmManager; private org.codehaus.plexus.logging.Logger logger; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); logger = getContainer().getLogger(); } public void testConsumeLine() throws ScmRepositoryException, NoSuchScmProviderException, IOException { BufferedReader reader = new BufferedReader( new InputStreamReader( this.getResourceAsStream( "/test.txt" ), "UTF-8" ) ); try { ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssStatusConsumer consumer = new VssStatusConsumer( (VssScmProviderRepository) repository .getProviderRepository(), new PlexusLogger( logger ), fileSet ); String line = reader.readLine(); while ( line != null ) { consumer.consumeLine( line ); line = reader.readLine(); } } finally { IOUtil.close( reader ); } } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000444311015073323033575 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.status; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: VssStatusCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class VssStatusCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testCommandLine() throws Exception { ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssStatusCommand command = new VssStatusCommand(); Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Diff $D:/myProject -Yusername,password -R -I-", fileSet.getBasedir(), cl ); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/VssCommandLineUtilsTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000001273211013107460033573 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; /** * @author Allan Lang * @version $Id: VssCommandLineUtilsTest.java 656802 2008-05-15 19:29:52Z evenisse $ */ public class VssCommandLineUtilsTest extends ScmTestCase { private static final String VSS_DIRECTORY_PROPERTY = "vssDirectory"; //private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); //scmManager = getScmManager(); } public void testGetSettings() throws IOException { /* * If we have a genuine settings file, take a copy of this first Create * the test settings file Check getSettings from file Delete the test * settings file Check getSettings without file Check getSettings with * system property Re-instate original settings file, if existing * */ final String vssInstallPath = "c:\\wherever"; final String vssInstallPathAlt = "c:\\somewhere"; final String settingsXml = "" + vssInstallPath + ""; final String settingsFilename = "vss-settings.xml"; final String backupFilename = settingsFilename + ".backup"; boolean preExistingScmFolder = false; boolean preExistingSettings = false; /* * Create a backup of the current settings file, if one exists */ File scmUserHome = new File( getTestFile( "target/vssdir" ), ".scm" ); if ( scmUserHome.exists() ) { preExistingScmFolder = true; File settingsFile = new File( scmUserHome, settingsFilename ); if ( settingsFile.exists() ) { preExistingSettings = true; settingsFile.renameTo( new File( scmUserHome, backupFilename ) ); } } else { scmUserHome.mkdirs(); } /* * Create the test settings file */ File testSettings = new File( scmUserHome, settingsFilename ); FileOutputStream fos = new FileOutputStream( testSettings ); fos.write( settingsXml.getBytes() ); fos.flush(); fos.close(); fos = null; /* * Validate that setting from settings file is returned correctly */ VssCommandLineUtils.setScmConfDir( scmUserHome ); assertEquals( vssInstallPath, VssCommandLineUtils.getSettings().getVssDirectory() ); /* * Validate that setting is overridden by system property */ System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathAlt ); assertEquals( vssInstallPathAlt, VssCommandLineUtils.getSettings().getVssDirectory() ); /* * Delete the test settings file */ testSettings.delete(); /* * Validate that setting is still equal to system property */ assertEquals( vssInstallPathAlt, VssCommandLineUtils.getSettings().getVssDirectory() ); /* * Re-instate the original settings file, if one existed */ if ( preExistingSettings ) { File backup = new File( scmUserHome, backupFilename ); backup.renameTo( new File( scmUserHome, settingsFilename ) ); } if ( !preExistingScmFolder ) { scmUserHome.delete(); } } public void testGetSsDir() { final String vssInstallPathWindowsStyle = "c:\\vss\\bin"; final String vssInstallPathUnixStyle = "c:/vss/bin"; final String targetValue = "c:/vss/bin/"; // Windows style test System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathWindowsStyle ); assertEquals( targetValue, VssCommandLineUtils.getSsDir() ); // Unix style test System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathUnixStyle ); assertEquals( targetValue, VssCommandLineUtils.getSsDir() ); // Windows style with folder indicator System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathWindowsStyle + "\\" ); assertEquals( targetValue, VssCommandLineUtils.getSsDir() ); // Unix style with folder indicator System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathUnixStyle + "/" ); assertEquals( targetValue, VssCommandLineUtils.getSsDir() ); // Unix style with Windows style folder indicator System.setProperty( VSS_DIRECTORY_PROPERTY, vssInstallPathUnixStyle + "\\" ); assertEquals( targetValue, VssCommandLineUtils.getSsDir() ); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000001566311305032234033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.edit; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.Arrays; import java.util.List; /** * @author Emmanuel Venisse * @version $Id: VssEditCommandTest.java 885584 2009-11-30 21:09:48Z olamy $ */ public class VssEditCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testCommandLine() throws Exception { ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssEditCommand command = new VssEditCommand(); List commands = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); Commandline cl = (Commandline) commands.get( 0 ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Checkout $D:/myProject -R -Yusername,password -I-", fileSet.getBasedir(), cl ); } public void testCommandLineFileSet() throws Exception { File target = getTestFile( "." ); ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( target, "**/target/**/VssEditCommandTest.class" ); VssEditCommand command = new VssEditCommand(); List commands = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); Commandline cl = (Commandline) commands.get( 0 ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Checkout $D:/myProject/target/test-classes/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.class -Yusername,password -I-", ((File) fileSet.getFileList().get( 0 )).getParentFile(), cl ); } public void testCommandLineRelativePath() throws Exception { ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); File target = getTestFile( "target" ); ScmFileSet fileSet = new ScmFileSet( target, new File( target, "test-classes/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.class" ) ); VssEditCommand command = new VssEditCommand(); List commands = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); Commandline cl = (Commandline) commands.get( 0 ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Checkout $D:/myProject/test-classes/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.class -Yusername,password -I-", ((File) fileSet.getFileList().get( 0 )).getParentFile(), cl ); } public void testCommandLineMultipleFiles() throws Exception { ScmRepository repository = scmManager .makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); File target = getTestFile( "target" ); ScmFileSet fileSet = new ScmFileSet( target, Arrays .asList( new File[] { new File( target, "test-classes/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.class" ), new File( target, "test-classes/META-INF/LICENSE" ) } ) ); VssEditCommand command = new VssEditCommand(); List commands = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); assertEquals( 2, commands.size() ); Commandline cl; String ssPath; cl = (Commandline) commands.get( 0 ); ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); // vss is windauze so don't care about the case assertEquals( StringUtils.lowerCase( normSep( target.getPath() + "/test-classes/org/apache/maven/scm/provider/vss/commands/edit" ) ), StringUtils.lowerCase( cl .getWorkingDirectory().getPath() ) ); assertCommandLine( ssPath + "ss Checkout $D:/myProject/test-classes/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommandTest.class -Yusername,password -I-", ((File) fileSet.getFileList().get( 0 )).getParentFile(), cl ); cl = (Commandline) commands.get( 1 ); ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); // vss is windauze so don't care about the case assertEquals( StringUtils.lowerCase( normSep( target.getPath() + "/test-classes/META-INF" ) ), StringUtils .lowerCase( cl.getWorkingDirectory().getPath() ) ); assertCommandLine( ssPath + "ss Checkout $D:/myProject/test-classes/META-INF/LICENSE -Yusername,password -I-", ((File) fileSet.getFileList().get( 1 )).getParentFile() , cl ); } private String normSep( String str ) { return str.replace( '/', File.separatorChar ).replace( '\\', File.separatorChar ); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000535711015073323033602 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.changelog; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * @author Emmanuel Venisse * @version $Id: VssHistoryCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class VssHistoryCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testCommandLine() throws Exception { ScmRepository repository = scmManager.makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); ScmFileSet fileSet = new ScmFileSet( getTestFile( "target" ) ); VssHistoryCommand command = new VssHistoryCommand(); Date startDate = new Date(); Date endDate = new Date(); Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet, startDate, endDate ); SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy", Locale.ENGLISH ); String start = sdf.format( startDate ); String end = sdf.format( endDate ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss History $D:/myProject -Yusername,password -R -I- -Vd" + start + "~" + end, fileSet.getBasedir(), cl ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033610 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider/vss/commands/add/VssAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/test/java/org/apache/maven/scm/provider0000644000175000017500000000557511015073323033604 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.add; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * @author Emmanuel Venisse * @version $Id: VssAddCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $ */ public class VssAddCommandTest extends ScmTestCase { private ScmManager scmManager; public void setUp() throws Exception { super.setUp(); scmManager = getScmManager(); } public void testBuildCmdLine() throws Exception { ScmRepository repository = scmManager.makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); File dir = getTestFile( "target" ); ScmFileSet fileSet = new ScmFileSet( dir ); VssAddCommand command = new VssAddCommand(); Commandline cl = command.buildCmdLine( (VssScmProviderRepository) repository.getProviderRepository(), fileSet ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss Add -Yusername,password -I-", dir, cl ); } public void testBuildSetCurrentProjectCmdLine() throws Exception { ScmRepository repository = scmManager.makeScmRepository( "scm:vss|username|password@C:/Program File/Visual Source Safe|D:/myProject" ); VssAddCommand command = new VssAddCommand(); Commandline cl = command.buildSetCurrentProjectCmdLine( (VssScmProviderRepository) repository.getProviderRepository() ); String ssPath = VssCommandLineUtils.getSsDir().replace( '/', File.separatorChar ); assertCommandLine( ssPath + "ss CP $D:/myProject -Yusername,password -I-", null, cl ); } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/0000755000175000017500000000000011345536664025161 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/mdo/0000755000175000017500000000000011345536664025740 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/mdo/vss-settings.mdo0000644000175000017500000000347111315117331031076 0ustar twernertwerner vss Vss VSS Provider Model. package org.apache.maven.scm.providers.vss.settings Settings 1.0.0+ vssDirectory 1.0.0+ String Visual Source Safe path maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/0000755000175000017500000000000011345536664026102 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/0000755000175000017500000000000011345536664026671 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/0000755000175000017500000000000011345536664030112 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/0000755000175000017500000000000011345536664031220 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536664032002 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033555 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/VssScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002016511304273113033541 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss; /* * 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. */ import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.add.VssAddCommand; import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand; import org.apache.maven.scm.provider.vss.commands.checkin.VssCheckInCommand; import org.apache.maven.scm.provider.vss.commands.checkout.VssCheckOutCommand; import org.apache.maven.scm.provider.vss.commands.edit.VssEditCommand; import org.apache.maven.scm.provider.vss.commands.status.VssStatusCommand; import org.apache.maven.scm.provider.vss.commands.tag.VssTagCommand; import org.apache.maven.scm.provider.vss.commands.update.VssUpdateCommand; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.codehaus.plexus.util.StringUtils; /** * @author George Gastaldi * @version $Id: VssScmProvider.java 885129 2009-11-28 19:13:15Z olamy $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="vss" */ public class VssScmProvider extends AbstractScmProvider { public static final String VSS_URL_FORMAT = "[username[|password]@]vssdir|projectPath"; // ---------------------------------------------------------------------- // ScmProvider Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public String getScmSpecificFilename() { return "vssver.scc"; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { String user = null; String password = null; String vssDir; String project; int index = scmSpecificUrl.indexOf( '@' ); String rest = scmSpecificUrl; if ( index != -1 ) { String userAndPassword = scmSpecificUrl.substring( 0, index ); rest = scmSpecificUrl.substring( index + 1 ); index = userAndPassword.indexOf( delimiter ); if ( index != -1 ) { user = userAndPassword.substring( 0, index ); password = userAndPassword.substring( index + 1 ); } else { user = userAndPassword; } } String[] tokens = StringUtils.split( rest, String.valueOf( delimiter ) ); if ( tokens.length < 2 ) { throw new ScmRepositoryException( "Invalid SCM URL: The url has to be on the form: " + VSS_URL_FORMAT ); } else { vssDir = tokens[0]; project = tokens[1]; } return new VssScmProviderRepository( user, password, vssDir, project ); } /** {@inheritDoc} */ public String getScmType() { return "vss"; } /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { // TODO: Check whether the CREATE command must be called VssAddCommand command = new VssAddCommand(); command.setLogger( getLogger() ); return (AddScmResult) command.execute( repository, fileSet, parameters ); } public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssCheckInCommand command = new VssCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssCheckOutCommand command = new VssCheckOutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssHistoryCommand command = new VssHistoryCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssTagCommand command = new VssTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssUpdateCommand command = new VssUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssStatusCommand command = new VssStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { VssEditCommand command = new VssEditCommand(); command.setLogger( getLogger() ); return (EditScmResult) command.execute( repository, fileSet, parameters ); } /* * public UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet, * CommandParameters parameters ) throws ScmException { VssUnEditCommand command = new * VssUnEditCommand(); * * command.setLogger( getLogger() ); * * return (UnEditScmResult) command.execute( repository, fileSet, parameters ); } */ /* * protected RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, * CommandParameters parameters ) throws ScmException { VssRemoveCommand command = new * VssRemoveCommand(); * * command.setLogger( getLogger() ); * * return (RemoveScmResult) command.execute( repository .getProviderRepository(), fileSet, * parameters ); } */ } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033555 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/repository/VssScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000406410535556312033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * @author Thorsten Riek * @version $Id: VssScmProviderRepository.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class VssScmProviderRepository extends ScmProviderRepository { private String vssdir; private String project; public VssScmProviderRepository( String user, String password, String vssdir, String project ) { super(); setUser( user ); setPassword( password ); this.vssdir = StringUtils.replace( vssdir, "/", "\\" ); // this.project = StringUtils.replace( project, "/", "\\" ); this.project = project; } public String getProject() { return project; } public String getVssdir() { return vssdir; } public String getUserPassword() { String userPassword = null; if ( !StringUtils.isEmpty( getUser() ) ) { userPassword = getUser(); if ( !StringUtils.isEmpty( getPassword() ) ) { userPassword += "," + getPassword(); } } return userPassword; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssCommandLineUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001342411057621704033551 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.providers.vss.settings.Settings; import org.apache.maven.scm.providers.vss.settings.io.xpp3.VssXpp3Reader; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import org.codehaus.plexus.util.cli.StreamConsumer; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Iterator; /** * @author Thorsten Riek * @version $Id: VssCommandLineUtils.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class VssCommandLineUtils // FIXME extend CommandLineUtils { private static File scmConfDir = new File( System.getProperty( "user.home" ), ".scm" ); public static void addFiles( Commandline cl, ScmFileSet fileSet ) { Iterator it = fileSet.getFileList().iterator(); while ( it.hasNext() ) { File file = (File) it.next(); cl.createArg().setValue( file.getPath().replace( '\\', '/' ) ); } } public static Commandline getBaseVssCommandLine( File workingDirectory, String cmd, VssScmProviderRepository repository ) { Commandline cl = new Commandline(); cl.setExecutable( VssConstants.SS_EXE ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); if ( !StringUtils.isEmpty( repository.getUser() ) ) { cl.createArg().setValue( "-Y" ); StringBuffer sb = new StringBuffer( repository.getUser() ); if ( !StringUtils.isEmpty( repository.getPassword() ) ) { sb.append( "," ).append( repository.getPassword() ); } cl.createArg().setValue( sb.toString() ); } return cl; } public static int executeCommandline( Commandline cl, StreamConsumer consumer, CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger ) throws ScmException { try { if ( logger.isInfoEnabled() ) { logger.info( "Executing: " + cl ); logger.info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitcode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); if ( logger.isDebugEnabled() ) { logger.debug( "VSS Command Exit_Code: " + exitcode ); } return exitcode; } catch ( CommandLineException ex ) { throw new ScmException( "Error while executing command.", ex ); } } public static final Settings getSettings() { Settings settings = null; File settingsFile = new File( scmConfDir, "vss-settings.xml" ); if ( settingsFile.exists() ) { VssXpp3Reader reader = new VssXpp3Reader(); try { settings = reader.read( ReaderFactory.newXmlReader( settingsFile ) ); } catch ( FileNotFoundException e ) { // nop } catch ( IOException e ) { // nop } catch ( XmlPullParserException e ) { String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage(); System.err.println( message ); } } // override settings with command line options String vssDirectory = System.getProperty( "vssDirectory" ); if ( StringUtils.isNotEmpty( vssDirectory ) ) { if ( settings == null ) { settings = new Settings(); } settings.setVssDirectory( vssDirectory ); } return settings; } protected static final File getScmConfDir() { return scmConfDir; } protected static final void setScmConfDir( File directory ) { scmConfDir = directory; } public static final String getSsDir() { String ssDir = ""; if ( VssCommandLineUtils.getSettings() != null ) { String ssDir2 = VssCommandLineUtils.getSettings().getVssDirectory(); if ( ssDir2 != null ) { ssDir = StringUtils.replace( ssDir2, "\\", "/" ); if ( !ssDir.endsWith( "/" ) ) { ssDir += "/"; } } } return ssDir; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssParameterContext.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000003376611053120274033554 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import java.io.File; import java.text.DateFormat; import java.text.ParseException; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; /** * @author Thorsten Riek * @version $Id: VssParameterContext.java 687495 2008-08-20 22:54:52Z olamy $ */ public class VssParameterContext { private String vssPath = null; private String autoResponse; private String ssDir; private String vssLogin; private String comment; private String user; private String fromLabel; private String toLabel; private boolean quiet; private boolean recursive; private boolean writable; private String label; private String style; private String version; private String date; private String localPath; private String timestamp; /** * Behaviour for writable files */ private String writableFiles = null; /** * From date */ private String fromDate = null; /** * To date */ private String toDate = null; /** * Number of days offset for History */ private int numDays = Integer.MIN_VALUE; /** * Get local copy for checkout defaults to true */ private boolean getLocalCopy = true; /** * Date format for History */ private DateFormat dateFormat = DateFormat .getDateInstance( DateFormat.SHORT ); private String outputFileName; public static VssParameterContext getInstance( Object obj ) { return new VssParameterContext( (VssScmProviderRepository) obj ); } public VssParameterContext( VssScmProviderRepository repo ) { autoResponse = System.getProperty( "maven.scm.autoResponse" ); this.ssDir = repo.getVssdir(); this.user = repo.getUser(); // this.vssLogin = this.user + (repos.getPassword() == null ? "" : ","+repos.getPassword()); } /** * Builds and returns the -G- flag if required. * * @return An empty string if get local copy is true. */ public String getGetLocalCopy() { return ( !getLocalCopy ) ? VssConstants.FLAG_NO_GET : ""; } /** * Calculate the start date for version comparison. *

* Calculate the date numDay days earlier than startdate. * * @param startDate The start date. * @param daysToAdd The number of days to add. * @return The calculated date. * @throws ParseException */ private String calcDate( String startDate, int daysToAdd ) throws ParseException { Date currentDate = new Date(); Calendar calendar = new GregorianCalendar(); currentDate = dateFormat.parse( startDate ); calendar.setTime( currentDate ); calendar.add( Calendar.DATE, daysToAdd ); return dateFormat.format( calendar.getTime() ); } /** * Gets the value set for the FileTimeStamp. if it equals "current" then we * return -GTC if it equals "modified" then we return -GTM if it equals * "updated" then we return -GTU otherwise we return -GTC * * @return The default file time flag, if not set. */ public String getFileTimeStamp() { if ( timestamp == null ) { return ""; } return timestamp; } /** * Gets the localpath string. "-GLc:\source" *

* The localpath is created if it didn't exist. * * @return An empty string if localpath is not set. */ public String getLocalpath() throws ScmException { String lclPath = ""; // set to empty str if no local path return if ( localPath != null ) { // make sure m_LocalDir exists, create it if it doesn't File dir = new File( localPath ); if ( !dir.exists() ) { boolean done = dir.mkdirs(); if ( !done ) { String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason"; throw new ScmException( msg ); } // getLogger().info("Created dir: " + dir.getAbsolutePath()); } lclPath = VssConstants.FLAG_OVERRIDE_WORKING_DIR + localPath; } return lclPath; } /** * Gets the label string. "-Lbuild1" Max label length is 32 chars * * @return An empty string if label is not set. */ public String getLabel() { String shortLabel = ""; if ( label != null && label.length() > 0 ) { shortLabel = VssConstants.FLAG_LABEL + getShortLabel(); } return shortLabel; } /** * Gets the version string. Returns the first specified of version "-V1.0", * date "-Vd01.01.01", label "-Vlbuild1". * * @return An empty string if a version, date and label are not set. */ public String getVersionDateLabel() { String versionDateLabel = ""; if ( version != null ) { versionDateLabel = VssConstants.FLAG_VERSION + version; } else if ( date != null ) { versionDateLabel = VssConstants.FLAG_VERSION_DATE + date; } else { // Use getShortLabel() so labels longer then 30 char are truncated // and the user is warned String shortLabel = getShortLabel(); if ( shortLabel != null && !shortLabel.equals( "" ) ) { versionDateLabel = VssConstants.FLAG_VERSION_LABEL + shortLabel; } } return versionDateLabel; } /** * Gets the version string. * * @return An empty string if a version is not set. */ public String getVersion() { return version != null ? VssConstants.FLAG_VERSION + version : ""; } /** * Return at most the 30 first chars of the label, logging a warning message * about the truncation * * @return at most the 30 first chars of the label */ private String getShortLabel() { String shortLabel; if ( label != null && label.length() > 31 ) { shortLabel = this.label.substring( 0, 30 ); // getLogger().warn( // "Label is longer than 31 characters, truncated to: " // + shortLabel); } else { shortLabel = label; } return shortLabel; } /** * Gets the style string. "-Lbuild1" * * @return An empty string if label is not set. */ public String getStyle() { return style != null ? style : ""; } /** * Gets the recursive string. "-R" * * @return An empty string if recursive is not set or is false. */ public String getRecursive() { return recursive ? VssConstants.FLAG_RECURSION : ""; } /** * Gets the writable string. "-W" * * @return An empty string if writable is not set or is false. */ public String getWritable() { return writable ? VssConstants.FLAG_WRITABLE : ""; } /** * Gets the quiet string. -O- * * @return An empty string if quiet is not set or is false. */ public String getQuiet() { return quiet ? VssConstants.FLAG_QUIET : ""; } public String getVersionLabel() { if ( fromLabel == null && toLabel == null ) { return ""; } if ( fromLabel != null && toLabel != null ) { if ( fromLabel.length() > 31 ) { fromLabel = fromLabel.substring( 0, 30 ); // getLogger().warn( // "FromLabel is longer than 31 characters, truncated to: " // + fromLabel); } if ( toLabel.length() > 31 ) { toLabel = toLabel.substring( 0, 30 ); // getLogger().warn( // "ToLabel is longer than 31 characters, truncated to: " // + toLabel); } return VssConstants.FLAG_VERSION_LABEL + toLabel + VssConstants.VALUE_FROMLABEL + fromLabel; } else if ( fromLabel != null ) { if ( fromLabel.length() > 31 ) { fromLabel = fromLabel.substring( 0, 30 ); // getLogger().warn( // "FromLabel is longer than 31 characters, truncated to: " // + fromLabel); } return VssConstants.FLAG_VERSION + VssConstants.VALUE_FROMLABEL + fromLabel; } else { if ( toLabel.length() > 31 ) { toLabel = toLabel.substring( 0, 30 ); // getLogger().warn( // "ToLabel is longer than 31 characters, truncated to: " // + toLabel); } return VssConstants.FLAG_VERSION_LABEL + toLabel; } } /** * Gets the user string. "-Uusername" * * @return An empty string if user is not set. */ public String getUser() { return user != null ? VssConstants.FLAG_USER + user : ""; } /** * Gets the comment string. "-Ccomment text" * * @return A comment of "-" if comment is not set. */ public String getComment() { return comment != null ? VssConstants.FLAG_COMMENT + comment : VssConstants.FLAG_COMMENT + "-"; } /** * Gets the login string. This can be user and password, "-Yuser,password" * or just user "-Yuser". * * @return An empty string if login is not set. */ public String getLogin() { return vssLogin != null ? ( VssConstants.FLAG_LOGIN + vssLogin ) : ""; } /** * Gets the auto response string. This can be Y "-I-Y" or N "-I-N". * * @return The default value "-I-" if autoresponse is not set. */ public String getAutoresponse() { if ( autoResponse == null ) { return VssConstants.FLAG_AUTORESPONSE_DEF; } else if ( autoResponse.equalsIgnoreCase( "Y" ) ) { return VssConstants.FLAG_AUTORESPONSE_YES; } else if ( autoResponse.equalsIgnoreCase( "N" ) ) { return VssConstants.FLAG_AUTORESPONSE_NO; } else { return VssConstants.FLAG_AUTORESPONSE_DEF; } } /** * Gets the sscommand string. "ss" or "c:\path\to\ss" * * @return The path to ss.exe or just ss if sscommand is not set. */ public String getSSCommand() { if ( ssDir == null ) { return VssConstants.SS_EXE; } return ssDir.endsWith( File.separator ) ? ssDir + VssConstants.SS_EXE : ssDir + File.separator + VssConstants.SS_EXE; } public String getVssPath() { return vssPath; } /** * Gets the Version date string. * * @return An empty string if neither Todate or from date are set. * @throws ScmException */ public String getVersionDate() throws ScmException { if ( fromDate == null && toDate == null && numDays == Integer.MIN_VALUE ) { return ""; } if ( fromDate != null && toDate != null ) { return VssConstants.FLAG_VERSION_DATE + toDate + VssConstants.VALUE_FROMDATE + fromDate; } else if ( toDate != null && numDays != Integer.MIN_VALUE ) { try { return VssConstants.FLAG_VERSION_DATE + toDate + VssConstants.VALUE_FROMDATE + calcDate( toDate, numDays ); } catch ( ParseException ex ) { String msg = "Error parsing date: " + toDate; throw new ScmException( msg ); } } else if ( fromDate != null && numDays != Integer.MIN_VALUE ) { try { return VssConstants.FLAG_VERSION_DATE + calcDate( fromDate, numDays ) + VssConstants.VALUE_FROMDATE + fromDate; } catch ( ParseException ex ) { String msg = "Error parsing date: " + fromDate; throw new ScmException( msg ); } } else { return fromDate != null ? VssConstants.FLAG_VERSION + VssConstants.VALUE_FROMDATE + fromDate : VssConstants.FLAG_VERSION_DATE + toDate; } } /** * Gets the output file string. "-Ooutput.file" * * @return An empty string if user is not set. */ public String getOutput() { return outputFileName != null ? VssConstants.FLAG_OUTPUT + outputFileName : ""; } /** * Gets the value to determine the behaviour when encountering writable * files. * * @return An empty String, if not set. */ public String getWritableFiles() { // FIXME: Fix this if ( writableFiles == null ) { return ""; } return writableFiles; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/VssConstants.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001152311053120274033537 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands; /* * 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. */ /** * Holds all the constants for the VSS tasks. * * @version $Id: VssConstants.java 687495 2008-08-20 22:54:52Z olamy $ */ public class VssConstants { /** * Constant for the thing to execute */ public static final String SS_EXE = "ss"; /** * Dollar Sigh to prefix the project path */ public static final String PROJECT_PREFIX = "$"; /** * The 'CP' command */ public static final String COMMAND_CP = "CP"; /** * The 'Add' command */ public static final String COMMAND_ADD = "Add"; /** * The 'Get' command */ public static final String COMMAND_GET = "Get"; /** * The 'Checkout' command */ public static final String COMMAND_CHECKOUT = "Checkout"; /** * The 'Checkin' command */ public static final String COMMAND_CHECKIN = "Checkin"; /** * The 'Label' command */ public static final String COMMAND_LABEL = "Label"; /** * The 'History' command */ public static final String COMMAND_HISTORY = "History"; /** * The 'Create' command */ public static final String COMMAND_CREATE = "Create"; /** * The 'Status' command */ public static final String COMMAND_DIFF = "Diff"; /** * The 'Status' command */ public static final String COMMAND_STATUS = "Status"; /** * The brief style flag */ public static final String STYLE_BRIEF = "brief"; /** * The codediff style flag */ public static final String STYLE_CODEDIFF = "codediff"; /** * The nofile style flag */ public static final String STYLE_NOFILE = "nofile"; /** * The default style flag */ public static final String STYLE_DEFAULT = "default"; /** * The text for current (default) timestamp */ public static final String TIME_CURRENT = "current"; /** * The text for modified timestamp */ public static final String TIME_MODIFIED = "modified"; /** * The text for updated timestamp */ public static final String TIME_UPDATED = "updated"; /** * The text for replacing writable files */ public static final String WRITABLE_REPLACE = "replace"; /** * The text for skiping writable files */ public static final String WRITABLE_SKIP = "skip"; /** * The text for failing on writable files */ public static final String WRITABLE_FAIL = "fail"; public static final String FLAG_LOGIN = "-Y"; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL"; public static final String FLAG_AUTORESPONSE_DEF = "-I-"; public static final String FLAG_AUTORESPONSE_YES = "-I-Y"; public static final String FLAG_AUTORESPONSE_NO = "-I-N"; public static final String FLAG_RECURSION = "-R"; public static final String FLAG_VERSION = "-V"; public static final String FLAG_VERSION_DATE = "-Vd"; public static final String FLAG_VERSION_LABEL = "-VL"; public static final String FLAG_WRITABLE = "-W"; public static final String VALUE_NO = "-N"; public static final String VALUE_YES = "-Y"; public static final String FLAG_QUIET = "-O-"; public static final String FLAG_COMMENT = "-C"; public static final String FLAG_LABEL = "-L"; public static final String VALUE_FROMDATE = "~d"; public static final String VALUE_FROMLABEL = "~L"; public static final String FLAG_OUTPUT = "-O"; public static final String FLAG_USER = "-U"; public static final String FLAG_NO_FILE = "-F-"; public static final String FLAG_BRIEF = "-B"; public static final String FLAG_CODEDIFF = "-D"; public static final String FLAG_FILETIME_DEF = "-GTC"; public static final String FLAG_FILETIME_MODIFIED = "-GTM"; public static final String FLAG_FILETIME_UPDATED = "-GTU"; public static final String FLAG_REPLACE_WRITABLE = "-GWR"; public static final String FLAG_SKIP_WRITABLE = "-GWS"; public static final String FLAG_NO_GET = "-G-"; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033555 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001310711304273113033537 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Thorsten Riek * @version $Id: VssUpdateCommand.java 885129 2009-11-28 19:13:15Z olamy $ */ public class VssUpdateCommand extends AbstractUpdateCommand { // TODO handle deleted files from VSS /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing update command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; Commandline cl = buildCmdLine( repo, fileSet, version ); VssUpdateConsumer consumer = new VssUpdateConsumer( repo, getLogger() ); // TODO handle deleted files from VSS // TODO identify local files CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( error.indexOf( "A writable copy of" ) < 0 ) { return new UpdateScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling if ( getLogger().isWarnEnabled() ) { getLogger().warn( error ); } } return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_GET ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); // FIXME Update command only works if there is no file checked out // or no file is dirty locally. It's better than overwriting // checked out files //Ignore: Do not touch local writable files. command.createArg().setValue( VssConstants.FLAG_SKIP_WRITABLE ); if ( version != null ) { command.createArg().setValue( VssConstants.FLAG_VERSION_LABEL + version ); } return command; } /** {@inheritDoc} */ protected ChangeLogCommand getChangeLogCommand() { VssHistoryCommand command = new VssHistoryCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/update/VssUpdateConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001505411057610744033554 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.update; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Thorsten Riek * @version $Id: VssUpdateConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class VssUpdateConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int GET_UNKNOWN = 0; /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file information */ private static final int REPLACE_FILE = 2; /** * expecting file path information */ private static final int GET_FILE_PATH = 3; /** * expecting writable copy */ private static final int IS_WRITABLE_COPY = 4; /** * expecting working folder */ private static final int SET_WORKING_FOLDER = 5; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks getting a new File */ private static final String START_GETTING = "Getting"; /** * Marks replacing a old File */ private static final String START_REPLACING = "Replacing local copy of "; /** * Marks a writable copy of a File / maybe a conflict */ private static final String START_WRITABLE_COPY = "A writable "; /** * Marks "Set the default folder for project" question */ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project"; private String currentPath = ""; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; public VssUpdateConsumer( VssScmProviderRepository repo, ScmLogger logger ) { super( logger ); this.repo = repo; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case GET_FILE_PATH: processGetFilePath( line ); break; case GET_FILE: processGetFile( line ); break; case REPLACE_FILE: processReplaceFile( line ); break; case IS_WRITABLE_COPY: // FIXME is actually in error stream if command is build without -G- processWritableFile( line ); break; case SET_WORKING_FOLDER: // to trash break; default: break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { String[] fileLine = line.split( " " ); updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } } /** * Process the current input line in the Replace File state. * * @param line a line of text from the VSS log output */ private void processReplaceFile( String line ) { updatedFiles.add( new ScmFile( currentPath + "/" + line.substring( START_REPLACING.length() ), ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( START_REPLACING + currentPath + "/" + line.substring( START_REPLACING.length() ) ); } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { currentPath = line.substring( ( VssConstants.PROJECT_PREFIX + repo.getProject() ).length(), line.length() - 1 ); } /** * Process the current input line in the writable File state. * * @param line a line of text from the VSS log output */ private void processWritableFile( String line ) { // FIXME extract file name // String[] fileLine = line.split( " " ); // updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.MODIFIED ) ); // getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE_PATH ) ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_GETTING ) ) { argument = GET_FILE; } else if ( line.startsWith( START_REPLACING ) ) { argument = REPLACE_FILE; } else if ( line.startsWith( START_WRITABLE_COPY ) ) { argument = IS_WRITABLE_COPY; } else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 ) { argument = SET_WORKING_FOLDER; } return argument; } public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001376311057610744033561 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Thorsten Riek * @version $Id: VssCheckOutConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class VssCheckOutConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int GET_UNKNOWN = 0; /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file information */ private static final int REPLACE_FILE = 2; /** * expecting file path information */ private static final int GET_FILE_PATH = 3; /** * expecting writable copy */ private static final int IS_WRITABLE_COPY = 4; /** * expecting working folder */ private static final int SET_WORKING_FOLDER = 5; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks getting a new File */ private static final String START_GETTING = "Getting"; /** * Marks replacing a old File */ private static final String START_REPLACING = "Replacing local copy of "; /** * Marks a writable copy of a File / maybe a conflict */ private static final String START_WRITABLE_COPY = "A writable "; /** * Marks "Set the default folder for project" question */ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project"; private String currentPath = ""; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; public VssCheckOutConsumer( VssScmProviderRepository repo, ScmLogger logger ) { super( logger ); this.repo = repo; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case GET_FILE_PATH: processGetFilePath( line ); break; case GET_FILE: processGetFile( line ); break; case REPLACE_FILE: processReplaceFile( line ); break; case IS_WRITABLE_COPY: // will be overwritten and uses REPLACE_FILE break; case SET_WORKING_FOLDER: // to trash break; default: break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { String[] fileLine = line.split( " " ); updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } } /** * Process the current input line in the Replace File state. * * @param line a line of text from the VSS log output */ private void processReplaceFile( String line ) { updatedFiles.add( new ScmFile( currentPath + "/" + line.substring( START_REPLACING.length() ), ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( START_REPLACING + currentPath + "/" + line.substring( START_REPLACING.length() ) ); } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { currentPath = line.substring( ( VssConstants.PROJECT_PREFIX + repo.getProject() ).length(), line.length() - 1 ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE_PATH ) ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_GETTING ) ) { argument = GET_FILE; } else if ( line.startsWith( START_REPLACING ) ) { argument = REPLACE_FILE; } else if ( line.startsWith( START_WRITABLE_COPY ) ) { argument = IS_WRITABLE_COPY; } else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 ) { argument = SET_WORKING_FOLDER; } return argument; } public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkout/VssCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001203011304273113033531 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Thorsten Riek * @version $Id: VssCheckOutCommand.java 02.06.2006 00:05:51 */ public class VssCheckOutCommand extends AbstractCheckOutCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkout command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; Commandline cl = buildCmdLine( repo, fileSet, version ); VssCheckOutConsumer consumer = new VssCheckOutConsumer( repo, getLogger() ); // TODO handle deleted files from VSS CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( error.indexOf( "A writable copy of" ) < 0 ) { return new CheckOutScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling if ( getLogger().isWarnEnabled() ) { getLogger().warn( error ); } } return new CheckOutScmResult( cl.toString(), consumer.getUpdatedFiles() ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_GET ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); //Ignore: Do not touch local writable files. command.createArg().setValue( VssConstants.FLAG_REPLACE_WRITABLE ); if ( version != null ) { command.createArg().setValue( VssConstants.FLAG_VERSION_LABEL + '"' + version + '"' ); } return command; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536664033555 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002144111322401210033526 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.status; /* * 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. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; /** * @author Thorsten Riek * @version $Id: VssStatusConsumer.java 897657 2010-01-10 16:38:32Z olamy $ */ public class VssStatusConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int DIFF_UNKNOWN = 0; /** * expecting files to checkin */ private static final int DIFF_LOCAL_FILES_NOT_IN_PROJECT = 1; /** * expecting commit */ private static final int DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES = 2; /** * expecting update / checkout */ private static final int DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER = 3; /** * expecting setting akt remote folder */ private static final int DIFF_START_DIFFING_REMOTE = 4; /** * expecting setting akt local folder */ private static final int DIFF_START_DIFFING_LOCAL = 5; /** * Marks Diffing remote project folder */ private static final String START_DIFFING_REMOTE = "Diffing:"; /** * Marks Diffing local project folder */ private static final String START_DIFFING_LOCAL = "Against:"; /** * Marks Local files not in the current project */ private static final String LOCAL_FILES_NOT_IN_PROJECT = "Local files not in the current project:"; /** * Marks SourceSafe files different from local files */ private static final String VSS_FILES_DIFFERENT_FROM_LOCAL_FILES = "SourceSafe files different from local files:"; /** * Marks SourceSafe files not in the current folder */ private static final String VSS_FILES_NOT_IN_CURRENT_FOLDER = "SourceSafe files not in the current folder:"; private String remoteProjectFolder = ""; private String localFolder = ""; private int lastState = 0; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; private ScmFileSet fileSet; public VssStatusConsumer( VssScmProviderRepository repo, ScmLogger logger, ScmFileSet fileSet ) { super( logger ); this.repo = repo; this.fileSet = fileSet; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case DIFF_LOCAL_FILES_NOT_IN_PROJECT: lastState = DIFF_LOCAL_FILES_NOT_IN_PROJECT; break; case DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES: lastState = DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES; break; case DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER: lastState = DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER; break; case DIFF_START_DIFFING_LOCAL: lastState = DIFF_START_DIFFING_LOCAL; processLocalFolder( line ); break; case DIFF_START_DIFFING_REMOTE: lastState = DIFF_START_DIFFING_REMOTE; processRemoteProjectFolder( line ); break; default: processLastStateFiles( line ); break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processLastStateFiles( String line ) { if ( line != null && line.trim().length() > 0 ) { if ( lastState == DIFF_START_DIFFING_LOCAL ) { setLocalFolder( localFolder + line ); getLogger().debug( "Local folder: " + localFolder ); } else if ( lastState == DIFF_START_DIFFING_REMOTE ) { setRemoteProjectFolder( remoteProjectFolder + line ); getLogger().debug( "Remote folder: " + localFolder ); } String[] fileLine = line.split( " " ); for ( int i = 0; i < fileLine.length; i++ ) { if ( fileLine[i].trim().length() > 0 ) { if ( lastState == DIFF_LOCAL_FILES_NOT_IN_PROJECT ) { updatedFiles.add( new ScmFile( localFolder + fileLine[i], ScmFileStatus.ADDED ) ); } else if ( lastState == DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER ) { updatedFiles.add( new ScmFile( localFolder + fileLine[i], ScmFileStatus.UPDATED ) ); } else if ( lastState == DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES ) { updatedFiles.add( new ScmFile( localFolder + fileLine[i], ScmFileStatus.MODIFIED ) ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( localFolder + fileLine[i] ); } } } } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "processLastStateFiles: empty line" ); } } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processLocalFolder( String line ) { setLocalFolder( line.substring( START_DIFFING_LOCAL.length() ).trim() ); } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processRemoteProjectFolder( String line ) { setRemoteProjectFolder( line.substring( START_DIFFING_REMOTE.length() ).trim() ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = DIFF_UNKNOWN; if ( line.startsWith( LOCAL_FILES_NOT_IN_PROJECT ) ) { argument = DIFF_LOCAL_FILES_NOT_IN_PROJECT; } else if ( line.startsWith( VSS_FILES_DIFFERENT_FROM_LOCAL_FILES ) ) { argument = DIFF_VSS_FILES_DIFFERENT_FROM_LOCAL_FILES; } else if ( line.startsWith( VSS_FILES_NOT_IN_CURRENT_FOLDER ) ) { argument = DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER; } // else if ( line.startsWith( VSS_FILES_NOT_IN_CURRENT_FOLDER ) ) // { // Project $/com.fum/fum-utilities/src/main/java/com/fum/utilities/protocol has no // corresponding folder // argument = DIFF_VSS_FILES_NOT_IN_CURRENT_FOLDER; // } else if ( line.startsWith( START_DIFFING_LOCAL ) ) { argument = DIFF_START_DIFFING_LOCAL; } else if ( line.startsWith( START_DIFFING_REMOTE ) ) { argument = DIFF_START_DIFFING_REMOTE; } return argument; } public List getUpdatedFiles() { return updatedFiles; } private void setLocalFolder( String localFolder ) { if ( localFolder != null && localFolder.trim().length() > 0 ) { this.localFolder = localFolder.replace( java.io.File.separatorChar, '/' ) + "/"; } else { this.localFolder = ""; } } private void setRemoteProjectFolder( String remoteProjectFolder ) { this.remoteProjectFolder = remoteProjectFolder; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/status/VssStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001164211057610744033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Thorsten Riek * @version $Id: VssStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class VssStatusCommand extends AbstractStatusCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing status command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; Commandline cl = buildCmdLine( repo, fileSet ); VssStatusConsumer consumer = new VssStatusConsumer( repo, getLogger(), fileSet ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( false ) { return new StatusScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling // getLogger().warn(error); } return new StatusScmResult( cl.toString(), consumer.getUpdatedFiles() ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_DIFF ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); // TODO: Get Labled Version // command.createArg().setValue( VssConstants.FLAG_VERSION_LABEL ); return command; } /** * @return */ protected ChangeLogCommand getChangeLogCommand() { VssHistoryCommand command = new VssHistoryCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/tag/VssTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001367211304273113033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.tag; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Mateus Pimenta */ public class VssTagConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int GET_UNKNOWN = 0; /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file information */ private static final int REPLACE_FILE = 2; /** * expecting file path information */ private static final int GET_FILE_PATH = 3; /** * expecting writable copy */ private static final int IS_WRITABLE_COPY = 4; /** * expecting working folder */ private static final int SET_WORKING_FOLDER = 5; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks getting a new File */ private static final String START_GETTING = "Getting"; /** * Marks replacing a old File */ private static final String START_REPLACING = "Replacing local copy of "; /** * Marks a writable copy of a File / maybe a conflict */ private static final String START_WRITABLE_COPY = "A writable "; /** * Marks "Set the default folder for project" question */ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project"; private String currentPath = ""; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; public VssTagConsumer( VssScmProviderRepository repo, ScmLogger logger ) { super( logger ); this.repo = repo; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case GET_FILE_PATH: processGetFilePath( line ); break; case GET_FILE: processGetFile( line ); break; case REPLACE_FILE: processReplaceFile( line ); break; case IS_WRITABLE_COPY: // will be overwritten and uses REPLACE_FILE break; case SET_WORKING_FOLDER: // to trash break; default: break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { String[] fileLine = line.split( " " ); updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } } /** * Process the current input line in the Replace File state. * * @param line a line of text from the VSS log output */ private void processReplaceFile( String line ) { updatedFiles.add( new ScmFile( currentPath + "/" + line.substring( START_REPLACING.length() ), ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( START_REPLACING + currentPath + "/" + line.substring( START_REPLACING.length() ) ); } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { currentPath = line.substring( ( VssConstants.PROJECT_PREFIX + repo.getProject() ).length(), line.length() - 1 ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE_PATH ) ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_GETTING ) ) { argument = GET_FILE; } else if ( line.startsWith( START_REPLACING ) ) { argument = REPLACE_FILE; } else if ( line.startsWith( START_WRITABLE_COPY ) ) { argument = IS_WRITABLE_COPY; } else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 ) { argument = SET_WORKING_FOLDER; } return argument; } public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/tag/VssTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001237411304273113033544 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Mateus Pimenta * @since 1.3 */ public class VssTagCommand extends AbstractTagCommand { protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException { return executeTagCommand( repository, fileSet, tagName, scmTagParameters == null ? "" : scmTagParameters .getMessage() ); } /* * (non-Javadoc) * * @see * org.apache.maven.scm.command.tag.AbstractTagCommand#executeTagCommand(org.apache.maven.scm * .provider.ScmProviderRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, * java.lang.String) */ protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing tag command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; Commandline cl = buildCmdLine( repo, fileSet, tagName, message ); VssTagConsumer consumer = new VssTagConsumer( repo, getLogger() ); // TODO handle deleted files from VSS CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( error.indexOf( "A writable copy of" ) < 0 ) { return new TagScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling if ( getLogger().isWarnEnabled() ) { getLogger().warn( error ); } } return new TagScmResult( cl.toString(), consumer.getUpdatedFiles() ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, String tagName, String message ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_LABEL ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); // User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } // Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); command.createArg().setValue( VssConstants.FLAG_LABEL + tagName ); return command; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkin/VssCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001403111304273113033534 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Thorsten Riek * @version $Id: VssCheckInConsumer.java 885129 2009-11-28 19:13:15Z olamy $ * @since 1.3 */ public class VssCheckInConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int GET_UNKNOWN = 0; /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file information */ private static final int REPLACE_FILE = 2; /** * expecting file path information */ private static final int GET_FILE_PATH = 3; /** * expecting writable copy */ private static final int IS_WRITABLE_COPY = 4; /** * expecting working folder */ private static final int SET_WORKING_FOLDER = 5; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks getting a new File */ private static final String START_GETTING = "Getting"; /** * Marks replacing a old File */ private static final String START_REPLACING = "Replacing local copy of "; /** * Marks a writable copy of a File / maybe a conflict */ private static final String START_WRITABLE_COPY = "A writable "; /** * Marks "Set the default folder for project" question */ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project"; private String currentPath = ""; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; public VssCheckInConsumer( VssScmProviderRepository repo, ScmLogger logger ) { super( logger ); this.repo = repo; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case GET_FILE_PATH: processGetFilePath( line ); break; case GET_FILE: processGetFile( line ); break; case REPLACE_FILE: processReplaceFile( line ); break; case IS_WRITABLE_COPY: // will be overwritten and uses REPLACE_FILE break; case SET_WORKING_FOLDER: // to trash break; default: break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { String[] fileLine = line.split( " " ); updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } } /** * Process the current input line in the Replace File state. * * @param line a line of text from the VSS log output */ private void processReplaceFile( String line ) { updatedFiles.add( new ScmFile( currentPath + "/" + line.substring( START_REPLACING.length() ), ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( START_REPLACING + currentPath + "/" + line.substring( START_REPLACING.length() ) ); } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { currentPath = line.substring( ( VssConstants.PROJECT_PREFIX + repo.getProject() ).length(), line.length() - 1 ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE_PATH ) ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_GETTING ) ) { argument = GET_FILE; } else if ( line.startsWith( START_REPLACING ) ) { argument = REPLACE_FILE; } else if ( line.startsWith( START_WRITABLE_COPY ) ) { argument = IS_WRITABLE_COPY; } else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 ) { argument = SET_WORKING_FOLDER; } return argument; } public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/checkin/VssCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002125211322401210033526 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.checkin; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Mateus Pimenta * @since 1.3 * */ public class VssCheckInCommand extends AbstractCheckInCommand { /* * (non-Javadoc) * * @seeorg.apache.maven.scm.command.checkin.AbstractCheckInCommand# executeCheckInCommand * (org.apache.maven.scm.provider.ScmProviderRepository, org.apache.maven.scm.ScmFileSet, * java.lang.String, org.apache.maven.scm.ScmVersion) */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, ScmVersion scmVersion ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkin command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; List commandLines = buildCmdLine( repo, fileSet, scmVersion ); VssCheckInConsumer consumer = new VssCheckInConsumer( repo, getLogger() ); // TODO handle deleted files from VSS CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; StringBuffer sb = new StringBuffer(); List updatedFiles = new ArrayList(); for ( Iterator i = commandLines.iterator(); i.hasNext(); ) { Commandline cl = (Commandline) i.next(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( error.indexOf( "A writable copy of" ) < 0 ) { return new CheckInScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling if ( getLogger().isWarnEnabled() ) { getLogger().warn( error ); } } } return new CheckInScmResult( sb.toString(), updatedFiles ); } public List buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version ) throws ScmException { List files = fileSet.getFileList(); List commands = new ArrayList(); if ( files.size() > 0 ) { String base; try { base = fileSet.getBasedir().getCanonicalPath(); } catch ( IOException e ) { throw new ScmException( "Invalid canonical path", e ); } for ( Iterator i = files.iterator(); i.hasNext(); ) { Commandline command = new Commandline(); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_CHECKIN ); File file = (File) i.next(); String absolute; try { absolute = file.getCanonicalPath(); String relative; int index = absolute.indexOf( base ); if ( index >= 0 ) { relative = absolute.substring( index + base.length() ); } else { relative = file.getPath(); } relative = relative.replace( '\\', '/' ); if ( !relative.startsWith( "/" ) ) { relative = '/' + relative; } String relativeFolder = relative.substring( 0, relative.lastIndexOf( '/' ) ); command.setWorkingDirectory( new File( fileSet.getBasedir().getAbsolutePath() + File.separatorChar + relativeFolder ).getCanonicalPath() ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() + relative ); } catch ( IOException e ) { throw new ScmException( "Invalid canonical path", e ); } //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } // Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); // Ignore: Do not touch local writable files. command.createArg().setValue( VssConstants.FLAG_REPLACE_WRITABLE ); commands.add( command ); } } else { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_CHECKIN ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } // Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); // Ignore: Do not touch local writable files. command.createArg().setValue( VssConstants.FLAG_REPLACE_WRITABLE ); commands.add( command ); } return commands; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/edit/VssEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001405611057610744033555 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.edit; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Thorsten Riek * @version $Id: VssEditConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class VssEditConsumer extends AbstractConsumer implements StreamConsumer { /** * expecting file information */ private static final int GET_UNKNOWN = 0; /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file information */ private static final int CURRENTLY_CHECKED_OUT_FILE = 2; /** * expecting file path information */ private static final int GET_FILE_PATH = 3; /** * expecting writable copy */ private static final int IS_WRITABLE_COPY = 4; /** * expecting working folder */ private static final int SET_WORKING_FOLDER = 5; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks getting a new File */ private static final String START_GETTING = "Getting"; /** * Marks replacing a old File */ private static final String START_CURRENTLY_CHECKED_OUT = "You currently have file"; /** * Marks a writable copy of a File / maybe a conflict */ private static final String START_WRITABLE_COPY = "A writable "; /** * Marks "Set the default folder for project" question */ private static final String CONTAINS_SET_DEFAULT_WORKING_FOLDER = "as the default folder for project"; private String currentPath = ""; private List updatedFiles = new ArrayList(); private VssScmProviderRepository repo; public VssEditConsumer( VssScmProviderRepository repo, ScmLogger logger ) { super( logger ); this.repo = repo; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } switch ( getLineStatus( line ) ) { case GET_FILE_PATH: processGetFilePath( line ); break; case GET_FILE: processGetFile( line ); break; case CURRENTLY_CHECKED_OUT_FILE: processReplaceFile( line ); break; case IS_WRITABLE_COPY: // will be overwritten and uses REPLACE_FILE break; case SET_WORKING_FOLDER: // to trash break; default: break; } } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { String[] fileLine = line.split( " " ); updatedFiles.add( new ScmFile( currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( fileLine[0] + ": " + currentPath + "/" + fileLine[1] ); } } /** * Process the current input line in the Replace File state. * * @param line a line of text from the VSS log output */ private void processReplaceFile( String line ) { // updatedFiles.add( new ScmFile( currentPath + "/" + line.substring(START_CURRENTLY_CHECKED_OUT.length()), // ScmFileStatus.UPDATED ) ); if ( getLogger().isInfoEnabled() ) { getLogger().info( START_CURRENTLY_CHECKED_OUT + currentPath + "/" + line.substring( START_CURRENTLY_CHECKED_OUT.length() ) ); } } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { currentPath = line.substring( ( VssConstants.PROJECT_PREFIX + repo.getProject() ).length(), line.length() - 1 ); } /** * Identify the status of a vss get line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE_PATH ) ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_CURRENTLY_CHECKED_OUT ) ) { argument = CURRENTLY_CHECKED_OUT_FILE; } else if ( line.startsWith( START_WRITABLE_COPY ) ) { argument = IS_WRITABLE_COPY; } else if ( line.indexOf( CONTAINS_SET_DEFAULT_WORKING_FOLDER ) != -1 ) { argument = SET_WORKING_FOLDER; } return argument; } public List getUpdatedFiles() { return updatedFiles; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/edit/VssEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002076411304273113033546 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.edit; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.edit.AbstractEditCommand; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.commands.changelog.VssHistoryCommand; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Thorsten Riek * @version $Id: VssCheckOutCommand.java 02.06.2006 00:05:51 */ public class VssEditCommand extends AbstractEditCommand { /** {@inheritDoc} */ protected ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkout command..." ); } VssScmProviderRepository repo = (VssScmProviderRepository) repository; List commandLines = buildCmdLine( repo, fileSet ); VssEditConsumer consumer = new VssEditConsumer( repo, getLogger() ); // TODO handle deleted files from VSS CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode; StringBuffer sb = new StringBuffer(); List updatedFiles = new ArrayList(); for ( Iterator i = commandLines.iterator(); i.hasNext(); ) { Commandline cl = (Commandline) i.next(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString() ); } exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { String error = stderr.getOutput(); if ( getLogger().isDebugEnabled() ) { getLogger().debug( "VSS returns error: [" + error + "] return code: [" + exitCode + "]" ); } if ( error.indexOf( "A writable copy of" ) < 0 ) { return new EditScmResult( cl.toString(), "The vss command failed.", error, false ); } // print out the writable copy for manual handling if ( getLogger().isWarnEnabled() ) { getLogger().warn( error ); } break; } sb.append( cl.toString() + '\n' ); updatedFiles.addAll( consumer.getUpdatedFiles() ); } return new EditScmResult( sb.toString(), updatedFiles ); } public List buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { List files = fileSet.getFileList(); List commands = new ArrayList(); if ( files.size() > 0 ) { String base; try { base = fileSet.getBasedir().getCanonicalPath(); } catch ( IOException e ) { throw new ScmException( "Invalid canonical path", e ); } for ( Iterator i = files.iterator(); i.hasNext(); ) { Commandline command = new Commandline(); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_CHECKOUT ); File file = (File) i.next(); String absolute; try { absolute = file.getCanonicalPath(); String relative; int index = absolute.indexOf( base ); if ( index >= 0 ) { relative = absolute.substring( index + base.length() ); } else { relative = file.getPath(); } relative = relative.replace( '\\', '/' ); if ( !relative.startsWith( "/" ) ) { relative = '/' + relative; } String relativeFolder = relative.substring( 0, relative.lastIndexOf( '/' ) ); command.setWorkingDirectory( new File( fileSet.getBasedir().getAbsolutePath() + File.separatorChar + relativeFolder ).getCanonicalPath() ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() + relative ); } catch ( IOException e ) { throw new ScmException( "Invalid canonical path", e ); } //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); commands.add( command ); } } else { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_CHECKOUT ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); commands.add( command ); } return commands; } /** * @return */ protected ChangeLogCommand getChangeLogCommand() { VssHistoryCommand command = new VssHistoryCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000002116511051357615033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.apache.maven.scm.util.AbstractConsumer; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.Vector; /** * @author Emmanuel Venisse * @version $Id: VssChangeLogConsumer.java 686352 2008-08-15 19:57:01Z vsiveton $ */ public class VssChangeLogConsumer extends AbstractConsumer { /** * Custom date/time formatter. Rounds ChangeLogEntry times to the nearest * minute. */ private static final SimpleDateFormat ENTRY_KEY_TIMESTAMP_FORMAT = new SimpleDateFormat( "yyyyMMddHHmm" ); // state machine constants for reading Starteam output /** * expecting file information */ private static final int GET_FILE = 1; /** * expecting file path information */ private static final int GET_FILE_PATH = 2; /** * expecting date */ private static final int GET_AUTHOR = 3; /** * expecting comments */ private static final int GET_COMMENT = 4; /** * expecting revision */ private static final int GET_REVISION = 5; /** * unknown vss history line status */ private static final int GET_UNKNOWN = 6; /** * Marks start of file data */ private static final String START_FILE = "***** "; /** * Marks start of file data */ private static final String START_FILE_PATH = "$/"; /** * Marks start of revision */ private static final String START_REVISION = "Version"; /** * Marks author data */ private static final String START_AUTHOR = "User: "; /** * Marks comment data */ private static final String START_COMMENT = "Comment: "; /** * rcs entries, in reverse (date, time, author, comment) order */ private Map entries = new TreeMap( Collections.reverseOrder() ); private ChangeFile currentFile; private ChangeSet currentChangeSet; /** * last status of the parser */ private int lastStatus = GET_FILE; private VssScmProviderRepository repo; private String userDatePattern; public VssChangeLogConsumer( VssScmProviderRepository repo, String userDatePattern, ScmLogger logger ) { super( logger ); this.userDatePattern = userDatePattern; this.repo = repo; } public List getModifications() { return new ArrayList( entries.values() ); } /** {@inheritDoc} */ public void consumeLine( String line ) { switch ( getLineStatus( line ) ) { case GET_FILE: processGetFile( line ); break; case GET_REVISION: processGetRevision( line ); break; case GET_AUTHOR: processGetAuthor( line ); break; case GET_FILE_PATH: processGetFilePath( line ); break; case GET_COMMENT: processGetComment( line ); break; default: break; } } /** * Process the current input line in the Get Comment state. * * @param line a line of text from the VSS log output */ private void processGetComment( String line ) { String[] commentLine = line.split( ":" ); if ( commentLine.length == 2 ) { currentChangeSet.setComment( commentLine[1] ); } //Comment suite on a new line else { String comment = currentChangeSet.getComment(); comment = comment + " " + line; currentChangeSet.setComment( comment ); } } /** * Process the current input line in the Get Author state. * * @param line a line of text from the VSS log output */ private void processGetAuthor( String line ) { String[] result = line.split( "\\s" ); Vector vector = new Vector(); for ( int i = 0; i < result.length; i++ ) { if ( !result[i].equals( "" ) ) { vector.add( result[i] ); } } currentChangeSet.setAuthor( (String) vector.get( 1 ) ); currentChangeSet.setDate( parseDate( vector.get( 3 ) + " " + vector.get( 5 ), userDatePattern, "dd.MM.yy HH:mm" ) ); } /** * Process the current input line in the Get File state. * * @param line a line of text from the VSS log output */ private void processGetFile( String line ) { currentChangeSet = ( new ChangeSet() ); String[] fileLine = line.split( " " ); currentFile = new ChangeFile( fileLine[2] ); } /** * Process the current input line in the Get File Path state. * * @param line a line of text from the VSS log output */ private void processGetFilePath( String line ) { if ( currentFile != null ) { String fileName = currentFile.getName(); String path = line.substring( line.indexOf( "$" ), line.length() ); String longPath = path.substring( repo.getProject() .length() + 1, path.length() ) + "/" + fileName; currentFile.setName( longPath ); addEntry( currentChangeSet, currentFile ); } } /** * Process the current input line in the Get Revision state. * * @param line a line of text from the VSS log output */ private void processGetRevision( String line ) { String[] revisionLine = line.split( " " ); currentFile.setRevision( revisionLine[1] ); } /** * Identify the status of a vss history line * * @param line The line to process * @return status */ private int getLineStatus( String line ) { int argument = GET_UNKNOWN; if ( line.startsWith( START_FILE ) ) { argument = GET_FILE; } else if ( line.startsWith( START_REVISION ) ) { argument = GET_REVISION; } else if ( line.startsWith( START_AUTHOR ) ) { argument = GET_AUTHOR; } else if ( line.indexOf( START_FILE_PATH ) != -1 ) { argument = GET_FILE_PATH; } else if ( line.startsWith( START_COMMENT ) ) { argument = GET_COMMENT; } else if ( lastStatus == GET_COMMENT ) { //Comment suite on a new line argument = lastStatus; } lastStatus = argument; return argument; } /** * Add a change log entry to the list (if it's not already there) with the * given file. * * @param entry a {@link ChangeSet}to be added to the list if another * with the same key doesn't exist already. If the entry's author * is null, the entry wont be added * @param file a {@link ChangeFile}to be added to the entry */ private void addEntry( ChangeSet entry, ChangeFile file ) { // do not add if entry is not populated if ( entry.getAuthor() == null ) { return; } String key = ENTRY_KEY_TIMESTAMP_FORMAT.format( entry.getDate() ) + entry.getAuthor() + entry.getComment(); if ( !entries.containsKey( key ) ) { entry.addFile( file ); entries.put( key, entry ); } else { ChangeSet existingEntry = (ChangeSet) entries.get( key ); existingEntry.addFile( file ); } } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssHistoryCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001170511057610744033553 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.changelog; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; /** * @author Thorsten Riek * @version $Id: VssHistoryCommand.java 02.06.2006 00:05:29 */ public class VssHistoryCommand extends AbstractChangeLogCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { VssScmProviderRepository repo = (VssScmProviderRepository) repository; Commandline cl = buildCmdLine( repo, fileSet, startDate, endDate ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } VssChangeLogConsumer consumer = new VssChangeLogConsumer( repo, datePattern, getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); int exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The vss command failed.", stderr.getOutput(), false ); } return new ChangeLogScmResult( cl.toString(), new ChangeLogSet( consumer.getModifications(), startDate, endDate ) ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet, Date startDate, Date endDate ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_HISTORY ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Display the history of an entire project list command.createArg().setValue( VssConstants.FLAG_RECURSION ); //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); //Display only versions that fall within specified data range. if ( startDate != null ) { if ( endDate == null ) { endDate = new Date(); // = now } SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy", Locale.ENGLISH ); String dateRange = sdf.format( endDate ) + "~" + sdf.format( startDate ); command.createArg().setValue( VssConstants.FLAG_VERSION_DATE + dateRange ); } return command; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000755000175000017500000000000011345536665033556 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/add/VssAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000001237411057610744033556 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.vss.commands.VssCommandLineUtils; import org.apache.maven.scm.provider.vss.commands.VssConstants; import org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; /** * @author Brett Porter * @version $Id: VssAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class VssAddCommand extends AbstractAddCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { VssScmProviderRepository repo = (VssScmProviderRepository) repository; if ( fileSet.getFiles().length == 0 ) { throw new ScmException( "You must provide at least one file/directory to add" ); } Commandline cl = buildCmdLine( repo, fileSet ); VssAddConsumer consumer = new VssAddConsumer( getLogger() ); CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Executing: " + cl ); getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); } int exitCode = VssCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() ); if ( exitCode != 0 ) { return new ChangeLogScmResult( cl.toString(), "The vss command failed.", stderr.getOutput(), false ); } return new AddScmResult( cl.toString(), consumer.getAddedFiles() ); } public Commandline buildCmdLine( VssScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { Commandline command = new Commandline(); command.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_ADD ); VssCommandLineUtils.addFiles( command, fileSet ); // command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); return command; } public Commandline buildSetCurrentProjectCmdLine( VssScmProviderRepository repo ) throws ScmException { Commandline command = new Commandline(); try { command.addSystemEnvironment(); } catch ( Exception e ) { throw new ScmException( "Can't add system environment.", e ); } command.addEnvironment( "SSDIR", repo.getVssdir() ); String ssDir = VssCommandLineUtils.getSsDir(); command.setExecutable( ssDir + VssConstants.SS_EXE ); command.createArg().setValue( VssConstants.COMMAND_CP ); command.createArg().setValue( VssConstants.PROJECT_PREFIX + repo.getProject() ); //User identification to get access to vss repository if ( repo.getUserPassword() != null ) { command.createArg().setValue( VssConstants.FLAG_LOGIN + repo.getUserPassword() ); } //Ignore: Do not ask for input under any circumstances. command.createArg().setValue( VssConstants.FLAG_AUTORESPONSE_DEF ); return command; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/add/VssAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider0000644000175000017500000000526511057621704033555 0ustar twernertwernerpackage org.apache.maven.scm.provider.vss.commands.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.util.ArrayList; import java.util.List; /** * @author Brett Porter * @version $Id: VssAddConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class VssAddConsumer implements StreamConsumer { private ScmLogger logger; private List addedFiles = new ArrayList(); // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public VssAddConsumer( ScmLogger logger ) { this.logger = logger; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.length() <= 3 ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unexpected input, the line must be at least three characters long. Line: '" + line + "'." ); } return; } String statusString = line.substring( 0, 1 ); String file = line.substring( 3 ); ScmFileStatus status; if ( statusString.equals( "A" ) ) { status = ScmFileStatus.ADDED; } else { if ( logger.isInfoEnabled() ) { logger.info( "Unknown file status: '" + statusString + "'." ); } return; } addedFiles.add( new ScmFile( file, status ) ); } public List getAddedFiles() { return addedFiles; } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-vss/pom.xml0000644000175000017500000000455611322611461024755 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-vss Maven SCM Visual Source Safe Provider SCM Provider implementation for VSS (http://msdn.microsoft.com/en-us/vstudio/aa700907.aspx). org.codehaus.plexus plexus-maven-plugin descriptor org.codehaus.modello modello-maven-plugin 1.0-alpha-21 java xpp3-reader xsd 1.0.0 src/main/mdo/vss-settings.mdo maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/0000755000175000017500000000000011345536672024332 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/0000755000175000017500000000000011345536672025121 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/site/0000755000175000017500000000000011345536672026065 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/site/site.xml0000644000175000017500000000212711051127665027545 0ustar twernertwerner

maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/site/apt/0000755000175000017500000000000011345536672026651 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/0000755000175000017500000000000011345536671026077 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/0000755000175000017500000000000011345536671030111 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/0000755000175000017500000000000011345536671031611 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/0000755000175000017500000000000011345536671033444 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProject.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/get0000644000175000017500000000002110535300455034124 0ustar twernertwernerGesdemDT~ccm_root././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getTaskObjects.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/get0000644000175000017500000000004610535300455034133 0ustar twernertwernerMessageResources.properties#####3#####././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasksFrenchDate.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/get0000644000175000017500000000027310535300455034135 0ustar twernertwerner52#####ccm_root#####vendredi 6 octobre 2006 10:03:59#####Modification du pom (url scm)##### 53#####ccm_root#####vendredi 6 octobre 2006 10:47:13#####Inverser l'odre purpose/release#####././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/createTask.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/cre0000644000175000017500000000016210535300455034124 0ustar twernertwernerTask 70 created. The default task is set to: 70: Maven SCM Synergy provider: adding file(s) to project TestMaven~1././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getWorkingProjectEmpty.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/get0000644000175000017500000000000010535300455034121 0ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/getCompletedTasks.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/consumer/get0000644000175000017500000000007310535300455034133 0ustar twernertwerner35#####AHD456#####Wed Oct 4 15:42:47 2006#####gefdeag#####maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/0000755000175000017500000000000011345536671033073 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/update.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/update/updat0000644000175000017500000000123310535300455034117 0ustar twernertwernerDefaulting to project in the current working directory: D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT Reconciling selected items: GesdemDT~int_01.00.2.3.1.7.1 Examining Work Area for conflicts... 1 Project(s) will be reconciled 43 Directories will be reconciled Reconcile work area: 24% complete... Reconcile work area: 48% complete... Reconcile work area: 71% complete... Reconcile work area: 95% complete... Reconcile work area: 100% complete... 1 Work Area conflict(s) found Discarding changes to 'D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT\pom.xml'... Reconcile completed maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/0000755000175000017500000000000011345536671033134 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/status.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/status/statu0000644000175000017500000000000010535300455034172 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/0000755000175000017500000000000011345536671033101 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedit.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/unedit/unedi0000644000175000017500000000000010535300455034103 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/0000755000175000017500000000000011345536671033106 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remove.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/remove/remov0000644000175000017500000000000010535300455034134 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/0000755000175000017500000000000011345536671032364 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/tag/tag.txt0000644000175000017500000000000010535300455033653 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/0000755000175000017500000000000011345536671033215 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/checkin.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/checkin/chec0000644000175000017500000000152710535300455034034 0ustar twernertwernerDefaulting to project in the current working directory: D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT Reconciling selected items: GesdemDT~int_01.00.2.3.1.7.1 Examining Work Area for conflicts... 1 Project(s) will be reconciled 43 Directories will be reconciled Reconcile work area: 24% complete... Reconcile work area: 48% complete... Reconcile work area: 71% complete... Reconcile work area: 95% complete... Reconcile work area: 100% complete... 1 Work Area conflict(s) found Creating version 2 of pom.xml~1:xml:2 ... Added 'release' attribute with value 'GesdemDT_J2EE/01.00.1' to object pom.xml~2:xml:2 Updating database with file 'D:\tmp\target\checkout\GesdemDT~int_01.00.2.3.1.7.1\GesdemDT\pom.xml'... 1 new versions successfully created. Reconcile completed maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/0000755000175000017500000000000011345536671032536 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/edit/edit.tx0000644000175000017500000000000010535300455034013 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/0000755000175000017500000000000011345536671033540 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/changelog.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/changelog/ch0000644000175000017500000000000010535300455034030 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/0000755000175000017500000000000011345536671032341 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/resources/synergy/add/add.txt0000644000175000017500000000000010535300455033605 0ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/0000755000175000017500000000000011345536671027020 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/0000755000175000017500000000000011345536671027607 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/0000755000175000017500000000000011345536671031030 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/0000755000175000017500000000000011345536671032136 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536671032720 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000644000175000017500000000463010535556312033626 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * @author Julien Henry */ public class SynergyGetWorkingProjectConsumerTest extends ScmTestCase { public void testSynergyGetTaskObjectsConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/getWorkingProject.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); SynergyGetWorkingProjectConsumer consumer = new SynergyGetWorkingProjectConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertEquals( "GesdemDT~ccm_root", consumer.getProjectSpec() ); } public void testSynergyGetTaskObjectsConsumerEmpty() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/getWorkingProjectEmpty.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); SynergyGetWorkingProjectConsumer consumer = new SynergyGetWorkingProjectConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertNull( consumer.getProjectSpec() ); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000644000175000017500000000414710535556312033631 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; /** * @author Julien Henry */ public class SynergyGetTaskObjectsConsumerTest extends ScmTestCase { public void testSynergyGetTaskObjectsConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/getTaskObjects.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); SynergyGetTaskObjectsConsumer consumer = new SynergyGetTaskObjectsConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getFiles(); assertEquals( "Wrong number of entries returned", 1, entries.size() ); ChangeFile file = (ChangeFile) entries.iterator().next(); assertEquals( "MessageResources.properties", file.getName() ); assertEquals( "3", file.getRevision() ); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000644000175000017500000000340610535556312033626 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * @author Julien Henry */ public class SynergyCreateTaskConsumerTest extends ScmTestCase { public void testSynergyGetTaskObjectsConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/createTask.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); SynergyCreateTaskConsumer consumer = new SynergyCreateTaskConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } assertEquals( 70, consumer.getTask() ); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000644000175000017500000001017210535556312033624 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.synergy.util.SynergyTask; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Calendar; import java.util.Collection; import java.util.Iterator; /** * @author Julien Henry */ public class SynergyGetCompletedTasksConsumerTest extends ScmTestCase { public void testSynergyGetCompletedTasksConsumer() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/getCompletedTasks.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); SynergyGetCompletedTasksConsumer consumer = new SynergyGetCompletedTasksConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getTasks(); assertEquals( "Wrong number of tasks returned", 1, entries.size() ); SynergyTask task = (SynergyTask) entries.iterator().next(); assertEquals( 35, task.getNumber() ); assertEquals( "AHD456", task.getUsername() ); assertEquals( "gefdeag", task.getComment() ); Calendar cal = Calendar.getInstance(); cal.clear(); cal.set( 2006, Calendar.OCTOBER, 4, 15, 42, 47 ); assertEquals( cal.getTime(), task.getModifiedTime() ); } public void testSynergyGetCompletedTasksConsumerWithFrenchDate() throws IOException { InputStream inputStream = getResourceAsStream( "/synergy/consumer/getCompletedTasksFrenchDate.txt" ); BufferedReader in = new BufferedReader( new InputStreamReader( inputStream ) ); String s = in.readLine(); System.setProperty( "maven.scm.synergy.ccmDateFormat", "EEEE dd MMMM yyyy HH:mm:ss" ); System.setProperty( "maven.scm.synergy.language", "fr" ); System.setProperty( "maven.scm.synergy.country", "FR" ); SynergyGetCompletedTasksConsumer consumer = new SynergyGetCompletedTasksConsumer( new DefaultLog() ); while ( s != null ) { consumer.consumeLine( s ); s = in.readLine(); } Collection entries = consumer.getTasks(); assertEquals( "Wrong number of tasks returned", 2, entries.size() ); Iterator i = entries.iterator(); SynergyTask task = (SynergyTask) i.next(); assertEquals( 52, task.getNumber() ); assertEquals( "ccm_root", task.getUsername() ); assertEquals( "Modification du pom (url scm)", task.getComment() ); Calendar cal = Calendar.getInstance(); cal.clear(); cal.set( 2006, Calendar.OCTOBER, 6, 10, 3, 59 ); assertEquals( cal.getTime(), task.getModifiedTime() ); task = (SynergyTask) i.next(); assertEquals( 53, task.getNumber() ); assertEquals( "ccm_root", task.getUsername() ); assertEquals( "Inverser l'odre purpose/release", task.getComment() ); cal.clear(); cal.set( 2006, Calendar.OCTOBER, 6, 10, 47, 13 ); assertEquals( cal.getTime(), task.getModifiedTime() ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000644000175000017500000004210511312521265033616 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.util; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmTestCase; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.LinkedList; import java.util.List; /** * @author Julien Henry */ public class SynergyCCMTest extends ScmTestCase { public void testShowTaskObjects() throws Exception { Commandline cl = SynergyCCM.showTaskObjects( 45, "my format", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm task -show objects -f \"my format\" 45", null, cl ); cl = SynergyCCM.showTaskObjects( 45, null, "CCM_ADDR" ); assertCommandLine( "ccm task -show objects 45", null, cl ); } public void testQuery() throws Exception { Commandline cl = SynergyCCM.query( "my query", "my format", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm query -u -f \"my format\" \"my query\"", null, cl ); cl = SynergyCCM.query( "my query", null, "CCM_ADDR" ); assertCommandLine( "ccm query -u \"my query\"", null, cl ); } public void testCreateBaseline() throws Exception { Commandline cl = SynergyCCM.createBaseline( "myProject~1", "theBaseline", "my_release", "my_purpose", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm baseline -create theBaseline -p myProject~1 -release my_release -purpose my_purpose", null, cl ); } public void testCreate() throws Exception { File f = File.createTempFile( "test", null ); f.deleteOnExit(); List list = new LinkedList(); list.add( f ); Commandline cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm create -c \"test creation\" " + f.getCanonicalPath(), null, cl ); } File f2 = File.createTempFile( "test", null ); f2.deleteOnExit(); list.add( f2 ); cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm create -c \"test creation\" \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", null, cl ); } } else { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm create -c \"test creation\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm create -c \"test creation\" " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), null, cl ); } } } public void testCreateTask() throws Exception { /* * NOTE: Quoting of arguments can differ for Windows/Unix, hence we normalize to single quotes for the purpose * of testing. */ Commandline cl = SynergyCCM.createTask( "the synopsis", "release", true, "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); String actual = cl.toString().replace( '\"', '\'' ); String expected = "ccm task -create -synopsis 'the synopsis' -release release"; assertTrue( "[" + actual + "] does not contain [" + expected + "]", actual.indexOf( expected ) > -1 ); cl = SynergyCCM.createTask( "the synopsis", null, true, "CCM_ADDR" ); actual = cl.toString().replace( '\"', '\'' ); expected = "ccm task -create -synopsis 'the synopsis'"; assertTrue( "[" + actual + "] does not contain [" + expected + "]", actual.indexOf( expected ) > -1 ); } public void testCheckinTask() throws Exception { Commandline cl = SynergyCCM.checkinTask( "truc", "a comment", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm task -checkin truc -comment \"a comment\"", null, cl ); } public void testDelete() throws Exception { File f = File.createTempFile( "test", null ); f.deleteOnExit(); List list = new LinkedList(); list.add( f ); Commandline cl = SynergyCCM.delete( list, "CCM_ADDR", true ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm delete -replace \"" + f.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm delete -replace " + f.getCanonicalPath(), null, cl ); } File f2 = File.createTempFile( "test", null ); f2.deleteOnExit(); list.add( f2 ); cl = SynergyCCM.delete( list, "CCM_ADDR", false ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm delete \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm delete \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", null, cl ); } } else { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm delete " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm delete " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), null, cl ); } } } public void testReconfigure() throws Exception { Commandline cl = SynergyCCM.reconfigure( "project~1", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm reconfigure -recurse -p project~1", null, cl ); } public void testReconfigureProperties() throws Exception { Commandline cl = SynergyCCM.reconfigureProperties( "project~1", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm reconfigure_properties -refresh project~1", null, cl ); } public void testReconcileUwa() throws Exception { Commandline cl = SynergyCCM.reconcileUwa( "project~1", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm rwa -r -uwa -p project~1", null, cl ); cl = SynergyCCM.reconcileUwa( null, "CCM_ADDR" ); assertCommandLine( "ccm rwa -r -uwa", null, cl ); } public void testReconcileUdb() throws Exception { Commandline cl = SynergyCCM.reconcileUdb( "project~1", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm rwa -r -udb -p project~1", null, cl ); cl = SynergyCCM.reconcileUdb( null, "CCM_ADDR" ); assertCommandLine( "ccm rwa -r -udb", null, cl ); } public void testDir() throws Exception { File f = File.createTempFile( "foo", null ); f.deleteOnExit(); Commandline cl = SynergyCCM.dir( f.getParentFile(), "format", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertEquals( f.getParentFile().getCanonicalFile(), cl.getWorkingDirectory().getCanonicalFile() ); assertCommandLine( "ccm dir -m -f format", f.getParentFile().getCanonicalFile(), cl ); } public void testCheckoutFiles() throws Exception { File f = File.createTempFile( "test", null ); f.deleteOnExit(); List list = new LinkedList(); list.add( f ); Commandline cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm co \"" + f.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm co " + f.getCanonicalPath(), null, cl ); } File f2 = File.createTempFile( "test", null ); f2.deleteOnExit(); list.add( f2 ); cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm co \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm co \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", null, cl ); } } else { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm co " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm co " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), null, cl ); } } } public void testCheckoutProject() throws Exception { Commandline cl = SynergyCCM.checkoutProject( null, "MyProject", new ScmTag( "MyVersion" ), "MyPurpose", "MyRelease", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -p MyProject", null, cl ); File f = File.createTempFile( "test", null ); f.deleteOnExit(); cl = SynergyCCM.checkoutProject( f.getParentFile(), "MyProject", new ScmTag( "MyVersion" ), "MyPurpose", "MyRelease", "CCM_ADDR" ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -path \"" + f.getParentFile().getCanonicalPath() + "\" -p MyProject", null, cl ); } else { assertCommandLine( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose -release MyRelease -path " + f.getParentFile().getCanonicalPath() + " -p MyProject", null, cl ); } } public void testCheckinProject() throws Exception { Commandline cl = SynergyCCM.checkinProject( "MyProject", "a comment", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm ci -c \"a comment\" -p MyProject", null, cl ); } public void testCheckinFiles() throws Exception { File f = File.createTempFile( "test", null ); f.deleteOnExit(); List list = new LinkedList(); list.add( f ); Commandline cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm ci -c \"a comment\" " + f.getCanonicalPath(), null, cl ); } File f2 = File.createTempFile( "test", null ); f2.deleteOnExit(); list.add( f2 ); cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" ); if ( f.getCanonicalPath().indexOf( " " ) > -1 ) { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\" " + f2.getCanonicalPath() + "", null, cl ); } } else { if ( f2.getCanonicalPath().indexOf( " " ) > -1 ) { assertCommandLine( "ccm ci -c \"a comment\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath() + "\"", null, cl ); } else { assertCommandLine( "ccm ci -c \"a comment\" " + f.getCanonicalPath() + " " + f2.getCanonicalPath(), null, cl ); } } } public void testSync() throws Exception { Commandline cl = SynergyCCM.synchronize( "myProject", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm sync -r -p myProject", null, cl ); } public void testShowWorkArea() throws Exception { Commandline cl = SynergyCCM.showWorkArea( "MyProject~1", "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm wa -show MyProject~1", null, cl ); } public void testStart() throws ScmException { Commandline cl = SynergyCCM.start( "user", "pass", SynergyRole.BUILD_MGR ); assertCommandLine( "ccm start -nogui -m -q -n user -pw pass -r build_mgr", null, cl ); } public void testStartRemote() throws ScmException { Commandline cl = SynergyCCM.startRemote( "user", "pass", SynergyRole.BUILD_MGR ); assertCommandLine( "ccm start -nogui -m -q -rc -n user -pw pass -r build_mgr", null, cl ); } public void testStop() throws Exception { Commandline cl = SynergyCCM.stop( "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm stop", null, cl ); } public void testDelimiter() throws Exception { Commandline cl = SynergyCCM.delimiter( "CCM_ADDR" ); assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(), "CCM_ADDR=CCM_ADDR" ) ); assertCommandLine( "ccm delimiter", null, cl ); } public boolean assertContains( String[] array, String value ) { for ( int i = 0; i < array.length; i++ ) { if ( array[i].equals( value ) ) { return true; } } return false; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033627 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/0000755000175000017500000000000011345536671026044 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/0000755000175000017500000000000011345536671026765 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/0000755000175000017500000000000011345536671027554 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/0000755000175000017500000000000011345536671030775 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/0000755000175000017500000000000011345536671032103 5ustar twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536671032665 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033574 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/SynergyCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000204011050561465033562 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command; /* * 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. */ /** * @author Julien Henry * @version $Id: SynergyCommand.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public interface SynergyCommand { } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/update/SynergyUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001444411057610744033577 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.update; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.command.changelog.SynergyChangeLogCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @author Julien Henry * @version $Id: SynergyUpdateCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyUpdateCommand extends AbstractUpdateCommand implements SynergyCommand { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing update command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); File waPath; try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); SynergyUtil.reconfigureProperties( getLogger(), projectSpec, ccmAddr ); SynergyUtil.reconfigure( getLogger(), projectSpec, ccmAddr ); // We need to get WA path waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } File source = new File( waPath, repo.getProjectName() ); // Move file from work area to expected dir if not the same List modifications = new ArrayList(); if ( !source.equals( fileSet.getBasedir() ) ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "We will copy modified files from Synergy Work Area [" + source + "] to expected folder [" + fileSet.getBasedir() + "]" ); } try { copyDirectoryStructure( source, fileSet.getBasedir(), modifications ); } catch ( IOException e1 ) { throw new ScmException( "Unable to copy directory structure", e1 ); } } return new UpdateScmResult( "ccm reconcile -uwa ...", modifications ); } protected ChangeLogCommand getChangeLogCommand() { SynergyChangeLogCommand changeLogCmd = new SynergyChangeLogCommand(); changeLogCmd.setLogger( getLogger() ); return changeLogCmd; } /** * Copies a entire directory structure and collect modifications. *

* Note: *

    *
  • It will include empty directories. *
  • The sourceDirectory must exists. *
* * @param sourceDirectory * @param destinationDirectory * @throws IOException */ public static void copyDirectoryStructure( File sourceDirectory, File destinationDirectory, List modifications ) throws IOException { if ( !sourceDirectory.exists() ) { throw new IOException( "Source directory doesn't exists (" + sourceDirectory.getAbsolutePath() + ")." ); } File[] files = sourceDirectory.listFiles(); String sourcePath = sourceDirectory.getAbsolutePath(); for ( int i = 0; i < files.length; i++ ) { File file = files[i]; String dest = file.getAbsolutePath(); dest = dest.substring( sourcePath.length() + 1 ); File destination = new File( destinationDirectory, dest ); if ( file.isFile() ) { if ( file.lastModified() != destination.lastModified() ) { destination = destination.getParentFile(); FileUtils.copyFileToDirectory( file, destination ); modifications.add( new ScmFile( file.getAbsolutePath(), ScmFileStatus.UPDATED ) ); } } else if ( file.isDirectory() ) { if ( !destination.exists() && !destination.mkdirs() ) { throw new IOException( "Could not create destination directory '" + destination.getAbsolutePath() + "'." ); } copyDirectoryStructure( file, destination, modifications ); } else { throw new IOException( "Unknown file type: " + file.getAbsolutePath() ); } } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkout/SynergyCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001250011057610744033566 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.List; /** * @author Julien Henry * @version $Id: SynergyCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyCheckOutCommand extends AbstractCheckOutCommand implements SynergyCommand { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { if ( fileSet.getFileList().size() != 0 ) { throw new ScmException( "This provider doesn't support checking out subsets of a project" ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing checkout command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); File waPath; try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( projectSpec != null ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "A working project already exists [" + projectSpec + "]." ); } SynergyUtil.synchronize( getLogger(), projectSpec, ccmAddr ); } else { SynergyUtil.checkoutProject( getLogger(), null, repo.getProjectSpec(), version, repo.getProjectPurpose(), repo.getProjectRelease(), ccmAddr ); projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "A new working project [" + projectSpec + "] was created." ); } } SynergyUtil.reconfigure( getLogger(), projectSpec, ccmAddr ); waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } File source = new File( waPath, repo.getProjectName() ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "We will now copy files from Synergy Work Area [" + source + "] to expected folder [" + fileSet.getBasedir() + "]" ); } // Move files to the expected folder try { FileUtils.copyDirectoryStructure( source, fileSet.getBasedir() ); } catch ( IOException e1 ) { throw new ScmException( "Unable to copy directory structure", e1 ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "We will list content of checkout directory." ); } // We need to list files in the directory List files; try { files = FileUtils.getFiles( fileSet.getBasedir(), null, "_ccmwaid.inf" ); } catch ( IOException e ) { throw new ScmException( "Unable to list files in checkout directory", e ); } if ( getLogger().isDebugEnabled() ) { getLogger().debug( "checkout command end successfully ..." ); } return new CheckOutScmResult( files, new ScmResult( "multiple commandline", "OK", "OK", true ) ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/status/SynergyStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000560611057610744033577 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.status; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import java.util.Iterator; import java.util.LinkedList; import java.util.List; /** * @author Julien Henry * @version $Id: SynergyStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyStatusCommand extends AbstractStatusCommand implements SynergyCommand { /** {@inheritDoc} */ protected StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing status command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); List l; try { l = SynergyUtil.getWorkingFiles( getLogger(), repo.getProjectSpec(), repo.getProjectRelease(), ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } List result = new LinkedList(); for ( Iterator i = l.iterator(); i.hasNext(); ) { ScmFile f = new ScmFile( (String) i.next(), ScmFileStatus.MODIFIED ); result.add( f ); } return new StatusScmResult( "ccm dir", result ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/unedit/SynergyUnEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000767511057610744033607 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.unedit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.unedit.AbstractUnEditCommand; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.Iterator; /** * @author Julien Henry * @version $Id: SynergyUnEditCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyUnEditCommand extends AbstractUnEditCommand implements SynergyCommand { /** {@inheritDoc} */ protected ScmResult executeUnEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing unedit command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( projectSpec == null ) { throw new ScmException( "You should checkout project first" ); } File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); File destPath = new File( waPath, repo.getProjectName() ); for ( Iterator i = fileSet.getFileList().iterator(); i.hasNext(); ) { ScmFile f = (ScmFile) i.next(); File source = new File( fileSet.getBasedir(), f.getPath() ); File dest = new File( destPath, f.getPath() ); SynergyUtil.delete( getLogger(), dest, ccmAddr, true ); if ( !source.equals( dest ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Copy file [" + dest + "] to [" + source + "]." ); } try { FileUtils.copyFile( dest, source ); } catch ( IOException e ) { throw new ScmException( "Unable to restore file in output folder", e ); } } } } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new UnEditScmResult( "", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/remove/SynergyRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000714211057610744033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import java.io.File; import java.util.Iterator; /** * @author Julien Henry * @version $Id: SynergyRemoveCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyRemoveCommand extends AbstractRemoveCommand implements SynergyCommand { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing remove command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( projectSpec == null ) { throw new ScmException( "You should checkout project first" ); } File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); File destPath = new File( waPath, repo.getProjectName() ); for ( Iterator i = fileSet.getFileList().iterator(); i.hasNext(); ) { ScmFile f = (ScmFile) i.next(); File source = new File( fileSet.getBasedir(), f.getPath() ); File dest = new File( destPath, f.getPath() ); SynergyUtil.delete( getLogger(), dest, ccmAddr, false ); if ( !source.equals( dest ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Delete file [" + source + "]." ); } dest.delete(); } } } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new StatusScmResult( "", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/tag/SynergyTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000605711157300235033570 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.tag; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyRole; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; /** * @author Julien Henry * @version $Id: SynergyTagCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public class SynergyTagCommand extends AbstractTagCommand implements SynergyCommand { protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag, String message ) throws ScmException { return executeTagCommand( repository, fileSet, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing tag command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), SynergyRole.BUILD_MGR ); try { SynergyUtil.createBaseline( getLogger(), repo.getProjectSpec(), tag, repo.getProjectRelease(), repo .getProjectPurpose(), ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new TagScmResult( "", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/checkin/SynergyCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000515111057610744033572 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; /** * @author Julien Henry * @version $Id: SynergyCheckInCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyCheckInCommand extends AbstractCheckInCommand implements SynergyCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing update command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); try { SynergyUtil.checkinDefaultTask( getLogger(), message, ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new CheckInScmResult( "ccm checkin", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/edit/SynergyEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001060111057610744033566 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.edit; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.edit.AbstractEditCommand; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.LinkedList; import java.util.List; /** * @author Julien Henry * @version $Id: SynergyEditCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyEditCommand extends AbstractEditCommand implements SynergyCommand { /** {@inheritDoc} */ protected ScmResult executeEditCommand( ScmProviderRepository repository, ScmFileSet fileSet ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing edit command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); File sourcePath = new File( waPath, repo.getProjectName() ); if ( projectSpec == null ) { throw new ScmException( "You should checkout project first" ); } int taskNum = SynergyUtil.createTask( getLogger(), "Maven SCM Synergy provider: edit command for project " + repo.getProjectSpec(), repo.getProjectRelease(), true, ccmAddr ); if ( getLogger().isInfoEnabled() ) { getLogger().info( "Task " + taskNum + " was created to perform checkout." ); } for ( Iterator i = fileSet.getFileList().iterator(); i.hasNext(); ) { File f = (File) i.next(); File dest = f; File source = new File( sourcePath, SynergyUtil.removePrefix( fileSet.getBasedir(), f ) ); List list = new LinkedList(); list.add( source ); SynergyUtil.checkoutFiles( getLogger(), list, ccmAddr ); if ( !source.equals( dest ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Copy file [" + source + "] to expected folder [" + dest + "]." ); } try { FileUtils.copyFile( source, dest ); } catch ( IOException e ) { throw new ScmException( "Unable to copy file from Work Area", e ); } } } } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new EditScmResult( "", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/changelog/SynergyChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000756511057610744033605 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyTask; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author Julien Henry * @version $Id: SynergyChangeLogCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyChangeLogCommand extends AbstractChangeLogCommand implements SynergyCommand { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing changelog command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); List csList = new ArrayList(); try { String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( projectSpec == null ) { throw new ScmException( "You should checkout project first" ); } List tasks = SynergyUtil.getCompletedTasks( getLogger(), projectSpec, startDate, endDate, ccmAddr ); for ( Iterator i = tasks.iterator(); i.hasNext(); ) { ChangeSet cs = new ChangeSet(); SynergyTask t = ( (SynergyTask) i.next() ); cs.setAuthor( t.getUsername() ); cs.setComment( "Task " + t.getNumber() + ": " + t.getComment() ); cs.setDate( t.getModifiedTime() ); cs.setFiles( SynergyUtil.getModifiedObjects( getLogger(), t.getNumber(), ccmAddr ) ); csList.add( cs ); } } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new ChangeLogScmResult( "ccm query ...", new ChangeLogSet( csList, startDate, endDate ) ); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536672033575 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/command/add/SynergyAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001047611057610744033600 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.command.add; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.synergy.command.SynergyCommand; import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.util.Iterator; /** * @author Julien Henry * @version $Id: SynergyAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyAddCommand extends AbstractAddCommand implements SynergyCommand { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "executing add command..." ); } SynergyScmProviderRepository repo = (SynergyScmProviderRepository) repository; if ( getLogger().isDebugEnabled() ) { getLogger().debug( "basedir: " + fileSet.getBasedir() ); } if ( message == null || message.equals( "" ) ) { message = "Maven SCM Synergy provider: adding file(s) to project " + repo.getProjectSpec(); } String ccmAddr = SynergyUtil.start( getLogger(), repo.getUser(), repo.getPassword(), null ); try { int taskNum = SynergyUtil.createTask( getLogger(), message, repo.getProjectRelease(), true, ccmAddr ); String projectSpec = SynergyUtil.getWorkingProject( getLogger(), repo.getProjectSpec(), repo.getUser(), ccmAddr ); if ( projectSpec == null ) { throw new ScmException( "You should checkout project first" ); } File waPath = SynergyUtil.getWorkArea( getLogger(), projectSpec, ccmAddr ); File destPath = new File( waPath, repo.getProjectName() ); for ( Iterator i = fileSet.getFileList().iterator(); i.hasNext(); ) { File f = (File) i.next(); File source = f; File dest = new File( destPath, SynergyUtil.removePrefix( fileSet.getBasedir(), f ) ); if ( !source.equals( dest ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Copy file [" + source + "] to Synergy Work Area [" + dest + "]." ); } try { FileUtils.copyFile( source, dest ); } catch ( IOException e ) { throw new ScmException( "Unable to copy file in Work Area", e ); } } SynergyUtil.create( getLogger(), dest, message, ccmAddr ); } SynergyUtil.checkinTask( getLogger(), taskNum, message, ccmAddr ); } finally { SynergyUtil.stop( getLogger(), ccmAddr ); } return new AddScmResult( "", fileSet.getFileList() ); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033574 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetCompletedTasksConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001140211057621704033564 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.synergy.util.SynergyTask; import org.apache.maven.scm.provider.synergy.util.SynergyUtil; import org.apache.maven.scm.util.AbstractConsumer; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.StringTokenizer; /** * Mainly inspired from CruiseControl * * @author Julien Henry * @version $Id: SynergyGetCompletedTasksConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SynergyGetCompletedTasksConsumer extends AbstractConsumer { /** * The date format as returned by your installation of CM Synergy. Fri Dec 3 * 17:51:56 2004 */ private String ccmDateFormat = "EEE MMM dd HH:mm:ss yyyy"; private String language = "en"; private String country = "US"; public static final String OUTPUT_FORMAT = "%displayname" + SynergyUtil.SEPARATOR + "%owner" + SynergyUtil.SEPARATOR + "%completion_date" + SynergyUtil.SEPARATOR + "%task_synopsis" + SynergyUtil.SEPARATOR; private List entries = new ArrayList(); /** * @return the tasks */ public List getTasks() { return entries; } public SynergyGetCompletedTasksConsumer( ScmLogger logger ) { super( logger ); String dateFormat = System.getProperty( "maven.scm.synergy.ccmDateFormat" ); if ( dateFormat != null && !dateFormat.equals( "" ) ) { this.ccmDateFormat = dateFormat; } if ( logger.isDebugEnabled() ) { logger.debug( "dateFormat = " + this.ccmDateFormat ); } String language = System.getProperty( "maven.scm.synergy.language" ); if ( language != null && !language.equals( "" ) ) { this.language = language; } if ( logger.isDebugEnabled() ) { logger.debug( "language = " + this.language ); } String country = System.getProperty( "maven.scm.synergy.country" ); if ( country != null && !country.equals( "" ) ) { this.country = country; } if ( logger.isDebugEnabled() ) { logger.debug( "country = " + this.country ); } } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consume: " + line ); } StringTokenizer tokenizer = new StringTokenizer( line.trim(), SynergyUtil.SEPARATOR ); if ( tokenizer.countTokens() == 4 ) { SynergyTask task = new SynergyTask(); task.setNumber( Integer.parseInt( tokenizer.nextToken() ) ); task.setUsername( tokenizer.nextToken() ); try { task.setModifiedTime( new SimpleDateFormat( ccmDateFormat, new Locale( language, country ) ) .parse( tokenizer.nextToken() ) ); } catch ( ParseException e ) { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Wrong date format", e ); } } task.setComment( tokenizer.nextToken() ); // Add the task to the list entries.add( task ); } else { if ( getLogger().isErrorEnabled() ) { getLogger().error( "Invalid token count in SynergyGetCompletedTasksConsumer [" + tokenizer.countTokens() + "]" ); } if ( getLogger().isDebugEnabled() ) { while ( tokenizer.hasMoreElements() ) { getLogger().debug( tokenizer.nextToken() ); } } } } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyCreateTaskConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000364611057610744033601 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.util.AbstractConsumer; /** * @author Julien Henry * @version $Id: SynergyCreateTaskConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class SynergyCreateTaskConsumer extends AbstractConsumer { private int task; /** * @return the entries */ public int getTask() { return task; } public SynergyCreateTaskConsumer( ScmLogger logger ) { super( logger ); } /** * Task 70 created.
The default task is set to:
70: Maven SCM * Synergy provider: adding file(s) to project TestMaven~1 * * {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Consume: " + line ); } if ( line.startsWith( "Task " ) && line.indexOf( " created." ) > -1 ) { task = Integer.parseInt( line.substring( 5, line.indexOf( " created." ) ) ); } } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingProjectConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000344011057621704033567 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; /** * Parse output of *

*

 *  ccm wa -show -p <project_spec>
 * 
* * @author Julien Henry * @version $Id: SynergyGetWorkingProjectConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SynergyGetWorkingProjectConsumer implements StreamConsumer { private ScmLogger logger; private String projectSpec; public SynergyGetWorkingProjectConsumer( ScmLogger logger ) { this.logger = logger; } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( logger.isDebugEnabled() ) { logger.debug( line ); } if ( !line.trim().equals( "" ) ) { projectSpec = line.trim(); } } public String getProjectSpec() { return projectSpec; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyWorkareaConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000471411057621704033574 0ustar twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer; /* * 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. */ import org.apache.maven.scm.log.ScmLogger; import org.codehaus.plexus.util.cli.StreamConsumer; import java.io.File; /** * Parse output of *

*

 * ccm wa -show -p <project_spec>
 * 
* * @author Julien Henry * @version $Id: SynergyWorkareaConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class SynergyWorkareaConsumer implements StreamConsumer { private ScmLogger logger; private File workarea; public SynergyWorkareaConsumer( ScmLogger logger ) { this.logger = logger; } /** * We are expecting the following output: *

*

     *            Project Maintain Copies Relative Time Translate Modify Path
     *            -------------------------------------------------------------------
     *            BGZBFZH˜1 TRUE TRUE FALSE FALSE TRUE FALSE 'D:\cmsynergy\ccm_wa\LAPOSTE\BGZBFZH˜1'
     * 
*

* And we want to extract: *

*

     *            D:\cmsynergy\ccm_wa\LAPOSTE\BGZBFZH˜1
     *            <pre>
     *
     * {@inheritDoc}
     */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }
        if ( line.indexOf( " '" ) > -1 )
        {
            int beginIndex = line.indexOf( " '" );
            String fileName = line.substring( beginIndex + 2, line.indexOf( "'", beginIndex + 2 ) );
            workarea = new File( fileName );
        }
    }

    public File getWorkAreaPath()
    {
        return workarea;
    }
}
././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetWorkingFilesConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000344111057621704033570 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer;

/*
 * 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.
 */

import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Julien Henry
 * @version $Id: SynergyGetWorkingFilesConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class SynergyGetWorkingFilesConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private List files = new ArrayList();

    public static final String OUTPUT_FORMAT = "%name";

    public SynergyGetWorkingFilesConsumer( ScmLogger logger )
    {
        this.logger = logger;
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }
        if ( !line.trim().equals( "" ) )
        {
            files.add( line );
        }
    }

    public List getFiles()
    {
        return files;
    }
}
././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/consumer/SynergyGetTaskObjectsConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000507511057610744033577 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.consumer;

/*
 * 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.
 */

import org.apache.maven.scm.ChangeFile;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.synergy.util.SynergyUtil;
import org.apache.maven.scm.util.AbstractConsumer;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

/**
 * Mainly inspired from CruiseControl
 *
 * @author Julien Henry
 * @version $Id: SynergyGetTaskObjectsConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class SynergyGetTaskObjectsConsumer
    extends AbstractConsumer
{

    private List entries = new ArrayList();

    public static final String OUTPUT_FORMAT = "%name" + SynergyUtil.SEPARATOR + // 0
        "%version" + SynergyUtil.SEPARATOR;

    /**
     * @return the entries
     */
    public List getFiles()
    {
        return entries;
    }

    public SynergyGetTaskObjectsConsumer( ScmLogger logger )
    {
        super( logger );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "Consume: " + line );
        }
        StringTokenizer tokenizer = new StringTokenizer( line.trim(), SynergyUtil.SEPARATOR );
        if ( tokenizer.countTokens() == 2 )
        {
            ChangeFile f = new ChangeFile( tokenizer.nextToken() );
            f.setRevision( tokenizer.nextToken() );
            entries.add( f );
        }
        else
        {
            if ( getLogger().isErrorEnabled() )
            {
                getLogger().error(
                                   "Invalid token count in SynergyGetTaskObjects [" + tokenizer.countTokens()
                                       + "]" );
            }
        }
    }

}
././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033574 5ustar  twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000007172211316224524033574 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.util;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.synergy.consumer.SynergyCreateTaskConsumer;
import org.apache.maven.scm.provider.synergy.consumer.SynergyGetCompletedTasksConsumer;
import org.apache.maven.scm.provider.synergy.consumer.SynergyGetTaskObjectsConsumer;
import org.apache.maven.scm.provider.synergy.consumer.SynergyGetWorkingFilesConsumer;
import org.apache.maven.scm.provider.synergy.consumer.SynergyGetWorkingProjectConsumer;
import org.apache.maven.scm.provider.synergy.consumer.SynergyWorkareaConsumer;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;

/**
 * This class contains functional methodsfor Synergy.
 *
 * @author Julien Henry
 * @version $Id: SynergyUtil.java 894254 2009-12-28 21:55:32Z olamy $
 */
public class SynergyUtil
{

    /**
     * Separator used with formatted result
     */
    public static final String SEPARATOR = "#####";

    /**
     * Remove prefix path from a path. Example: removeParent("c:\tmp",
     * "c:\tmp\foo.bar") returns "foo.bar"
     *
     * @param prefix parent path (prefix).
     * @param file   file path.
     * @return suffix
     * @throws ScmException if parent is not a prefix of file
     */
    public static String removePrefix( File prefix, File file )
        throws ScmException
    {
        try
        {
            String prefixStr = prefix.getCanonicalPath();
            String fileStr = file.getCanonicalPath();
            if ( !fileStr.startsWith( prefixStr ) )
            {
                throw new ScmException( prefixStr + " is not a prefix of " + fileStr );
            }
            return fileStr.substring( prefixStr.length() );
        }
        catch ( IOException e )
        {
            throw new ScmException( "IOException", e );
        }

    }

    /**
     * Get a working project whose predecessor is given.
     *
     * @param logger       a logger.
     * @param projectSpec predecessor (prep project)
     * @param username     owner of working project
     * @param ccmAddr      Synergy session ID.
     * @return projectSpec of the working checkout, or null if none
     */
    public static String getWorkingProject( ScmLogger logger, String projectSpec, String username, String ccmAddr )
        throws ScmException
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : Entering getWorkingProject method" );
        }

        String query =
            "owner='" + username + "' and status='working' and type='project' and has_predecessor('" + projectSpec +"')";
                //+ ":project:1')"; SCM-261

        Commandline cl = SynergyCCM.query( query, "%objectname", ccmAddr );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        SynergyGetWorkingProjectConsumer stdout = new SynergyGetWorkingProjectConsumer( logger );

        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : getWorkingProject returns " + stdout.getProjectSpec() + " with code "
                + errorCode );
        }

        return stdout.getProjectSpec();
    }

    /**
     * Get working file(s) in a given project.
     *
     * @param logger       a logger.
     * @param projectSpec (project)
     * @param release      release
     * @param ccmAddr      Synergy session ID.
     * @return list of working files.
     */
    public static List getWorkingFiles( ScmLogger logger, String projectSpec, String release, String ccmAddr )
        throws ScmException
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : Entering getWorkingFiles method" );
        }

        String query = "status='working' and release='" + release + "' and is_member_of('" + projectSpec + "')";

        Commandline cl = SynergyCCM.query( query, SynergyGetWorkingFilesConsumer.OUTPUT_FORMAT, ccmAddr );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        SynergyGetWorkingFilesConsumer stdout = new SynergyGetWorkingFilesConsumer( logger );

        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : getWorkingFiles returns " + stdout.getFiles().size() + " files with code "
                + errorCode );
        }

        return stdout.getFiles();
    }

    /**
     * Populate the object list of a Modification by querying for objects
     * associated with the task.
     *
     * @param logger  a logger.
     * @param numTask task number.
     * @param ccmAddr Synergy session ID.
     */
    public static List getModifiedObjects( ScmLogger logger, int numTask, String ccmAddr )
        throws ScmException
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : Entering getModifiedObjects method" );
        }

        Commandline cl = SynergyCCM.showTaskObjects( numTask, SynergyGetTaskObjectsConsumer.OUTPUT_FORMAT, ccmAddr );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        SynergyGetTaskObjectsConsumer stdout = new SynergyGetTaskObjectsConsumer( logger );
        int errorCode = executeSynergyCommand( logger, cl, stderr, stdout, false );

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : getModifiedObjects returns " + stdout.getFiles().size() + " files with code "
                + errorCode );
        }

        return stdout.getFiles();

    }

    /**
     * Get a list of all tasks which are contained in all folders in the
     * reconfigure properties of the specified project and were completed after
     * startDate and before endDate.
     *
     * @param logger      a logger.
     * @param projectSpec projectSpec.
     * @param startDate   start date.
     * @param endDate     end date.
     * @param ccmAddr     Synergy session ID.
     * @return A list of Task
     */
    public static List getCompletedTasks( ScmLogger logger, String projectSpec, Date startDate, Date endDate,
                                          String ccmAddr )
        throws ScmException
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Synergy : Entering getCompletedTasks method" );
        }

        // The format used for converting Java dates into CM Synergy dates
        // Note that the format used to submit commands differs from the
        // format used in the results of that command!?!
        SimpleDateFormat toCcmDate = new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss", new Locale( "en", "US" ) );

        // Construct the query string
        String query = "is_task_in_folder_of(is_folder_in_rp_of('" + projectSpec + "'))";
        if ( startDate != null )
        {
            query = query + "and completion_date>time('" + toCcmDate.format( startDate ) + "')";
        }
        if ( endDate != null )
        {
            query = query + "and completion_dateJulien Henry
 * @version $Id: SynergyCCM.java 891919 2009-12-17 21:29:25Z olamy $
 */
public class SynergyCCM
{

    private static final String CCM = "ccm";

    private static final String BASELINE = "baseline";

    private static final String CI = "ci";

    private static final String CO = "co";

    private static final String CREATE = "create";

    private static final String DELETE = "delete";

    private static final String DELIMITER = "delimiter";

    private static final String DIR = "dir";

    private static final String QUERY = "query";

    private static final String RECONCILE = "rwa";

    private static final String RECONFIGURE = "reconfigure";

    private static final String RECONFIGURE_PROPERTIES = "reconfigure_properties";

    private static final String START = "start";

    private static final String STOP = "stop";

    private static final String SYNC = "sync";

    private static final String TASK = "task";

    private static final String WA = "wa";

    /**
     * Create commandline for getting list of objects in a task.
     *
     * @param taskNumber Task number.
     * @param format     Output format.
     * @param ccmAddr
     * @return the commandl ine.
     * @throws ScmException
     */
    public static Commandline showTaskObjects( int taskNumber, String format, String ccmAddr )
        throws ScmException
    {
        // Construct the CM Synergy command
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );

        cl.createArg().setValue( TASK );
        cl.createArg().setValue( "-show" );
        cl.createArg().setValue( "objects" );

        // Set up the output format
        if ( format != null && !format.equals( "" ) )
        {
            cl.createArg().setValue( "-f" );
            cl.createArg().setValue( format );
        }

        cl.createArg().setValue( Integer.toString( taskNumber ) );

        return cl;
    }

    /**
     * Create commandline for query.
     *
     * @param query    query.
     * @param format   Output format
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline query( String query, String format, String ccmAddr )
        throws ScmException
    {

        // Construct the CM Synergy command
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( QUERY );

        cl.createArg().setValue( "-u" );

        // Set up the output format
        if ( format != null && !format.equals( "" ) )
        {
            cl.createArg().setValue( "-f" );
            cl.createArg().setValue( format );
        }

        cl.createArg().setValue( query );

        return cl;
    }

    /**
     * Create command line for creating a baseline.
     *
     * @param projectSpec project_name~project_version
     * @param name        Name of the baseline
     * @param release     the release.
     * @param purpose     the purpose.
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline createBaseline( String projectSpec, String name, String release, String purpose,
                                              String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( BASELINE );

        cl.createArg().setValue( "-create" );
        cl.createArg().setValue( name );

        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( projectSpec );

        cl.createArg().setValue( "-release" );
        cl.createArg().setValue( release );

        cl.createArg().setValue( "-purpose" );
        cl.createArg().setValue( purpose );

        return cl;

    }

    /**
     * Create command line for adding a fileset to a project
     *
     * @param files    fileset.
     * @param message  message log, or null if none.
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline create( List files, String message, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CREATE );

        if ( message != null && !message.equals( "" ) )
        {

            cl.createArg().setValue( "-c" );

            cl.createArg().setValue( message );

        }

        for ( Iterator i = files.iterator(); i.hasNext(); )
        {
            File f = (File) i.next();
            try
            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
        }

        return cl;

    }

    /**
     * Create command line for creating a task
     *
     * @param synopsis    synopsis.
     * @param release     release.
     * @param defaultTask default.
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline createTask( String synopsis, String release, boolean defaultTask, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( TASK );

        cl.createArg().setValue( "-create" );

        cl.createArg().setValue( "-synopsis" );
        cl.createArg().setValue( synopsis );

        if ( release != null && !release.equals( "" ) )
        {
            cl.createArg().setValue( "-release" );
            cl.createArg().setValue( release );
        }

        if ( defaultTask )
        {
            cl.createArg().setValue( "-default" );
        }

        cl.createArg().setValue( "-description" );
        cl.createArg().setValue(
            "This task was created by Maven SCM Synergy provider on " + Calendar.getInstance().getTime() );

        return cl;

    }

    /**
     * Create command line for checkin a task
     *
     * @param taskSpecs task_specs or default
     * @param comment    comment.
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline checkinTask( String taskSpecs, String comment, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( TASK );

        cl.createArg().setValue( "-checkin" );

        cl.createArg().setValue( taskSpecs );

        cl.createArg().setValue( "-comment" );
        cl.createArg().setValue( comment );

        return cl;

    }

    /**
     * Create command line for deleting file(s).
     *
     * @param files    fileset.
     * @param ccmAddr
     * @param replace  replace with previous version of file ?
     * @return
     * @throws ScmException
     */
    public static Commandline delete( List files, String ccmAddr, boolean replace )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( DELETE );

        if ( replace )
        {
            cl.createArg().setValue( "-replace" );
        }

        for ( Iterator i = files.iterator(); i.hasNext(); )
        {
            File f = (File) i.next();
            try
            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
        }

        return cl;

    }

    /**
     * Create commandline to reconfigure a project.
     *
     * @param projectSpec
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline reconfigure( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( RECONFIGURE );

        cl.createArg().setValue( "-recurse" );

        if ( projectSpec != null )
        {
            cl.createArg().setValue( "-p" );
            cl.createArg().setValue( projectSpec );
        }

        return cl;

    }

    /**
     * Create commandline to reconfigure properties of a project.
     *
     * @param projectSpec
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline reconfigureProperties( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( RECONFIGURE_PROPERTIES );

        cl.createArg().setValue( "-refresh" );
        cl.createArg().setValue( projectSpec );

        return cl;

    }

    /**
     * Create command line to reconcile a project with uwa option.
     *
     * @param projectSpec
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline reconcileUwa( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( RECONCILE );

        cl.createArg().setValue( "-r" );
        cl.createArg().setValue( "-uwa" ); // Update wa from database

        if ( projectSpec != null )
        {
            cl.createArg().setValue( "-p" );
            cl.createArg().setValue( projectSpec );
        }

        return cl;

    }

    /**
     * Create command line to reconcile a project with udb option.
     *
     * @param projectSpec
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline reconcileUdb( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( RECONCILE );

        cl.createArg().setValue( "-r" );
        cl.createArg().setValue( "-udb" ); // Update database from wa

        if ( projectSpec != null )
        {
            cl.createArg().setValue( "-p" );
            cl.createArg().setValue( projectSpec );
        }

        return cl;

    }

    /**
     * Create command line to perform a dir on the directory.
     *
     * @param directory
     * @param format    Output format.
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline dir( File directory, String format, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        try
        {
            cl.setWorkingDirectory( directory.getCanonicalPath() );
        }
        catch ( IOException e )
        {
            throw new ScmException( "Invalid directory", e );
        }

        cl.setExecutable( CCM );
        cl.createArg().setValue( DIR );
        cl.createArg().setValue( "-m" );

        // Set up the output format
        if ( format != null && !format.equals( "" ) )
        {
            cl.createArg().setValue( "-f" );
            cl.createArg().setValue( format );
        }

        return cl;

    }

    /**
     * Create commandline to checkout a fileset.
     *
     * @param files    fileset.
     * @param ccmAddr
     * @return the command line.
     * @throws ScmException
     */
    public static Commandline checkoutFiles( List files, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CO );

        for ( Iterator i = files.iterator(); i.hasNext(); )
        {
            File f = (File) i.next();
            try
            {
                cl.createArg().setValue( f.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid file path " + f.toString(), e );
            }
        }

        return cl;
    }

    /**
     * Create commandline to checkout a project
     *
     * @param directory    target WA, or null if using default directory
     * @param projectSpec
     * @param version      new version of the project, or null if using default Synergy
     *                     mecanism
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline checkoutProject( File directory, String projectSpec, ScmVersion version, String purpose,
                                               String release, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CO );
        cl.createArg().setValue( "-subprojects" ); // Checkout sub-projects
        cl.createArg().setValue( "-rel" ); // Relative

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            cl.createArg().setValue( "-t" ); // Version
            cl.createArg().setValue( version.getName() );
        }

        if ( purpose != null && !purpose.equals( "" ) )
        {
            cl.createArg().setValue( "-purpose" );
            cl.createArg().setValue( purpose );
        }

        if ( release != null && !release.equals( "" ) )
        {
            cl.createArg().setValue( "-release" );
            cl.createArg().setValue( release );
        }

        if ( directory != null )
        {
            cl.createArg().setValue( "-path" );
            try
            {
                cl.createArg().setValue( directory.getCanonicalPath() );
            }
            catch ( IOException e )
            {
                throw new ScmException( "Invalid directory", e );
            }
        }
        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( projectSpec );

        return cl;
    }

    /**
     * Create commandline to checkin a project
     *
     * @param projectSpec
     * @param comment
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline checkinProject( String projectSpec, String comment, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CI );
        if ( comment != null && !comment.equals( "" ) )
        {
            cl.createArg().setValue( "-c" );
            cl.createArg().setValue( comment );
        }
        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( projectSpec );

        return cl;
    }

    /**
     * Create commandline to checkin a fileset
     *
     * @param files    fileset.
     * @param comment
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline checkinFiles( List files, String comment, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( CI );
        if ( comment != null && !comment.equals( "" ) )
        {
            cl.createArg().setValue( "-c" );
            cl.createArg().setValue( comment );
        }

        if ( files.size() > 0 )
        {
            for ( Iterator i = files.iterator(); i.hasNext(); )
            {
                File f = (File) i.next();
                try
                {
                    cl.createArg().setValue( f.getCanonicalPath() );
                }
                catch ( IOException e )
                {
                    throw new ScmException( "Invalid file path " + f.toString(), e );
                }
            }
        }
        return cl;
    }

    /**
     * Create commandline to synchronize a project
     *
     * @param projectSpec
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline synchronize( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( SYNC );
        cl.createArg().setValue( "-r" ); // Recursive
        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( projectSpec );

        return cl;
    }

    /**
     * Create commandline to get workarea informations for a given project.
     *
     * @param projectSpec
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline showWorkArea( String projectSpec, String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( WA );
        cl.createArg().setValue( "-show" );
        cl.createArg().setValue( projectSpec );

        return cl;
    }

    /**
     * Create commandline to stop a Synergy session
     *
     * @param ccmAddr
     * @return
     * @throws ScmException
     */
    public static Commandline stop( String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( STOP );

        return cl;
    }

    /**
     * Configure a commandline to use environement variables ($PATH)
     *
     * @param cl
     * @param ccmAddr
     * @throws ScmException
     */
    private static void configureEnvironment( Commandline cl, String ccmAddr )
        throws ScmException
    {
        // We need PATH to be set for using CCM
        try
        {
            Properties envVars = CommandLineUtils.getSystemEnvVars();

            for ( Iterator i = envVars.keySet().iterator(); i.hasNext(); )
            {
                String key = (String) i.next();

                if ( !key.equalsIgnoreCase( "CCM_ADDR" ) )
                {

                    cl.addEnvironment( key, envVars.getProperty( key ) );

                }
            }
        }
        catch ( Exception e1 )
        {
            throw new ScmException( "Fail to add PATH environment variable.", e1 );

        }
        cl.addEnvironment( "CCM_ADDR", ccmAddr );

    }

    /**
     * Create commandline to start a Synergy session
     *
     * @param username
     * @param password
     * @param role
     * @return
     * @throws ScmException
     */
    public static Commandline start( String username, String password, SynergyRole role )
        throws ScmException
    {
        Commandline cl = new Commandline();

        cl.setExecutable( CCM );
        cl.createArg().setValue( START );
        cl.createArg().setValue( "-nogui" );
        cl.createArg().setValue( "-m" ); // Multissesion
        cl.createArg().setValue( "-q" ); // Quiet (return only CCM_ADDR)
        cl.createArg().setValue( "-n" );
        cl.createArg().setValue( username );
        cl.createArg().setValue( "-pw" );
        cl.createArg().setValue( password );
        if ( role != null )
        {
            cl.createArg().setValue( "-r" );
            cl.createArg().setValue( role.toString() );
        }

        return cl;
    }

    /**
     * Create commandline to start a  remote Synergy session
     *
     * @param username
     * @param password
     * @param role
     * @return
     * @throws ScmException
     */
    public static Commandline startRemote( String username, String password, SynergyRole role )
        throws ScmException
    {
        Commandline cl = new Commandline();

        cl.setExecutable( CCM );
        cl.createArg().setValue( START );
        cl.createArg().setValue( "-nogui" );
        cl.createArg().setValue( "-m" ); // Multissesion
        cl.createArg().setValue( "-q" ); // Quiet (return only CCM_ADDR)
        cl.createArg().setValue( "-rc" ); //Remote client
        cl.createArg().setValue( "-n" );
        cl.createArg().setValue( username );
        cl.createArg().setValue( "-pw" );
        cl.createArg().setValue( password );
        if ( role != null )
        {
            cl.createArg().setValue( "-r" );
            cl.createArg().setValue( role.toString() );
        }

        return cl;
    }
	
    /**
     * Create commandline to get Synergy database delimiter
     *
     * @return
     * @throws ScmException
     */
    public static Commandline delimiter( String ccmAddr )
        throws ScmException
    {
        Commandline cl = new Commandline();

        configureEnvironment( cl, ccmAddr );

        cl.setExecutable( CCM );
        cl.createArg().setValue( DELIMITER );

        return cl;
    }

}
././@LongLink0000000000000000000000000000020700000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyRole.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000267311050561465033576 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.util;

/*
 * 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.
 */

/**
 * This class contains the different Synergy roles available.
 *
 * @author Julien Henry
 * @version $Id: SynergyRole.java 685548 2008-08-13 13:35:49Z vsiveton $
 */
public class SynergyRole
{

    public static final SynergyRole BUILD_MGR = new SynergyRole( "build_mgr" );

    public static final SynergyRole CCM_ADMIN = new SynergyRole( "ccm_admin" );

    private String value;

    private SynergyRole( String value )
    {
        this.value = value;
    }

    /** {@inheritDoc} */
    public String toString()
    {
        return value;
    }

}
././@LongLink0000000000000000000000000000020700000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/util/SynergyTask.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000000446111050561465033573 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.util;

/*
 * 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.
 */

import java.util.Date;

/**
 * This class contains the different Synergy roles available.
 *
 * @author Julien Henry
 * @version $Id: SynergyTask.java 685548 2008-08-13 13:35:49Z vsiveton $
 */
public class SynergyTask
{

    private int number;

    private String username;

    private Date modifiedTime;

    private String comment;

    public SynergyTask()
    {
    }

    /**
     * @return the comment
     */
    public String getComment()
    {
        return comment;
    }

    /**
     * @param comment the comment to set
     */
    public void setComment( String comment )
    {
        this.comment = comment;
    }

    /**
     * @return the modifiedTime
     */
    public Date getModifiedTime()
    {
        return modifiedTime;
    }

    /**
     * @param modifiedTime the modifiedTime to set
     */
    public void setModifiedTime( Date modifiedTime )
    {
        this.modifiedTime = modifiedTime;
    }

    /**
     * @return the number
     */
    public int getNumber()
    {
        return number;
    }

    /**
     * @param number the number to set
     */
    public void setNumber( int number )
    {
        this.number = number;
    }

    /**
     * @return the username
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername( String username )
    {
        this.username = username;
    }

}
././@LongLink0000000000000000000000000000017500000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000755000175000017500000000000011345536671033574 5ustar  twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/repository/SynergyScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001106211316224524033563 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy.repository;

/*
 * 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.
 */

import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;

import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.StringTokenizer;

/**
 * @author Julien Henry
 * @version $Id: SynergyScmProviderRepository.java 894254 2009-12-28 21:55:32Z olamy $
 */
public class SynergyScmProviderRepository
    extends ScmProviderRepository
{

    private String projectSpec;

    private String projectName;

    private String projectVersion;

    private String projectRelease;

    private String projectPurpose;

    private String delimiter;
    
    private String instance;

    /**
     * @param url format is
     *            project_name|delimiter|project_version|Release|Purpose|instance
     */
    public SynergyScmProviderRepository( String url )
        throws ScmRepositoryException
    {
        try
        {
            parseUrl( url );
        }
        catch ( MalformedURLException e )
        {
            throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" );
        }
        catch ( URISyntaxException e )
        {
            throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" );
        }
        catch ( UnknownHostException e )
        {
            throw new ScmRepositoryException( "Illegal URL: " + url + "(" + e.getMessage() + ")" );
        }
    }

    private void parseUrl( String url )
        throws MalformedURLException, URISyntaxException, UnknownHostException
    {
        if ( url.indexOf( '|' ) != -1 )
        {
            StringTokenizer tokenizer = new StringTokenizer( url, "|" );
            fillInProperties( tokenizer );
        }
        else
        {
            StringTokenizer tokenizer = new StringTokenizer( url, ":" );
            fillInProperties( tokenizer );
        }
    }

    private void fillInProperties( StringTokenizer tokenizer )
        throws UnknownHostException, URISyntaxException, MalformedURLException
    {
        if ( tokenizer.countTokens() == 5 )
        {
            projectName = tokenizer.nextToken();
            delimiter = tokenizer.nextToken();
            projectVersion = tokenizer.nextToken();
            projectRelease = tokenizer.nextToken();
            projectPurpose = tokenizer.nextToken();
            instance = "1";

            projectSpec = projectName + delimiter + projectVersion + ":project:" + instance;

        }
        else if (tokenizer.countTokens() == 6 )
        {   //optional prep project instance also
            projectName = tokenizer.nextToken();
            delimiter = tokenizer.nextToken();
            projectVersion = tokenizer.nextToken();
            projectRelease = tokenizer.nextToken();
            projectPurpose = tokenizer.nextToken();
            instance = tokenizer.nextToken();

            projectSpec = projectName + delimiter + projectVersion + ":project:" + instance;
            
        }
        else
        {
            throw new MalformedURLException();
        }
    }

    public String getProjectSpec()
    {
        return projectSpec;
    }

    public String getProjectName()
    {
        return projectName;
    }

    public String getProjectVersion()
    {
        return projectVersion;
    }

    /**
     * @return the project_purpose
     */
    public String getProjectPurpose()
    {
        return projectPurpose;
    }

    /**
     * @return the project_release
     */
    public String getProjectRelease()
    {
        return projectRelease;
    }

    /**
     * @return the instance
     */
    public String getInstance() {
        return instance;
    }
    

}
././@LongLink0000000000000000000000000000021100000000000011557 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/provider/synergy/SynergyScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/src/main/java/org/apache/maven/scm/prov0000644000175000017500000001542511050561465033575 0ustar  twernertwernerpackage org.apache.maven.scm.provider.synergy;

/*
 * 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.
 */

import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.add.AddScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.command.edit.EditScmResult;
import org.apache.maven.scm.command.remove.RemoveScmResult;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.provider.AbstractScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.synergy.command.add.SynergyAddCommand;
import org.apache.maven.scm.provider.synergy.command.changelog.SynergyChangeLogCommand;
import org.apache.maven.scm.provider.synergy.command.checkin.SynergyCheckInCommand;
import org.apache.maven.scm.provider.synergy.command.checkout.SynergyCheckOutCommand;
import org.apache.maven.scm.provider.synergy.command.edit.SynergyEditCommand;
import org.apache.maven.scm.provider.synergy.command.remove.SynergyRemoveCommand;
import org.apache.maven.scm.provider.synergy.command.status.SynergyStatusCommand;
import org.apache.maven.scm.provider.synergy.command.tag.SynergyTagCommand;
import org.apache.maven.scm.provider.synergy.command.update.SynergyUpdateCommand;
import org.apache.maven.scm.provider.synergy.repository.SynergyScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;

/**
 * @author Julien Henry
 * @version $Id: SynergyScmProvider.java 685548 2008-08-13 13:35:49Z vsiveton $
 * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="synergy"
 */
public class SynergyScmProvider
    extends AbstractScmProvider
{

    /** {@inheritDoc} */
    public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter )
        throws ScmRepositoryException
    {
        return new SynergyScmProviderRepository( scmSpecificUrl );
    }

    /** {@inheritDoc} */
    public String getScmType()
    {
        return "synergy";
    }

    /** {@inheritDoc} */
    public boolean requiresEditMode()
    {
        return true;
    }

    /** {@inheritDoc} */
    public String getScmSpecificFilename()
    {
        return "_ccmwaid.inf";
    }

    /** {@inheritDoc} */
    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyAddCommand command = new SynergyAddCommand();

        command.setLogger( getLogger() );

        return (AddScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyRemoveCommand command = new SynergyRemoveCommand();

        command.setLogger( getLogger() );

        return (RemoveScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
                                         CommandParameters parameters )
        throws ScmException
    {
        SynergyChangeLogCommand command = new SynergyChangeLogCommand();

        command.setLogger( getLogger() );

        return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
                                     CommandParameters parameters )
        throws ScmException
    {
        SynergyCheckInCommand command = new SynergyCheckInCommand();

        command.setLogger( getLogger() );

        return (CheckInScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
                                       CommandParameters parameters )
        throws ScmException
    {
        SynergyCheckOutCommand command = new SynergyCheckOutCommand();

        command.setLogger( getLogger() );

        return (CheckOutScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyEditCommand command = new SynergyEditCommand();

        command.setLogger( getLogger() );

        return (EditScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyUpdateCommand command = new SynergyUpdateCommand();

        command.setLogger( getLogger() );

        return (UpdateScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyTagCommand command = new SynergyTagCommand();

        command.setLogger( getLogger() );

        return (TagScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        SynergyStatusCommand command = new SynergyStatusCommand();

        command.setLogger( getLogger() );

        return (StatusScmResult) command.execute( repository, fileSet, parameters );
    }

}
maven-scm-1.3/maven-scm-providers/maven-scm-provider-synergy/pom.xml0000644000175000017500000000346011322611461025633 0ustar  twernertwerner




  4.0.0

  
    org.apache.maven.scm
    maven-scm-providers
    1.3
  

  maven-scm-provider-synergy

  Maven SCM Synergy Provider
  SCM Provider implementation for Synergy (http://www.telelogic.com/corp/products/synergy/index.cfm).

  
    
      
        org.codehaus.plexus
        plexus-maven-plugin
        
          
            
              descriptor
            
          
        
      
    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/0000755000175000017500000000000011345536666024455 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/0000755000175000017500000000000011345536666025244 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/site/0000755000175000017500000000000011345536666026210 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/site/site.xml0000644000175000017500000000213011051127665027657 0ustar  twernertwerner




  
    

    
      
    

    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/0000755000175000017500000000000011345536666026223 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/0000755000175000017500000000000011345536666030235 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/0000755000175000017500000000000011345536666032055 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/status/0000755000175000017500000000000011345536666033400 5ustar  twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/status/status.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/status/sta0000644000175000017500000000664710263572701034113 0ustar  twernertwernerFolder: driver  (working dir: /usr/scm-starteam/driver)
History for: maven.xml
Description:
Locked by:
Status: Out of Date
----------------------------
Revision: 2 View: driver Branch Revision: 1.1
Author: build Date: 5/26/05 6:03:53 PM PDT
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:42:28 PM PDT
=============================================================================

History for: project.properties
Description:
Locked by:
Status: Merge
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:42:28 PM PDT
=============================================================================

History for: project.xml
Description:
Locked by:
Status: Current
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:42:28 PM PDT
=============================================================================

Folder: bootstrap  (working dir: /usr/scm-starteam/driver/bootstrap)
History for: maven.xml
Description:
Locked by:
Status: Current
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:41:22 PM PDT
=============================================================================

History for: project.properties
Description:
Locked by:
Status: Current
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:41:22 PM PDT
=============================================================================

History for: project.xml
Description:
Locked by:
Status: Current
----------------------------
Revision: 2 View: driver Branch Revision: 1.1
Author: build Date: 5/25/05 4:50:13 PM PDT
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:41:22 PM PDT
=============================================================================

Folder: xdocs  (working dir: /usr/scm-starteam/driver/bootstrap/xdocs)
History for: index.xml
Description:
Locked by:
Status: Missing
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/27/05 9:35:44 AM PDT
initial revision

=============================================================================

Folder: dev  (working dir: /usr/scm-starteam/driver/dev)
History for: maven.xml
Description:
Locked by:
Status: Current
----------------------------
Revision: 2 View: driver Branch Revision: 1.1
Author: build Date: 5/26/05 1:44:00 PM PDT
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:40:06 PM PDT
=============================================================================

History for: project.properties
Description:
Locked by:
Status: Modified
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:40:06 PM PDT
=============================================================================

History for: project.xml
Description:
Locked by:
Status: Current
----------------------------
Revision: 3 View: driver Branch Revision: 1.2
Author: build Date: 5/25/05 5:08:12 PM PDT
----------------------------
Revision: 2 View: driver Branch Revision: 1.1
Author: build Date: 5/25/05 4:53:18 PM PDT
----------------------------
Revision: 1 View: driver Branch Revision: 1.0
Author: build Date: 5/25/05 4:40:07 PM PDT
=============================================================================maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/diff/0000755000175000017500000000000011345536666032765 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/diff/diff.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/diff/diff.0000644000175000017500000000432110263572701033662 0ustar  twernertwernerFolder: driver  (working dir: C:\dev\scm-starteam\driver)
maven.xml Revision: 2 Date: 5/26/05 6:03:53 PM PDT
maven.xml (on disk)
-------------------------------------------------------------------------------
       1       1  |
       2       2  |
       3       3  |
       4       4  |
       9       9  |
-     10          |
-     11          |
-     12          |
      13      10  |
      14      11  |
-------------------------------------------------------------------------------

Folder: dev  (working dir: C:\dev\scm-starteam\driver\dev)
maven.xml Revision: 2 Date: 5/26/05 1:44:00 PM PDT
maven.xml (on disk)
-------------------------------------------------------------------------------
       1       1  |
+              7  |
-      7          |
       8       8  |
       9       9  |
      10      10  |
      11      11  |
-------------------------------------------------------------------------------

project.xml Revision: 3 Date: 5/25/05 5:08:12 PM PDT
project.xml (on disk)
-------------------------------------------------------------------------------
       1       1  |
       2       2  |
       3       3  |
+              4  |  ${basedir}/../common/project.xml
+              5  |  janeva-build-bootstrap-driver
+              6  |  Janeva Build Bootstrap Driver
-      4          |  ${basedir}/../project.xml
-      5          |  janeva-build-driver-dev
-      6          |  Janeva Build Driver Dev
       7       7  |
       8       8  |  
-      9          |
      10       9  |  
      11      10  |
      12      11  |
      13      12  |
-------------------------------------------------------------------------------

././@LongLink0000000000000000000000000000014500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/0000755000175000017500000000000011345536666034004 5ustar  twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/starteamlog_en.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/0000644000175000017500000000265010253304146033770 0ustar  twernertwernerFolder: maven  (working dir: C:\Test\maven)
Folder: src  (working dir: C:\Test\maven\src)
History for: File2.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
Add method print

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
=============================================================================

History for: File1.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
Add method main

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
=============================================================================

Folder: test  (working dir: C:\Test\maven\test)
History for: TestFile1.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
Add method main

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 4/21/04 1:05:00 PM PDT
=============================================================================

././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/starteamlog_fr.txtmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/resources/starteam/changelog/0000644000175000017500000000270610171236510033770 0ustar  twernertwernerFolder: maven  (working dir: C:\Test\maven)
Folder: src  (working dir: C:\Test\maven\src)
History for: File2.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 11/09/02 15:08:20 GMT+02:00
Add method print

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 11/09/02 15:06:55 GMT+02:00
=============================================================================

History for: File1.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 11/09/02 15:08:41 GMT+02:00
Add method main

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 11/09/02 15:06:55 GMT+02:00
=============================================================================

Folder: test  (working dir: C:\Test\maven\test)
History for: TestFile1.java
Description: First release
Locked by: 
Status: Current
----------------------------
Revision: 2 View: GRP_Dev Branch Revision: 1.1
Author: Emmanuel VENISSE Date: 11/09/02 15:08:42 GMT+02:00
Add method main

----------------------------
Revision: 1 View: GRP_Dev Branch Revision: 1.0
Author: Emmanuel VENISSE Date: 11/09/02 15:06:55 GMT+02:00
=============================================================================

maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/0000755000175000017500000000000011345536666027144 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/0000755000175000017500000000000011345536666027733 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/0000755000175000017500000000000011345536666031154 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/0000755000175000017500000000000011345536666032262 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536666033044 5ustar  twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001033011015073323033540 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTag;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamUpdateCommandTest
    extends ScmTestCase
{
    public void testGetCommandLineWithWorkingDirectory()
        throws Exception
    {

        ScmFileSet workingCopy = new ScmFileSet( this.getWorkingCopy() );

        String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workingCopy.getBasedir().getAbsolutePath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workDirAbsolutePath +
            " -is -merge -neverprompt -vl myTag -eol on";

        testCommandLine( mavenUrl, workingCopy, new ScmTag( "myTag" ), expectedCmd );

    }


    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {
        ScmFileSet workingCopy = new ScmFileSet( this.getWorkingCopy(), new File( "test.txt" ) );

        String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workingCopy.getBasedir().getAbsolutePath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workDirAbsolutePath +
            " -merge -neverprompt -vl myTag" + " -eol on test.txt";

        testCommandLine( mavenUrl, workingCopy, new ScmTag( "myTag" ), expectedCmd );
    }

    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {
        ScmFileSet workingCopy = new ScmFileSet( this.getWorkingCopy(), new File( "subdir/test.txt" ) );

        String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workingCopy.getBasedir().getAbsolutePath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + "/subdir" + " -fp " +
            workDirAbsolutePath + "/subdir" + " -merge -neverprompt -vl myTag" + " -eol on test.txt";

        testCommandLine( mavenUrl, workingCopy, new ScmTag( "myTag" ), expectedCmd );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileSet, ScmVersion version, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamUpdateCommand.createCommandLine( repository, fileSet, version );

        System.out.println( commandLine );

        System.out.println( cl );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000020500000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000542411015073323033550 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTag;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamCheckOutCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $
 */
public class StarteamCheckOutCommandTest
    extends ScmTestCase
{
    public void testGetCommandLine()
        throws Exception
    {
        ScmFileSet workingCopy = new ScmFileSet( this.getWorkingCopy() );

        String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workingCopy.getBasedir().getAbsolutePath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workDirAbsolutePath +
            " -is -vl myTag -eol on";

        testCommandLine( mavenUrl, workingCopy, new ScmTag( "myTag" ), expectedCmd );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet workingCopy, ScmVersion version, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamCheckOutCommand.createCommandLine( repository, workingCopy, version );

        assertCommandLine( commandLine, null, cl );
    }

}
././@LongLink0000000000000000000000000000024600000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000575510535556312033571 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author Dan T. Tran
 */
public class StarteamCheckOutConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: checked out", "project.properties: checked out", "project.xml: checked out",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)",
        "Folder: dev  (working dir: /usr/scm-starteam/driver/target/checkout/dev)", "maven.xml: checked out",
        "project.properties: checked out", "project.xml: checked out",
        "Folder: dev  (working dir: /usr/scm-starteam/driver)", "maven.xml: checked out",
        "project.properties: checked out", "project.xml: checked out"

    };

    private void testParse( File basedir )
        throws Exception
    {

        StarteamCheckOutConsumer consumer = new StarteamCheckOutConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getCheckedOutFiles();

        assertEquals( "Wrong number of entries returned", 9, entries.size() );

        ScmFile entry;

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            entry = (ScmFile) i.next();

            assertTrue( entry.getPath().startsWith( "./" ) );

            assertTrue( entry.getStatus() == ScmFileStatus.CHECKED_OUT );
        }

    }

    public void testParseWithNoRelativeWorkingDirectory()
        throws Exception
    {
        File basedir = new File( "/usr/scm-starteam/driver" );

        testParse( basedir );
    }

    public void testParseWithRelativeWorkingDirectory()
        throws Exception
    {
        File basedir = new File( "/usr/scm-starteam/junk/junk2/../../driver" );

        testParse( basedir );
    }

}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000505411015073323033547 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.status;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

/**
 * @author Dan T. Tran
 */
public class StarteamStatusConsumerTest
    extends ScmTestCase
{
    // must match with the test file    
    private static final String WORKING_DIR = "/usr/scm-starteam/driver";

    private File testFile;

    public void setUp()
        throws Exception
    {
        super.setUp();

        testFile = getTestFile( "/src/test/resources/starteam/status/status.txt" );
    }

    public void testParse()
        throws Exception
    {
        FileInputStream fis = new FileInputStream( testFile );

        BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );

        String s = in.readLine();

        StarteamStatusConsumer consumer = new StarteamStatusConsumer( new DefaultLog(), new File( WORKING_DIR ) );

        while ( s != null )
        {
            consumer.consumeLine( s );

            s = in.readLine();
        }

        Collection entries = consumer.getChangedFiles();

        assertEquals( "Wrong number of entries returned", 4, entries.size() );

        // TODO add more validation to the entries
    }
}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/unedit/StarteamUnEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000411410535556312033555 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.unedit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;

/**
 * @author Dan T. Tran
 */
public class StarteamUnEditConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver)",
        "maven.xml: unlocked", "Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: unlocked", "project.properties: unlocked", "project.xml: unlocked",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)", "maven.xml: unlocked",
        "project.properties: unlocked", "project.xml: unlocked"};

    public void testParse()
        throws Exception
    {

        File basedir = new File( "/usr/scm-starteam/driver" );

        StarteamUnEditConsumer consumer = new StarteamUnEditConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getUnEditFiles();

        assertEquals( "Wrong number of entries returned", 7, entries.size() );

    }

}
././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/unedit/StarteamUnEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000626411015073323033553 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.unedit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamUnEditCommandTest
    extends ScmTestCase
{

    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src/test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd lck -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy +
            "/src" + " -u test.txt";

        testCommandLine( mavenUrl, fileSet, expectedCmd );
    }


    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src/test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd lck -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy +
            "/src" + " -u test.txt";

        testCommandLine( mavenUrl, fileSet, expectedCmd );

    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileName, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamUnEditCommand.createCommandLine( repository, fileName );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000634711015073323033555 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.remove;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamRemoveCommandTest
    extends ScmTestCase
{

    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "testfile.txt" ) );

        String testFileDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd remove -x -nologo -stop" + " -p " + starteamUrl + " -fp " +
            testFileDirAbsolutePath + " testfile.txt";

        testCommandLine( mavenUrl, fileSet, "", expectedCmd );
    }

    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "dir/testfile.txt" ) );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String localDirectory = StarteamCommandLineUtils.toJavaPath( getWorkingDirectory().getPath() + "/dir" );
        String expectedCmd = "stcmd remove -x -nologo -stop" + " -p " + starteamUrl + "/dir" + " -fp " +
            localDirectory + " testfile.txt";

        testCommandLine( mavenUrl, fileSet, null, expectedCmd );

    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileSet, String crPath, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamRemoveCommand.createCommandLine( repository, fileSet );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000024200000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000471110535556312033560 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.remove;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author Dan T. Tran
 */
public class StarteamRemoveConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver)",
        "maven.xml: removed", "Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: removed", "project.properties: removed", "project.xml: removed",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)", "maven.xml: removed",
        "project.properties: removed", "project.xml: removed"};

    public void testParse()
        throws Exception
    {

        File basedir = new File( "/usr/scm-starteam/driver" );

        StarteamRemoveConsumer consumer = new StarteamRemoveConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getRemovedFiles();

        assertEquals( "Wrong number of entries returned", 7, entries.size() );

        ScmFile entry;

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            entry = (ScmFile) i.next();

            assertTrue( entry.getPath().startsWith( "./" ) );

            assertTrue( entry.getStatus() == ScmFileStatus.DELETED );
        }

    }
}
././@LongLink0000000000000000000000000000020000000000000011555 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000447311015073323033553 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.tag;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamTagCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $
 */
public class StarteamTagCommandTest
    extends ScmTestCase
{
    public void testTagCommandLine()
        throws Exception
    {

        File workDir = new File( "target" );

        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", workDir, "myTag",
                         "stcmd label -x -nologo -stop " + "-p myusername:mypassword@myhost:1234/projecturl " +
                             "-nl myTag -b" );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamTagCommand.createCommandLine( repository, workDir, tag );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000020400000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001275211015073323033552 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmRevision;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamCheckInCommandTest
    extends ScmTestCase
{

    public void testGetCommandLineWithWorkingDirectory()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd =
            "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -is -f NCI -eol on";

        testCommandLine( mavenUrl, fileSet, "", new ScmRevision( "" ), "", "", expectedCmd );

    }

    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd =
            "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -eol on test.txt";

        testCommandLine( mavenUrl, fileSet, "", new ScmRevision( "" ), "", "", expectedCmd );

    }

    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src/test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy +
            "/src" + " -eol on test.txt";

        testCommandLine( mavenUrl, fileSet, "", new ScmRevision( "" ), "", "", expectedCmd );

    }

    public void testGetCommandLineWithDirInWorkingDirectory()
        throws Exception
    {
        //physically create dir so that cmd can be generated correctly
        new File( getWorkingCopy(), "src" ).mkdirs();

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy +
            "/src" + " -is -f NCI -eol on";

        testCommandLine( mavenUrl, fileSet, "", new ScmRevision( "" ), "", "", expectedCmd );

    }

    public void testGetCommandLineWithEmptyIssueValue()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd =
            "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -active -eol on test.txt";

        testCommandLine( mavenUrl, fileSet, null, new ScmRevision( "" ), "active", " ", expectedCmd );
    }
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileSet, String message, ScmVersion version,
                                  String issueType, String issueValue, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl =
            StarteamCheckInCommand.createCommandLine( repository, fileSet, message, version, issueType, issueValue );

        assertCommandLine( commandLine, null, cl );
    }


}
././@LongLink0000000000000000000000000000024400000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000506210535556312033560 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author Dan T. Tran
 */
public class StarteamCheckInConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver)",
        "maven.xml: checked in", "Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: checked in", "project.properties: skipped", "project.xml: checked in",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)",
        "Folder: dev  (working dir: /usr/scm-starteam/driver/target/checkout/dev)", "maven.xml:skipped",
        "project.properties: skipped", "project.xml: checked in"};

    public void testParse()
        throws Exception
    {
        File basedir = new File( "/usr/scm-starteam/driver" );

        StarteamCheckInConsumer consumer = new StarteamCheckInConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getCheckedInFiles();

        assertEquals( "Wrong number of entries returned", 4, entries.size() );

        ScmFile entry;

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            entry = (ScmFile) i.next();

            assertTrue( entry.getPath().startsWith( "./" ) );

            assertTrue( entry.getStatus() == ScmFileStatus.CHECKED_OUT );
        }


    }
}
././@LongLink0000000000000000000000000000020100000000000011556 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/edit/StarteamEditCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000622711015073323033552 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.edit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamEditCommandTest
    extends ScmTestCase
{

    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd =
            "stcmd lck -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -l test.txt";

        testCommandLine( mavenUrl, fileSet, expectedCmd );
    }


    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src/test.txt" ) );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd lck -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy +
            "/src" + " -l test.txt";

        testCommandLine( mavenUrl, fileSet, expectedCmd );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileSet, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamEditCommand.createCommandLine( repository, fileSet );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/edit/StarteamEditConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000406610535556312033563 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.edit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;

/**
 * @author Dan T. Tran
 */
public class StarteamEditConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver)",
        "maven.xml: locked", "Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: locked", "project.properties: locked", "project.xml: locked",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)", "maven.xml: locked",
        "project.properties: locked", "project.xml: locked"};

    public void testParse()
        throws Exception
    {

        File basedir = new File( "/usr/scm-starteam/driver" );

        StarteamEditConsumer consumer = new StarteamEditConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getEditedFiles();

        assertEquals( "Wrong number of entries returned", 7, entries.size() );

    }

}
././@LongLink0000000000000000000000000000020100000000000011556 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000652111015073323033547 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.diff;

/*
 * 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.
 */

import org.apache.maven.scm.ScmBranch;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

/**
 * @author Dan T. Tran
 */
public class StarteamDiffCommandTest
    extends ScmTestCase
{

    public void testGetCommandLine()
        throws Exception
    {

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd =
            "stcmd diff -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -is -filter M -eol on";

        testCommandLine( mavenUrl, fileSet, null, null, expectedCmd );

    }


    public void testGetCommandLineWithLabels()
        throws Exception
    {

        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd diff -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy +
            " -is -filter M" + " -vl label1 -vl label2 -eol on";

        testCommandLine( mavenUrl, fileSet, new ScmBranch( "label1" ), new ScmBranch( "label2" ), expectedCmd );

    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet basedir, ScmVersion startLabel, ScmVersion endLabel,
                                  String commandLine )
        throws Exception
    {

        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamDiffCommand.createCommandLine( repository, basedir, startLabel, endLabel );

        assertCommandLine( commandLine, null, cl );
    }

}
././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000404110535556312033554 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.diff;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Collection;

/**
 * @author Dan T. Tran
 */
public class StarteamDiffConsumerTest
    extends ScmTestCase
{
    private File testFile;

    public void setUp()
        throws Exception
    {
        super.setUp();

        testFile = getTestFile( "/src/test/resources/starteam/diff/diff.txt" );
    }

    public void testParse()
        throws Exception
    {
        FileInputStream fis = new FileInputStream( testFile );

        BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );

        String s = in.readLine();

        File basedir = new File( getBasedir() );

        StarteamDiffConsumer consumer = new StarteamDiffConsumer( new DefaultLog(), basedir );

        while ( s != null )
        {
            consumer.consumeLine( s );

            s = in.readLine();
        }

        Collection entries = consumer.getChangedFiles();

        assertEquals( "Wrong number of entries returned", 3, entries.size() );
    }
}
././@LongLink0000000000000000000000000000020600000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024700000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000526111015073323033547 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;


/**
 * @author Emmanuel Venisse
 * @author Dan T. Tran
 * @version $Id: StarteamChangeLogCommandTest.java 658820 2008-05-21 19:24:03Z evenisse $
 */
public class StarteamChangeLogCommandTest
    extends ScmTestCase
{
    public void testGetCommandLine()
        throws Exception
    {
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );

        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath() );

        String starteamUrl = "user:password@host:1234/project/view";
        String mavenUrl = "scm:starteam:" + starteamUrl;

        String expectedCmd = "stcmd hist -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -is";

        testCommandLine( mavenUrl, fileSet, expectedCmd );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet workingCopy, String commandLine )
        throws Exception
    {
        ScmRepository repository = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository svnRepository =
            (StarteamScmProviderRepository) repository.getProviderRepository();

        Commandline cl = StarteamChangeLogCommand.createCommandLine( svnRepository, workingCopy, null );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000025000000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001022211057352205033545 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.ChangeSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamChangeLogConsumerTest.java 691441 2008-09-03 00:04:21Z vsiveton $
 */
public class StarteamChangeLogConsumerTest
    extends ScmTestCase
{
    private File testFile;

    public void setUp()
        throws Exception
    {
        super.setUp();

        String language = Locale.getDefault().getLanguage();

        testFile = getTestFile( "/src/test/resources/starteam/changelog/starteamlog_" + language + ".txt" );

        if ( !testFile.exists() )
        {
            testFile = getTestFile( "/src/test/resources/starteam/changelog/starteamlog_en.txt" );
        }
    }

    private List parseTestFile()
        throws Exception
    {
        /* must match the working directory in the text test file */

        File basedir = new File( "C:/Test" );

        FileInputStream fis = new FileInputStream( testFile );

        BufferedReader in = new BufferedReader( new InputStreamReader( fis ) );

        String s = in.readLine();

        StarteamChangeLogConsumer consumer =
            new StarteamChangeLogConsumer( basedir, new DefaultLog(), null, null, null );

        while ( s != null )
        {
            consumer.consumeLine( s );

            s = in.readLine();
        }

        return consumer.getModifications();
    }

    public void testNumberOfModifications()
        throws Exception
    {
        List entries = parseTestFile();

        assertEquals( "Wrong number of entries returned", 6, entries.size() );

        ChangeSet entry = null;

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            entry = (ChangeSet) i.next();

            assertTrue( "ChangeLogEntry erroneously picked up",
                        entry.toString().indexOf( "ChangeLogEntry.java" ) == -1 );
        }
    }

    public void testRelativeFilePath()
        throws Exception
    {
        List entries = parseTestFile();

        // ensure the filename in the first ChangeSet has correct relative path
        ChangeSet entry = (ChangeSet) entries.get( 1 );

        assertTrue( entry.containsFilename( "./maven/src/File2.java", null ) );
    }

    public void testLocales()
        throws Exception
    {
        Locale currentLocale = Locale.getDefault();

        Locale[] availableLocales = Locale.getAvailableLocales();
        try
        {
            for ( int i = 0; i < availableLocales.length; i++ )
            {
                Locale.setDefault( availableLocales[i] );

                String language = availableLocales[i].getLanguage();

                testFile = getTestFile( "/src/test/resources/starteam/changelog/starteamlog_" + language + ".txt" );

                if ( !testFile.exists() )
                {
                    testFile = getTestFile( "/src/test/resources/starteam/changelog/starteamlog_en.txt" );
                }

                parseTestFile();
            }
        }
        finally
        {
            Locale.setDefault( currentLocale );
        }
    }
}
././@LongLink0000000000000000000000000000020000000000000011555 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommandTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001012311015073323033540 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.add;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamAddCommandTest
    extends ScmTestCase
{

    public void testGetCommandLineWithFileOnRoot()
        throws Exception
    {

        File testFile = new File( "testfile" );

        File testFileDir = testFile.getAbsoluteFile().getParentFile();

        String testFileDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( testFileDir.getAbsolutePath() );

        String expectedCmd = "stcmd add -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl" + " -fp " +
            testFileDirAbsolutePath + " -eol on testfile";

        ScmFileSet fileSet = new ScmFileSet( testFileDir, testFile );
        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet, "", expectedCmd );
    }

    public void testGetCommandLineWithCR()
        throws Exception
    {
        File testFile = new File( "testfile" );

        File testFileDir = testFile.getAbsoluteFile().getParentFile();

        String testFileDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( testFileDir.getAbsolutePath() );

        String expectedCmd = "stcmd add -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl" + " -fp " +
            testFileDirAbsolutePath + " -cr view_root/dummycr" + " -eol on testfile";

        ScmFileSet fileSet = new ScmFileSet( testFileDir, testFile );
        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet, "view_root/dummycr",
                         expectedCmd );

    }

    public void testGetCommandLineWithFileInSubDir()
        throws Exception
    {

        File testFile = new File( "target/testfile" );

        File testFileDir = testFile.getAbsoluteFile().getParentFile();

        String testFileDirAbsolutePath =
            StarteamCommandLineUtils.toJavaPath( testFileDir.getAbsolutePath() ) + "/target";

        String expectedCmd = "stcmd add -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl/target" +
            " -fp " + testFileDirAbsolutePath + " -eol on testfile";

        ScmFileSet fileSet = new ScmFileSet( testFileDir, testFile );
        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet, null, expectedCmd );

    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testCommandLine( String scmUrl, ScmFileSet fileSet, String crPath, String commandLine )
        throws Exception
    {
        ScmRepository repo = getScmManager().makeScmRepository( scmUrl );

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();

        Commandline cl = StarteamAddCommand.createCommandLine( repository, fileSet, crPath );

        assertCommandLine( commandLine, null, cl );
    }
}
././@LongLink0000000000000000000000000000023400000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumerTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000465510535556312033567 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.add;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.log.DefaultLog;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;

/**
 * @author Dan T. Tran
 */
public class StarteamAddConsumerTest
    extends ScmTestCase
{
    private static String[] TEST_OUTPUT = {"Folder: driver  (working dir: /usr/scm-starteam/driver)",
        "maven.xml: added", "Folder: driver  (working dir: /usr/scm-starteam/driver/target/checkout)",
        "maven.xml: added", "project.properties: added", "project.xml: added",
        "Folder: bootstrap  (working dir: /usr/scm-starteam/driver/target/checkout/bootstrap)", "maven.xml: added",
        "project.properties: added", "project.xml: added"};

    public void testParse()
        throws Exception
    {

        File basedir = new File( "/usr/scm-starteam/driver" );

        StarteamAddConsumer consumer = new StarteamAddConsumer( new DefaultLog(), basedir );

        for ( int i = 0; i < TEST_OUTPUT.length; ++i )
        {
            consumer.consumeLine( TEST_OUTPUT[i] );
        }

        Collection entries = consumer.getAddedFiles();

        assertEquals( "Wrong number of entries returned", 7, entries.size() );

        ScmFile entry;

        for ( Iterator i = entries.iterator(); i.hasNext(); )
        {
            entry = (ScmFile) i.next();

            assertTrue( entry.getPath().startsWith( "./" ) );

            assertTrue( entry.getStatus() == ScmFileStatus.ADDED );
        }


    }

}
././@LongLink0000000000000000000000000000022000000000000011557 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/StarteamScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000000661710535556312033567 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;

import java.io.File;

/**
 * @author Dan T. Tran
 */
public class StarteamScmProviderTest
    extends ScmTestCase
{

    public void testGoodGetRelativeFile()
        throws Exception
    {
        File basedir = new File( getBasedir() );

        File testDir = new File( basedir.getPath() + "/target/../target/testdir" );

        testDir.mkdirs();

        File testFile = new File( testDir, "testfile.txt" );

        testFile.createNewFile();

        String relativePath = StarteamScmProvider.getRelativePath( basedir, testFile );

        assertEquals( "target/testdir/testfile.txt", relativePath.replace( '\\', '/' ) );

    }

    public void testBadGetRelativeFile()
        throws Exception
    {
        File basedir = new File( getBasedir() );

        File testDir1 = new File( basedir.getPath() + "/target/testdir1" );
        testDir1.mkdirs();

        File testDir2 = new File( basedir.getPath() + "/target/testdir2" );
        testDir2.mkdirs();

        File testFile = new File( testDir1, "testfile.txt" );

        testFile.createNewFile();

        try
        {
            StarteamScmProvider.getRelativePath( testDir2, testFile );
            fail( "Bad relative path found!" );
        }
        catch ( ScmException e )
        {

        }

    }

    /**
     * To specify multiple views url, we must use '|'( pipe ) as separator,
     * must separate host and port using |
     *
     * @throws Exception
     */
    public void testMultipleViewsUrl()
        throws Exception
    {
        String scmSpecificUrl = "user:password@host|1234|/project/rootview:subview/folder";
        //String scmSpecificUrl = "user:password@host|1234/project/rootview:subview/folder"; //should work as well
        StarteamScmProvider provider = new StarteamScmProvider();
        StarteamScmProviderRepository starteamProvider =
            (StarteamScmProviderRepository) provider.makeProviderScmRepository( scmSpecificUrl, '|' );
        assertEquals( "user", starteamProvider.getUser() );
        assertEquals( "password", starteamProvider.getPassword() );
        assertEquals( 1234, starteamProvider.getPort() );
        assertEquals( "host", starteamProvider.getHost() );
        assertEquals( "/project/rootview:subview/folder", starteamProvider.getPath() );
        assertEquals( "user:password@host:1234/project/rootview:subview/folder", starteamProvider.getFullUrl() );
    }

}
././@LongLink0000000000000000000000000000017700000000000011572 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033565 5ustar  twernertwerner././@LongLink0000000000000000000000000000024500000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/repository/StarteamScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/pro0000644000175000017500000001040410535556312033554 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.repository;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;

/**
 * @author Emmanuel Venisse
 * @author Trygve Laugstøl
 * @version $Id: StarteamScmProviderRepositoryTest.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class StarteamScmProviderRepositoryTest
    extends ScmTestCase
{
    public void testParseConnection()
        throws Exception
    {
        testUrl( "scm:starteam:myhost:1234/projecturl", null, null, "myhost", 1234, "/projecturl" );
    }

    public void testParseConnectionWithUsername()
        throws Exception
    {
        testUrl( "scm:starteam:myusername@myhost:1234/projecturl", "myusername", null, "myhost", 1234, "/projecturl" );
    }

    public void testParseConnectionWithUsernameAndPassword()
        throws Exception
    {
        testUrl( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", "myusername", "mypassword", "myhost",
                 1234, "/projecturl" );
    }

    public void testParseConnection2()
        throws Exception
    {
        testUrl( "scm:starteam:myhost:1234:/projecturl", null, null, "myhost", 1234, "/projecturl" );
    }

    public void testParseConnectionWithUsername2()
        throws Exception
    {
        testUrl( "scm:starteam:myusername@myhost:1234:/projecturl", "myusername", null, "myhost", 1234, "/projecturl" );
    }

    public void testParseConnectionWithUsernameAndPassword2()
        throws Exception
    {
        testUrl( "scm:starteam:myusername:mypassword@myhost:1234:/projecturl", "myusername", "mypassword", "myhost",
                 1234, "/projecturl" );
    }

    public void testInvalidConnection()
        throws Exception
    {
        testIllegalUrl( "scm:starteam:invalidConnectionString" );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    private void testUrl( String url, String expectedUser, String expectedPassword, String expectedHost,
                          int expectedPort, String expectedPath )
        throws Exception
    {
        ScmRepository repository = getScmManager().makeScmRepository( url );

        assertNotNull( "ScmManager.makeScmRepository() returned null", repository );

        assertNotNull( "The provider repository was null.", repository.getProviderRepository() );

        assertTrue( "The SCM Repository isn't a " + StarteamScmProviderRepository.class.getName() + ".", repository
            .getProviderRepository() instanceof StarteamScmProviderRepository );

        StarteamScmProviderRepository repo = (StarteamScmProviderRepository) repository.getProviderRepository();

        assertEquals( expectedUser, repo.getUser() );

        assertEquals( expectedPassword, repo.getPassword() );

        assertEquals( expectedHost, repo.getHost() );

        assertEquals( expectedPort, repo.getPort() );

        assertEquals( expectedPath, repo.getPath() );
    }

    private void testIllegalUrl( String url )
        throws Exception
    {
        try
        {
            getScmManager().makeScmRepository( url );

            fail( "Expected a ScmRepositoryException while testing the url '" + url + "'." );
        }
        catch ( ScmRepositoryException e )
        {
            // expected
        }
    }
}
maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/0000755000175000017500000000000011345536666026170 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/0000755000175000017500000000000011345536666026747 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo0000644000175000017500000000421211315117331033102 0ustar  twernertwerner




  starteam
  Starteam
  Starteam Provider Model.
  
    
      package
      org.apache.maven.scm.providers.starteam.settings
    
  

  
    
      Settings
      1.0.0+
      
        
          compressionEnable
          1.0.0+
          boolean
          false
          Enable compression in all stdcmd
        
        
          eol
          1.0.0+
          String
          on
          EOL setting in all applicable stdcmd
        
      
    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/0000755000175000017500000000000011345536666027111 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/0000755000175000017500000000000011345536666027700 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/0000755000175000017500000000000011345536666031121 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/0000755000175000017500000000000011345536666032227 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536666033011 5ustar  twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000214410535556312033523 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command;

/*
 * 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.
 */

import org.apache.maven.scm.command.Command;

/**
 * @author Trygve Laugstøl
 * @version $Id: StarteamCommand.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public interface StarteamCommand
    extends Command
{
}
././@LongLink0000000000000000000000000000023100000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000002020311057621704033515 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.provider.starteam.util.StarteamUtil;
import org.apache.maven.scm.providers.starteam.settings.Settings;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * Command line construction utility.
 *
 * @author Dan T. Tran
 * @version $Id: StarteamCommandLineUtils.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamCommandLineUtils
{
    private static Settings settings = StarteamUtil.getSettings();

    public static Commandline createStarteamBaseCommandLine( String action, StarteamScmProviderRepository repo )
    {
        Commandline cl = new Commandline();

        cl.createArg().setValue( "stcmd" );

        cl.createArg().setValue( action );

        cl.createArg().setValue( "-x" );

        cl.createArg().setValue( "-nologo" );

        cl.createArg().setValue( "-stop" );

        return cl;
    }

    private static Commandline addCommandlineArguments( Commandline cl, List args )
    {
        for ( int i = 0; args != null && i < args.size(); ++i )
        {
            cl.createArg().setValue( (String) args.get( i ) );
        }
        return cl;
    }

    public static Commandline createStarteamCommandLine( String action, List args, ScmFileSet scmFileSet,
                                                         StarteamScmProviderRepository repo )
    {
        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( action, repo );

        // case 1: scmFileSet has only basedir
        if ( scmFileSet.getFileList().size() == 0 )
        {
            //perform an action on directory
            cl.createArg().setValue( "-p" );
            cl.createArg().setValue( repo.getFullUrl() );
            cl.createArg().setValue( "-fp" );
            cl.createArg().setValue( scmFileSet.getBasedir().getAbsolutePath().replace( '\\', '/' ) );

            cl.createArg().setValue( "-is" );

            addCompressionOption( cl );

            addCommandlineArguments( cl, args );

            return cl;
        }

        //case 2 scmFileSet has a sub file, but we dont know if the sub file is a directory or a file
        File fileInFileSet = (File) scmFileSet.getFileList().get( 0 );
        File subFile = new File( scmFileSet.getBasedir(), fileInFileSet.getPath() );

        //Perform an scm action on a single file where the orignal
        // url and local directory ( -p and -fp options ) are altered
        // to deal with single file/subdirectory

        File workingDirectory = subFile;
        String scmUrl = repo.getFullUrl() + "/" + fileInFileSet.getPath().replace( '\\', '/' );
        if ( !subFile.isDirectory() )
        {
            workingDirectory = subFile.getParentFile();
            if ( fileInFileSet.getParent() != null )
            {
                scmUrl = repo.getFullUrl() + "/" + fileInFileSet.getParent().replace( '\\', '/' );
            }
            else
            {
                //subFile is right under root
                scmUrl = repo.getFullUrl();
            }
        }

        cl.createArg().setValue( "-p" );
        cl.createArg().setValue( scmUrl );

        cl.createArg().setValue( "-fp" );
        cl.createArg().setValue( workingDirectory.getPath().replace( '\\', '/' ) );

        cl.setWorkingDirectory( workingDirectory.getPath() );

        if ( subFile.isDirectory() )
        {
            cl.createArg().setValue( "-is" );
        }

        StarteamCommandLineUtils.addCompressionOption( cl );

        addCommandlineArguments( cl, args );

        if ( !subFile.isDirectory() )
        {
            cl.createArg().setValue( subFile.getName() );
        }

        return cl;
    }

    public static void addCompressionOption( Commandline cl )
    {
        if ( settings.isCompressionEnable() )
        {
            cl.createArg().setValue( "-cmp" );
        }
    }

    public static void addEOLOption( List args )
    {
        if ( settings.getEol() != null  )
        {
            args.add( "-eol" );
            args.add( settings.getEol() );
        }
    }

    public static String toJavaPath( String path )
    {
        return path.replace( '\\', '/' );
    }

    /**
     * Hellper method to display command line without password
     *
     * @param cl
     * @return String
     * @throws ScmException
     */
    public static String displayCommandlineWithoutPassword( Commandline cl )
        throws ScmException
    {
        String retStr = "";

        String fullStr = cl.toString();

        //look for -p and take out the password arugment

        int usernamePos = fullStr.indexOf( "-p " ) + 3;

        if ( usernamePos == 2 )
        {
            //should never get here since all starteam command lines
            // have -p argument

            throw new ScmException( "Invalid command line" );
        }

        retStr = fullStr.substring( 0, usernamePos );

        int passwordStartPos = fullStr.indexOf( ":" );

        if ( passwordStartPos == -1 )
        {
            throw new ScmException( "Invalid command line" );
        }

        int passwordEndPos = fullStr.indexOf( "@" );

        if ( passwordEndPos == -1 )
        {
            throw new ScmException( "Invalid command line" );
        }

        retStr += fullStr.substring( usernamePos, passwordStartPos );

        retStr += fullStr.substring( passwordEndPos );

        return retStr;

    }

    public static int executeCommandline( Commandline cl, StreamConsumer consumer,
                                          CommandLineUtils.StringStreamConsumer stderr, ScmLogger logger )
        throws ScmException
    {
        if ( logger.isInfoEnabled() )
        {
            logger.info( "Command line: " + displayCommandlineWithoutPassword( cl ) );
        }

        try
        {
            return CommandLineUtils.executeCommandLine( cl, consumer, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }
    }

    /**
     * Given 2 paths, make sure parent and child are on the same tree
     * return the port of child that not in parent
     *
     * @param parent
     * @param child
     * @return
     */
    public static String getRelativeChildDirectory( String parent, String child )
    {
        //expect parentDir contains childDir
        try
        {
            String childPath = new File( child ).getCanonicalFile().getPath().replace( '\\', '/' );

            String parentPath = new File( parent ).getCanonicalFile().getPath().replace( '\\', '/' );

            if ( !childPath.startsWith( parentPath ) )
            {
                throw new IllegalStateException();
            }

            String retDir = "." + childPath.substring( parentPath.length() );

            return retDir;

        }
        catch ( IOException e )
        {
            throw new IllegalStateException(
                "Unable to convert to canonical path of either " + parent + " or " + child );
        }
    }

}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001613111057610744033524 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.changelog.ChangeLogCommand;
import org.apache.maven.scm.command.update.AbstractUpdateCommand;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.command.changelog.StarteamChangeLogCommand;
import org.apache.maven.scm.provider.starteam.command.checkout.StarteamCheckOutConsumer;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.DefaultConsumer;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamUpdateCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamUpdateCommand
    extends AbstractUpdateCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractUpdateCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamCheckOutConsumer consumer = new StarteamCheckOutConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        List updateFiles = fileSet.getFileList();

        if ( updateFiles.size() == 0 )
        {
            //update everything
            Commandline cl = createCommandLine( repository, fileSet, version );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new UpdateScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
            else
            {
                //hiden feature to allow Continuous Integration machine to
                // delete local files. It affectively remove all build ouput as well
                String doDeleteLocal = System.getProperty( "maven.scm.starteam.deleteLocal" );

                if ( "true".equalsIgnoreCase( doDeleteLocal ) )
                {
                    this.deleteLocal( repository, fileSet, version );
                }
            }
        }
        else
        {
            //update only interested files already on the local disk
            for ( int i = 0; i < updateFiles.size(); ++i )
            {
                File updateFile = (File) updateFiles.get( i );
                ScmFileSet scmFileSet = new ScmFileSet( fileSet.getBasedir(), updateFile );
                Commandline cl = createCommandLine( repository, scmFileSet, version );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

                if ( exitCode != 0 )
                {
                    return new UpdateScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(),
                                                false );
                }
            }
        }

        return new UpdateScmResult( null, consumer.getCheckedOutFiles() );

    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet fileSet,
                                                 ScmVersion version )
    {
        List args = new ArrayList();

        args.add( "-merge" );
        args.add( "-neverprompt" );

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            args.add( "-vl" );
            args.add( version.getName() );
        }

        StarteamCommandLineUtils.addEOLOption( args );

        return StarteamCommandLineUtils.createStarteamCommandLine( "co", args, fileSet, repo );
    }

    /** {@inheritDoc} */
    protected ChangeLogCommand getChangeLogCommand()
    {
        StarteamChangeLogCommand command = new StarteamChangeLogCommand();

        command.setLogger( getLogger() );

        return command;
    }

    private void deleteLocal( StarteamScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version )
        throws ScmException
    {
        if ( fileSet.getFileList().size() != 0 )
        {
            return;
        }

        Commandline cl = createDeleteLocalCommand( repo, fileSet, version );

        StreamConsumer consumer = new DefaultConsumer();

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            throw new ScmException( "Error executing delete-local: " + stderr.toString() );
        }
    }

    public static Commandline createDeleteLocalCommand( StarteamScmProviderRepository repo, ScmFileSet dir,
                                                        ScmVersion version )
    {
        List args = new ArrayList();

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            args.add( "-cfgl" );
            args.add( version.getName() );
        }

        args.add( "-filter" );
        args.add( "N" );

        return StarteamCommandLineUtils.createStarteamCommandLine( "delete-local", args, dir, repo );
    }

}
././@LongLink0000000000000000000000000000020500000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001017511057610744033526 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Emmanuel Venisse
 * @author Dan T. Tran
 * @version $Id: StarteamCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamCheckOutCommand
    extends AbstractCheckOutCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractCheckOutCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                        ScmVersion version, boolean recursive )
        throws ScmException
    {
        if ( fileSet.getFileList().size() != 0 )
        {
            throw new ScmException( "This provider doesn't support checking out subsets of a directory" );
        }

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamCheckOutConsumer consumer = new StarteamCheckOutConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        Commandline cl = createCommandLine( repository, fileSet, version );

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            return new CheckOutScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
        }

        return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles() );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet baseDir,
                                                 ScmVersion version )
    {
        List args = new ArrayList();

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            args.add( "-vl" );
            args.add( version.getName() );
        }

        StarteamCommandLineUtils.addEOLOption( args );

        return StarteamCommandLineUtils.createStarteamCommandLine( "co", args, baseDir, repo );
    }
}
././@LongLink0000000000000000000000000000024200000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001067011057621704033524 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamCheckOutConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamCheckOutConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private String workingDirectory;

    private String currentDir = "";

    private List files = new ArrayList();

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String CHECKOUT_MARKER = ": checked out";

    /**
     * Marks skipped file during update
     */
    private static final String SKIPPED_MARKER = ": skipped";

    public StarteamCheckOutConsumer( ScmLogger logger, File workingDirectory )
    {
        this.logger = logger;

        this.workingDirectory = workingDirectory.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( CHECKOUT_MARKER ) ) != -1 )
        {
            processCheckedOutFile( line, pos );
        }
        else if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( CHECKOUT_MARKER ) ) != -1 )
        {
            processCheckedOutFile( line, pos );
        }
        else if ( ( pos = line.indexOf( SKIPPED_MARKER ) ) != -1 )
        {
            processSkippedFile( line, pos );
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unknown checkout ouput: " + line );
            }
        }
    }

    public List getCheckedOutFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        try
        {
            this.currentDir = StarteamCommandLineUtils.getRelativeChildDirectory( this.workingDirectory, dirPath );
        }
        catch ( IllegalStateException e )
        {
            String error = "Working and checkout directories are not on the same tree";

            if ( logger.isErrorEnabled() )
            {
                logger.error( error );
                logger.error( "Working directory: " + workingDirectory );
                logger.error( "Checked out directory: " + dirPath );
            }

            throw new IllegalStateException( error );
        }

    }

    private void processCheckedOutFile( String line, int pos )
    {
        String checkedOutFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( checkedOutFilePath, ScmFileStatus.CHECKED_OUT ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Checked out: " + checkedOutFilePath );
        }
    }

    private void processSkippedFile( String line, int pos )
    {
        String skippedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        if ( logger.isDebugEnabled() )
        {
            logger.debug( "Skipped: " + skippedFilePath );
        }
    }

}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000676211057610744033535 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.status;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.status.AbstractStatusCommand;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamStatusCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamStatusCommand
    extends AbstractStatusCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractStatusCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        if ( fileSet.getFileList().size() != 0 )
        {
            throw new ScmException( "This provider doesn't support checking status of a subsets of a directory" );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamStatusConsumer consumer = new StarteamStatusConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        Commandline cl = createCommandLine( repository, fileSet );

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            return new StatusScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
        }

        return new StatusScmResult( cl.toString(), consumer.getChangedFiles() );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet workingDirectory )
    {
        return StarteamCommandLineUtils.createStarteamCommandLine( "hist", null, workingDirectory, repo );
    }
}
././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001224511057621704033524 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.status;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamStatusConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamStatusConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private String workingDirectory;

    private List changedFiles = new ArrayList();

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String FILE_MARKER = "History for: ";

    /**
     * Marks current file status
     */
    private static final String STATUS_MARKER = "Status: ";

    /**
     * Marks current file status
     */
    private static final String OUTDATE_MARKER = "Out of Date";

    private static final String MISSING_MARKER = "Missing";

    private static final String CURRENT_MARKER = "Current";

    private static final String MERGE_MARKER = "Merge";

    private static final String MODIFIED_MARKER = "Modified";

    private String currentDir = "";

    private String currentFile = "";

    public StarteamStatusConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;

        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processGetDir( line, pos );
        }
        else if ( ( pos = line.indexOf( FILE_MARKER ) ) != -1 )
        {
            processGetFile( line, pos );
        }
        else if ( ( pos = line.indexOf( STATUS_MARKER ) ) != -1 )
        {
            processStatus( line, pos );
        }
        else
        {
            //do nothing
        }
    }

    private void processGetDir( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        this.currentDir = "." + dirPath.substring( workingDirectory.length() );
    }

    private void processGetFile( String line, int pos )
    {
        String fileName = line.substring( pos + FILE_MARKER.length(), line.length() );

        String checkedOutFilePath = this.currentDir + "/" + fileName;

        this.currentFile = checkedOutFilePath;
    }

    private void processStatus( String line, int pos )
    {
        String status = line.substring( pos + STATUS_MARKER.length(), line.length() );

        if ( status.equals( OUTDATE_MARKER ) )
        {
            changedFiles.add( new ScmFile( this.currentFile, ScmFileStatus.MODIFIED ) );

            if ( logger.isInfoEnabled() )
            {
                logger.info( "Out of Date file: " + this.currentFile );
            }
        }
        else if ( status.equals( MODIFIED_MARKER ) )
        {
            changedFiles.add( new ScmFile( this.currentFile, ScmFileStatus.MODIFIED ) );

            if ( logger.isInfoEnabled() )
            {
                logger.info( "Modified file: " + this.currentFile );
            }
        }
        else if ( status.equals( MISSING_MARKER ) )
        {
            changedFiles.add( new ScmFile( this.currentFile, ScmFileStatus.ADDED ) );

            if ( logger.isInfoEnabled() )
            {
                logger.info( "Missing file: " + this.currentFile );
            }
        }
        else if ( status.equals( MERGE_MARKER ) )
        {
            changedFiles.add( new ScmFile( this.currentFile, ScmFileStatus.CONFLICT ) );

            if ( logger.isInfoEnabled() )
            {
                logger.info( "Conflict file: " + this.currentFile );
            }
        }
        else if ( status.equals( CURRENT_MARKER ) )
        {
            //ignore
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "status unknown (" + status + "): " + this.currentFile );
            }
        }
    }

    public List getChangedFiles()
    {
        return changedFiles;
    }

}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/unedit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/unedit/StarteamUnEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000714011057621704033522 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.unedit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamUnEditConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamUnEditConsumer
    implements StreamConsumer
{
    private String workingDirectory;

    private ScmLogger logger;

    private List files = new ArrayList();

    /**
     * the current directory entry being processed by the parser
     */
    private String currentDir = "";

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String UNLOCKED_MARKER = ": unlocked";


    public StarteamUnEditConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;
        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( UNLOCKED_MARKER ) ) != -1 )
        {
            processUnLockedFile( line, pos );
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unknown unedit ouput: " + line );
            }
        }
    }

    public List getUnEditFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        if ( !dirPath.startsWith( workingDirectory ) )
        {
            if ( logger.isInfoEnabled() )
            {
                logger.info( "Working directory: " + workingDirectory );
                logger.info( "unedit directory: " + dirPath );
            }

            throw new IllegalStateException( "Working and unedit directories are not on the same tree" );
        }

        this.currentDir = "." + dirPath.substring( workingDirectory.length() );
    }

    private void processUnLockedFile( String line, int pos )
    {
        String lockedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( lockedFilePath, ScmFileStatus.UNKNOWN ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Unlocked: " + lockedFilePath );
        }
    }


}
././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/unedit/StarteamUnEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001021111057610744033515 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.unedit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.unedit.AbstractUnEditCommand;
import org.apache.maven.scm.command.unedit.UnEditScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamUnEditCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamUnEditCommand
    extends AbstractUnEditCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractEditCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected ScmResult executeUnEditCommand( ScmProviderRepository repo, ScmFileSet fileSet )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamUnEditConsumer consumer = new StarteamUnEditConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        List unlockFiles = fileSet.getFileList();

        if ( unlockFiles.size() == 0 )
        {
            Commandline cl = createCommandLine( repository, fileSet );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new UnEditScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
        }
        else
        {
            //edit only interested files already on the local disk
            for ( int i = 0; i < unlockFiles.size(); ++i )
            {
                ScmFileSet unlockFile = new ScmFileSet( fileSet.getBasedir(), (File) unlockFiles.get( i ) );
                Commandline cl = createCommandLine( repository, unlockFile );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

                if ( exitCode != 0 )
                {
                    return new UnEditScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(),
                                                false );
                }
            }
        }

        return new UnEditScmResult( null, consumer.getUnEditFiles() );

    }

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet dirOrFile )
    {
        List args = new ArrayList();
        args.add( "-u" );

        return StarteamCommandLineUtils.createStarteamCommandLine( "lck", args, dirOrFile, repo );
    }
}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001002311057610744033516 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.remove;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.remove.AbstractRemoveCommand;
import org.apache.maven.scm.command.remove.RemoveScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.command.checkin.StarteamCheckInConsumer;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamRemoveCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamRemoveCommand
    extends AbstractRemoveCommand
    implements StarteamCommand
{
    /** {@inheritDoc} */
    protected ScmResult executeRemoveCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamCheckInConsumer consumer = new StarteamCheckInConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        List remvoveFiles = fileSet.getFileList();

        if ( remvoveFiles.size() == 0 )
        {
            Commandline cl = createCommandLine( repository, fileSet );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new RemoveScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
        }
        else
        {
            //update only interested files already on the local disk
            for ( int i = 0; i < remvoveFiles.size(); ++i )
            {
                File fileToBeRemoved = (File) remvoveFiles.get( i );
                ScmFileSet scmFileSet = new ScmFileSet( fileSet.getBasedir(), fileToBeRemoved );
                Commandline cl = createCommandLine( repository, scmFileSet );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

                if ( exitCode != 0 )
                {
                    return new RemoveScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(),
                                                false );
                }
            }
        }

        return new RemoveScmResult( null, consumer.getCheckedInFiles() );

    }

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet dirOrFile )
    {
        return StarteamCommandLineUtils.createStarteamCommandLine( "remove", null, dirOrFile, repo );
    }
}
././@LongLink0000000000000000000000000000023600000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001000111057621704033510 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.remove;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamRemoveConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamRemoveConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private String workingDirectory;

    /**
     * the current directory entry being processed by the parser
     */
    private String currentDir;

    private List files = new ArrayList();

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String ADDED_MARKER = ": removed";

    /**
     * Marks current file data
     */
    private static final String LINKTO_MARKER = ": linked to";

    public StarteamRemoveConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;

        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( ADDED_MARKER ) ) != -1 )
        {
            processRemovedFile( line, pos );
        }
        else if ( ( pos = line.indexOf( LINKTO_MARKER ) ) != -1 )
        {
            //ignore
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unknown remove ouput: " + line );
            }
        }
    }

    public List getRemovedFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        try
        {
            this.currentDir = StarteamCommandLineUtils.getRelativeChildDirectory( this.workingDirectory, dirPath );
        }
        catch ( IllegalStateException e )
        {
            String error = "Working and checkout directories are not on the same tree";

            if ( logger.isErrorEnabled() )
            {
                logger.error( error );
                logger.error( "Working directory: " + workingDirectory );
                logger.error( "Checked out directory: " + dirPath );
            }

            throw new IllegalStateException( error );
        }
    }

    private void processRemovedFile( String line, int pos )
    {
        String addedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( addedFilePath, ScmFileStatus.DELETED ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Removed: " + addedFilePath );
        }
    }

}
././@LongLink0000000000000000000000000000020000000000000011555 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001040411157300235033511 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.tag;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.command.tag.AbstractTagCommand;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamTagCommand.java 754778 2009-03-15 22:26:37Z olamy $
 */
public class StarteamTagCommand
    extends AbstractTagCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractTagCommand Implementation
    // ----------------------------------------------------------------------

    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag, String message )
        throws ScmException
    {
        return executeTagCommand( repo, fileSet, tag, new ScmTagParameters( message ) );
    }
    
    /** {@inheritDoc} */
    protected ScmResult executeTagCommand( ScmProviderRepository repo, ScmFileSet fileSet, String tag,
                                           ScmTagParameters scmTagParameters )
        throws ScmException
    {
        if ( fileSet.getFiles().length != 0 )
        {
            throw new ScmException( "This provider doesn't support tagging subsets of a directory" );
        }

        if ( tag == null || tag.trim().length() == 0 )
        {
            throw new ScmException( "tag must be specified" );
        }

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamTagConsumer consumer = new StarteamTagConsumer( getLogger() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), tag );

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            return new TagScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
        }

        return new TagScmResult( cl.toString(), consumer.getTaggedFiles() );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, File workingDirectory, String tag )
        throws ScmException
    {
        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "label", repo );

        cl.createArg().setValue( "-p" );

        cl.createArg().setValue( repo.getFullUrl() );

        cl.createArg().setValue( "-nl" );

        cl.createArg().setValue( tag );

        cl.createArg().setValue( "-b" );

        return cl;
    }
}
././@LongLink0000000000000000000000000000023000000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/tag/StarteamTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000314711057621704033525 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.tag;

/*
 * 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.
 */

import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamTagConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamTagConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private List tags = new ArrayList();

    public StarteamTagConsumer( ScmLogger logger )
    {
        this.logger = logger;
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isInfoEnabled() )
        {
            logger.info( line );
        }
    }

    public List getTaggedFiles()
    {
        return tags;
    }
}
././@LongLink0000000000000000000000000000020400000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001376011057610744033531 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.checkin.AbstractCheckInCommand;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamCheckInCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamCheckInCommand
    extends AbstractCheckInCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractCheckInCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                                      ScmVersion version )
        throws ScmException
    {

        //work around until maven-scm-api allow this
        String issueType = System.getProperty( "maven.scm.issue.type" );
        String issueValue = System.getProperty( "maven.scm.issue.value" );
        String deprecatedIssue = System.getProperty( "maven.scm.issue" );

        if ( deprecatedIssue != null && deprecatedIssue.trim().length() > 0 )
        {
            issueType = "cr";
            issueValue = deprecatedIssue;
        }

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamCheckInConsumer consumer = new StarteamCheckInConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        List checkInFiles = fileSet.getFileList();

        if ( checkInFiles.size() == 0 )
        {
            Commandline cl = createCommandLine( repository, fileSet, message, version, issueType, issueValue );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new CheckInScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
        }
        else
        {
            //update only interested files already on the local disk
            for ( int i = 0; i < checkInFiles.size(); ++i )
            {
                ScmFileSet checkInFile = new ScmFileSet( fileSet.getBasedir(), (File) checkInFiles.get( i ) );

                Commandline cl = createCommandLine( repository, checkInFile, message, version, issueType, issueValue );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

                if ( exitCode != 0 )
                {
                    return new CheckInScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(),
                                                 false );
                }
            }
        }

        return new CheckInScmResult( null, consumer.getCheckedInFiles() );

    }


    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet fileSet, String message,
                                                 ScmVersion version, String issueType, String issueValue )
    {
        List args = new ArrayList();

        if ( message != null && message.length() != 0 )
        {
            args.add( "-r" );
            args.add( message );
        }

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            args.add( "-vl" );
            args.add( version.getName() );
        }

        if ( issueType != null && issueType.trim().length() > 0 )
        {
            args.add( "-" + issueType.trim() );
            if ( issueValue != null && issueValue.trim().length() > 0 )
            {
                args.add( issueValue.trim() );
            }
        }

        boolean checkinDirectory = fileSet.getFileList().size() == 0;
        if ( !checkinDirectory )
        {
            if ( fileSet.getFileList().size() != 0 )
            {
                File subFile = (File) fileSet.getFileList().get( 0 );
                checkinDirectory = subFile.isDirectory();
            }
        }

        if ( checkinDirectory )
        {
            args.add( "-f" );
            args.add( "NCI" );
        }

        StarteamCommandLineUtils.addEOLOption( args );

        return StarteamCommandLineUtils.createStarteamCommandLine( "ci", args, fileSet, repo );

    }

}
././@LongLink0000000000000000000000000000024000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001053611057621704033525 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamCheckInConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamCheckInConsumer
    implements StreamConsumer
{
    private String workingDirectory;

    private ScmLogger logger;

    private List files = new ArrayList();

    /**
     * the current directory entry being processed by the parser
     */
    private String currentDir = "";

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String CHECKIN_MARKER = ": checked in";

    /**
     * Marks skipped file during update
     */
    private static final String SKIPPED_MARKER = ": skipped";

    /**
     * Marks current file data
     */
    private static final String LINKTO_MARKER = ": linked to";

    public StarteamCheckInConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;
        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( CHECKIN_MARKER ) ) != -1 )
        {
            processCheckedInFile( line, pos );
        }
        else if ( ( pos = line.indexOf( SKIPPED_MARKER ) ) != -1 )
        {
            processSkippedFile( line, pos );
        }
        else if ( ( pos = line.indexOf( LINKTO_MARKER ) ) != -1 )
        {
            //ignore
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unknown checkin ouput: " + line );
            }
        }

    }

    public List getCheckedInFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        if ( !dirPath.startsWith( workingDirectory ) )
        {
            if ( logger.isInfoEnabled() )
            {
                logger.info( "Working directory: " + workingDirectory );
                logger.info( "Checkin directory: " + dirPath );
            }

            throw new IllegalStateException( "Working and checkin directories are not on the same tree" );
        }

        this.currentDir = "." + dirPath.substring( workingDirectory.length() );
    }

    private void processCheckedInFile( String line, int pos )
    {
        String checkedInFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( checkedInFilePath, ScmFileStatus.CHECKED_OUT ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Checked in: " + checkedInFilePath );
        }
    }

    private void processSkippedFile( String line, int pos )
    {
        String skippedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Skipped: " + skippedFilePath );
        }
    }
}
././@LongLink0000000000000000000000000000020100000000000011556 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/edit/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/edit/StarteamEditCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001013711057610744033524 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.edit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.edit.AbstractEditCommand;
import org.apache.maven.scm.command.edit.EditScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamEditCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamEditCommand
    extends AbstractEditCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractEditCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected ScmResult executeEditCommand( ScmProviderRepository repo, ScmFileSet fileSet )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamEditConsumer consumer = new StarteamEditConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        List editFiles = fileSet.getFileList();

        if ( editFiles.size() == 0 )
        {
            Commandline cl = createCommandLine( repository, fileSet );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new EditScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
        }
        else
        {
            //edit only interested files already on the local disk
            for ( int i = 0; i < editFiles.size(); ++i )
            {
                ScmFileSet editFile = new ScmFileSet( fileSet.getBasedir(), (File) editFiles.get( i ) );
                Commandline cl = createCommandLine( repository, editFile );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

                if ( exitCode != 0 )
                {
                    return new EditScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(),
                                              false );
                }
            }
        }

        return new EditScmResult( null, consumer.getEditedFiles() );

    }

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet dirOrFile )
    {
        List args = new ArrayList();
        args.add( "-l" );

        return StarteamCommandLineUtils.createStarteamCommandLine( "lck", args, dirOrFile, repo );
    }
}
././@LongLink0000000000000000000000000000023200000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/edit/StarteamEditConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000710511057621704033523 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.edit;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamEditConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamEditConsumer
    implements StreamConsumer
{
    private String workingDirectory;

    private ScmLogger logger;

    private List files = new ArrayList();

    /**
     * the current directory entry being processed by the parser
     */
    private String currentDir = "";

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String LOCKED_MARKER = ": locked";


    public StarteamEditConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;
        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }
        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( LOCKED_MARKER ) ) != -1 )
        {
            processLockedFile( line, pos );
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unknown edit ouput: " + line );
            }
        }
    }

    public List getEditedFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        if ( !dirPath.startsWith( workingDirectory ) )
        {
            if ( logger.isInfoEnabled() )
            {
                logger.info( "Working directory: " + workingDirectory );
                logger.info( "Edit directory: " + dirPath );
            }

            throw new IllegalStateException( "Working and edit directories are not on the same tree" );
        }

        this.currentDir = "." + dirPath.substring( workingDirectory.length() );
    }

    private void processLockedFile( String line, int pos )
    {
        String lockedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( lockedFilePath, ScmFileStatus.UNKNOWN ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Locked: " + lockedFilePath );
        }
    }


}
././@LongLink0000000000000000000000000000020100000000000011556 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001113011057610744033516 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.diff;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.diff.AbstractDiffCommand;
import org.apache.maven.scm.command.diff.DiffScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamDiffCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamDiffCommand
    extends AbstractDiffCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractDiffCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startVersion,
                                                ScmVersion endVersion )
        throws ScmException
    {
        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        if ( fileSet.getFiles().length != 0 )
        {
            throw new ScmException( "This provider doesn't support diff command on a subsets of a directory" );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamDiffConsumer consumer = new StarteamDiffConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        Commandline cl = createCommandLine( repository, fileSet, startVersion, endVersion );

        int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

        if ( exitCode != 0 )
        {
            return new DiffScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
        }

        return new DiffScmResult( cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(),
                                  consumer.getPatch() );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet workingDirectory,
                                                 ScmVersion startLabel, ScmVersion endLabel )
        throws ScmException
    {

        List args = new ArrayList();

        args.add( "-filter" );
        args.add( "M" );

        if ( startLabel != null && StringUtils.isNotEmpty( startLabel.getName() ) )
        {
            args.add( "-vl" );

            args.add( startLabel.getName() );
        }

        if ( endLabel != null && StringUtils.isNotEmpty( endLabel.getName() ) )
        {
            args.add( "-vl" );

            args.add( endLabel.getName() );
        }

        if ( endLabel != null && ( startLabel == null || StringUtils.isEmpty( startLabel.getName() ) ) )
        {
            throw new ScmException( "Missing start label." );
        }

        StarteamCommandLineUtils.addEOLOption( args );

        return StarteamCommandLineUtils.createStarteamCommandLine( "diff", args, workingDirectory, repo );
    }
}
././@LongLink0000000000000000000000000000023200000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/diff/StarteamDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001337511057621704033531 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.diff;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamDiffConsumer
    implements StreamConsumer
{
    private static final String WORKING_DIR_TOKEN = "(working dir: ";

    private static final String PATCH_SEPARATOR_TOKEN = "--------------";

    private static final String REVISION_TOKEN = " Revision: ";

    private static final String ONDISK_TOKEN = " (on disk)";

    private static final String ADDED_LINE_TOKEN = "+";

    private static final String REMOVED_LINE_TOKEN = "-";

    private static final String UNCHANGED_LINE_TOKEN = " ";

    private ScmLogger logger;

    private String currentDir = "";

    private boolean diffBlockProcessingStarted = false;

    private boolean revisionBlockStarted = false;

    private String currentFile;

    private StringBuffer currentDifference;

    private List changedFiles = new ArrayList();

    private Map differences = new HashMap();

    private StringBuffer patch = new StringBuffer();

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public StarteamDiffConsumer( ScmLogger logger, File workingDirectory )
    {
        this.logger = logger;
    }

    // ----------------------------------------------------------------------
    // StreamConsumer Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        int pos = 0;

        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        patch.append( line ).append( "\n" );

        if ( line.trim().length() == 0 )
        {
            return;
        }

        if ( ( pos = line.indexOf( WORKING_DIR_TOKEN ) ) != -1 )
        {
            processGetDir( line, pos );

            return;
        }

        if ( line.startsWith( PATCH_SEPARATOR_TOKEN ) )
        {
            diffBlockProcessingStarted = !diffBlockProcessingStarted;

            if ( diffBlockProcessingStarted )
            {
                if ( revisionBlockStarted )
                {
                    throw new IllegalStateException( "Missing second Revision line or local copy line " );
                }
            }

            return;
        }

        if ( ( pos = line.indexOf( REVISION_TOKEN ) ) != -1 )
        {
            if ( revisionBlockStarted )
            {
                revisionBlockStarted = false;
            }
            else
            {
                extractCurrentFile( line, pos );

                revisionBlockStarted = true;
            }

            return;
        }

        if ( ( pos = line.indexOf( ONDISK_TOKEN ) ) != -1 )
        {
            if ( revisionBlockStarted )
            {
                revisionBlockStarted = false;
            }
            else
            {
                throw new IllegalStateException( "Working copy line found at the wrong state " );
            }

            return;
        }

        if ( !diffBlockProcessingStarted )
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unparseable line: '" + line + "'" );
            }

            return;
        }

        if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN )
            || line.startsWith( UNCHANGED_LINE_TOKEN ) )
        {
            // add to buffer
            currentDifference.append( line ).append( "\n" );
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Unparseable line: '" + line + "'" );
            }
        }
    }

    /**
     * Process the current input line in the Get Directory
     *
     * @param line a line of text from the Starteam log output
     */
    private void processGetDir( String line, int pos )
    {
        String dirPath = line.substring( pos + WORKING_DIR_TOKEN.length(), line.length() - 1 ).replace( '\\', '/' );

        this.currentDir = dirPath;
    }

    private void extractCurrentFile( String line, int pos )
    {
        currentFile = line.substring( 0, pos );

        changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) );

        currentDifference = new StringBuffer();

        differences.put( currentFile, currentDifference );
    }

    public List getChangedFiles()
    {
        return changedFiles;
    }

    public Map getDifferences()
    {
        return differences;
    }

    public String getPatch()
    {
        return patch.toString();
    }

}
././@LongLink0000000000000000000000000000020600000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000024300000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000001150111057610744033520 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.ScmBranch;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogSet;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.util.Date;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamChangeLogCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamChangeLogCommand
    extends AbstractChangeLogCommand
    implements StarteamCommand
{
    // ----------------------------------------------------------------------
    // AbstractChangeLogCommand Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                          Date startDate, Date endDate, ScmBranch branch,
                                                          String datePattern )
        throws ScmException
    {
        if ( ( branch != null || StringUtils.isNotEmpty( ( branch == null ) ? null : branch.getName() ) )
            && ( getLogger().isWarnEnabled() ) )
        {
            getLogger().warn( "This provider doesn't support changelog with on a given branch." );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        // TODO: revision
        Commandline cl = createCommandLine( repository, fileSet, startDate );

        StarteamChangeLogConsumer consumer =
            new StarteamChangeLogConsumer( fileSet.getBasedir(), getLogger(), startDate, endDate, datePattern );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        int exitCode;

        try
        {
            exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new ChangeLogScmResult( cl.toString(), "The 'stcmd' command failed.", stderr.getOutput(), false );
        }

        return new ChangeLogScmResult( cl.toString(),
                                       new ChangeLogSet( consumer.getModifications(), startDate, endDate ) );
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet workingDirectory,
                                                 Date startDate )
    {
        //return the full history since we dont know to get hist log from
        //  creation date to a specific date yet
        return StarteamCommandLineUtils.createStarteamCommandLine( "hist", null, workingDirectory, repo );

        /**
         * unfortunately the below option only gives the hist from view creation date to
         * the specified date.  What good is that?????
         */

        /*
        if ( startDate != null )
        {
            SimpleDateFormat localFormat = new SimpleDateFormat();

            cl.createArg().setValue( "-cfgd" );

            cl.createArg().setValue( localFormat.format( startDate ).toString() );
        }
        */

    }
}
././@LongLink0000000000000000000000000000024400000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/changelog/StarteamChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000003015411057610744033525 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.ChangeFile;
import org.apache.maven.scm.ChangeSet;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.util.AbstractConsumer;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamChangeLogConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamChangeLogConsumer
    extends AbstractConsumer
{
    private SimpleDateFormat localFormat = new SimpleDateFormat( "", Locale.getDefault() );

    private List entries = new ArrayList();

    private String workingDirectory;

    private String currentDir = "";

    // state machine constants for reading Starteam output

    /**
     * expecting file information
     */
    private static final int GET_FILE = 1;

    /**
     * expecting date
     */
    private static final int GET_AUTHOR = 2;

    /**
     * expecting comments
     */
    private static final int GET_COMMENT = 3;

    /**
     * expecting revision
     */
    private static final int GET_REVISION = 4;


    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks start of file data
     */
    private static final String START_FILE = "History for: ";


    /**
     * Marks end of file
     */
    private static final String END_FILE =
        "===================================" + "==========================================";

    /**
     * Marks start of revision
     */
    private static final String START_REVISION = "----------------------------";

    /**
     * Marks revision data
     */
    private static final String REVISION_TAG = "Branch Revision: ";

    /**
     * Marks author data
     */
    private static final String AUTHOR_TAG = "Author: ";

    /**
     * Marks date data
     */
    private static final String DATE_TAG = " Date: ";

    /**
     * current status of the parser
     */
    private int status = GET_FILE;

    /**
     * the current log entry being processed by the parser
     */
    private ChangeSet currentChange = null;

    /**
     * the current file being processed by the parser
     */
    private ChangeFile currentFile = null;

    /**
     * the before date
     */
    private Date startDate;

    /**
     * the to date
     */
    private Date endDate;

    private String userDateFormat;

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public StarteamChangeLogConsumer( File workingDirectory, ScmLogger logger, Date startDate, Date endDate,
                                      String userDateFormat )
    {
        super( logger );

        this.workingDirectory = workingDirectory.getPath().replace( '\\', '/' );

        this.startDate = startDate;

        this.endDate = endDate;

        this.userDateFormat = userDateFormat;

        //work around for all en_US compatible locales, where Starteam
        // stcmd hist output uses a different format, ugly eh?
        // makesure to change the test file as well if this ever got fixed

        if ( "M/d/yy h:mm a".equals( localFormat.toLocalizedPattern() ) )
        {
            this.localFormat = new SimpleDateFormat( "M/d/yy h:mm:ss a z" );
        }
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public List getModifications()
    {
        return entries;
    }

    // ----------------------------------------------------------------------
    // StreamConsumer Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
            return;
        }

        // current state transitions in the state machine - starts with Get File
        //      Get File                -> Get Revision
        //      Get Revision            -> Get Date or Get File
        //      Get Date                -> Get Comment
        //      Get Comment             -> Get Comment or Get Revision
        switch ( getStatus() )
        {
            case GET_FILE:
                processGetFile( line );
                break;
            case GET_REVISION:
                processGetRevision( line );
                break;
            case GET_AUTHOR:
                processGetAuthor( line );
                break;
            case GET_COMMENT:
                processGetComment( line );
                break;
            default:
                throw new IllegalStateException( "Unknown state: " + status );
        }
    }

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    /**
     * Add a change log entry to the list (if it's not already there)
     * with the given file.
     *
     * @param entry a {@link ChangeSet} to be added to the list if another
     *              with the same key doesn't exist already. If the entry's author
     *              is null, the entry wont be added
     * @param file  a {@link ChangeFile} to be added to the entry
     */
    private void addEntry( ChangeSet entry, ChangeFile file )
    {
        // do not add if entry is not populated
        if ( entry.getAuthor() == null )
        {
            return;
        }

        // do not add if entry is out of date range
        if ( startDate != null && entry.getDate().before( startDate ) )
        {
            return;
        }

        if ( endDate != null && entry.getDate().after( endDate ) )
        {
            return;
        }

        entry.addFile( file );

        entries.add( entry );
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );
        try
        {
            this.currentDir = StarteamCommandLineUtils.getRelativeChildDirectory( this.workingDirectory, dirPath );
        }
        catch ( IllegalStateException e )
        {
            String error = "Working and checkout directories are not on the same tree";

            if ( getLogger().isErrorEnabled() )
            {
                getLogger().error( error );

                getLogger().error( "Working directory: " + workingDirectory );

                getLogger().error( "Checked out directory: " + dirPath );
            }

            throw new IllegalStateException( error );
        }
    }

    /**
     * Process the current input line in the Get File state.
     *
     * @param line a line of text from the Starteam log output
     */
    private void processGetFile( String line )
    {
        if ( line.startsWith( START_FILE ) )
        {
            setCurrentChange( new ChangeSet() );

            setCurrentFile(
                new ChangeFile( this.currentDir + "/" + line.substring( START_FILE.length(), line.length() ) ) );

            setStatus( GET_REVISION );
        }
    }

    /**
     * Process the current input line in the Get Revision state.
     *
     * @param line a line of text from the Starteam log output
     */
    private void processGetRevision( String line )
    {
        int pos;

        if ( ( pos = line.indexOf( REVISION_TAG ) ) != -1 )
        {
            getCurrentFile().setRevision( line.substring( pos + REVISION_TAG.length() ) );

            setStatus( GET_AUTHOR );
        }
        else if ( line.startsWith( END_FILE ) )
        {
            // If we encounter an end of file line, it means there
            // are no more revisions for the current file.
            // there could also be a file still being processed.
            setStatus( GET_FILE );

            addEntry( getCurrentChange(), getCurrentFile() );
        }
    }

    /**
     * Process the current input line in the Get Author/Date state.
     *
     * @param line a line of text from the Starteam log output
     */
    private void processGetAuthor( String line )
    {
        if ( line.startsWith( AUTHOR_TAG ) )
        {
            int posDateTag = line.indexOf( DATE_TAG );

            String author = line.substring( AUTHOR_TAG.length(), posDateTag );

            getCurrentChange().setAuthor( author );

            String date = line.substring( posDateTag + DATE_TAG.length() );

            Date dateObj = parseDate( date, userDateFormat, localFormat.toPattern() );

            if ( dateObj != null )
            {
                getCurrentChange().setDate( dateObj );
            }
            else
            {
                getCurrentChange().setDate( date, userDateFormat );
            }

            setStatus( GET_COMMENT );
        }
    }

    /**
     * Process the current input line in the Get Comment state.
     *
     * @param line a line of text from the Starteam log output
     */
    private void processGetComment( String line )
    {
        if ( line.startsWith( START_REVISION ) )
        {
            // add entry, and set state to get revision
            addEntry( getCurrentChange(), getCurrentFile() );

            // new change log entry
            setCurrentChange( new ChangeSet() );

            // same file name, but different rev
            setCurrentFile( new ChangeFile( getCurrentFile().getName() ) );

            setStatus( GET_REVISION );
        }
        else if ( line.startsWith( END_FILE ) )
        {
            addEntry( getCurrentChange(), getCurrentFile() );

            setStatus( GET_FILE );
        }
        else
        {
            // keep gathering comments
            getCurrentChange().setComment( getCurrentChange().getComment() + line + "\n" );
        }
    }

    /**
     * Getter for property currentFile.
     *
     * @return Value of property currentFile.
     */
    private ChangeFile getCurrentFile()
    {
        return currentFile;
    }

    /**
     * Setter for property currentFile.
     *
     * @param currentFile New value of property currentFile.
     */
    private void setCurrentFile( ChangeFile currentFile )
    {
        this.currentFile = currentFile;
    }

    /**
     * Getter for property currentChange.
     *
     * @return Value of property currentChange.
     */
    private ChangeSet getCurrentChange()
    {
        return currentChange;
    }

    /**
     * Setter for property currentChange.
     *
     * @param currentChange New value of property currentChange.
     */
    private void setCurrentChange( ChangeSet currentChange )
    {
        this.currentChange = currentChange;
    }

    /**
     * Getter for property status.
     *
     * @return Value of property status.
     */
    private int getStatus()
    {
        return status;
    }

    /**
     * Setter for property status.
     *
     * @param status New value of property status.
     */
    private void setStatus( int status )
    {
        this.status = status;
    }
}
././@LongLink0000000000000000000000000000020000000000000011555 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000775311057621704033534 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.add;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.codehaus.plexus.util.cli.StreamConsumer;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamAddConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class StarteamAddConsumer
    implements StreamConsumer
{
    private ScmLogger logger;

    private String workingDirectory;

    /**
     * the current directory entry being processed by the parser
     */
    private String currentDir;

    private List files = new ArrayList();

    /**
     * Marks current directory data
     */
    private static final String DIR_MARKER = "(working dir: ";

    /**
     * Marks current file data
     */
    private static final String ADDED_MARKER = ": added";

    /**
     * Marks current file data
     */
    private static final String LINKTO_MARKER = ": linked to";

    public StarteamAddConsumer( ScmLogger logger, File basedir )
    {
        this.logger = logger;

        this.workingDirectory = basedir.getPath().replace( '\\', '/' );
    }

    /** {@inheritDoc} */
    public void consumeLine( String line )
    {
        if ( logger.isDebugEnabled() )
        {
            logger.debug( line );
        }

        int pos = 0;

        if ( ( pos = line.indexOf( DIR_MARKER ) ) != -1 )
        {
            processDirectory( line, pos );
        }
        else if ( ( pos = line.indexOf( ADDED_MARKER ) ) != -1 )
        {
            processAddedFile( line, pos );
        }
        else if ( ( pos = line.indexOf( LINKTO_MARKER ) ) != -1 )
        {
            //ignore
        }
        else
        {
            if ( logger.isWarnEnabled() )
            {
                this.logger.warn( "Unknown add ouput: " + line );
            }
        }
    }

    public List getAddedFiles()
    {
        return files;
    }

    private void processDirectory( String line, int pos )
    {
        String dirPath = line.substring( pos + DIR_MARKER.length(), line.length() - 1 ).replace( '\\', '/' );

        try
        {
            this.currentDir = StarteamCommandLineUtils.getRelativeChildDirectory( this.workingDirectory, dirPath );
        }
        catch ( IllegalStateException e )
        {
            String error = "Working and checkout directories are not on the same tree";

            if ( logger.isErrorEnabled() )
            {
                logger.error( error );
                logger.error( "Working directory: " + workingDirectory );
                logger.error( "Checked out directory: " + dirPath );
            }

            throw new IllegalStateException( error );
        }
    }

    private void processAddedFile( String line, int pos )
    {
        String addedFilePath = this.currentDir + "/" + line.substring( 0, pos );

        this.files.add( new ScmFile( addedFilePath, ScmFileStatus.ADDED ) );

        if ( logger.isInfoEnabled() )
        {
            logger.info( "Added: " + addedFilePath );
        }
    }

}
././@LongLink0000000000000000000000000000022700000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000740711057610744033532 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.command.add;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.add.AbstractAddCommand;
import org.apache.maven.scm.command.add.AddScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.StarteamCommand;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Dan T. Tran
 * @version $Id: StarteamAddCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class StarteamAddCommand
    extends AbstractAddCommand
    implements StarteamCommand
{
    /** {@inheritDoc} */
    protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                           boolean binary )
        throws ScmException
    {

        //work around until maven-scm-api allow this
        String issue = System.getProperty( "maven.scm.issue" );

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
        }

        StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;

        StarteamAddConsumer consumer = new StarteamAddConsumer( getLogger(), fileSet.getBasedir() );

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        //File basedir = fileSet.getBasedir();

        List files = fileSet.getFileList();

        for ( int i = 0; i < files.size(); ++i )
        {
            File fileToBeAdded = (File) fileSet.getFileList().get( i );
            ScmFileSet scmFile = new ScmFileSet( fileSet.getBasedir(), fileToBeAdded );

            Commandline cl = createCommandLine( repository, scmFile, issue );

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new AddScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
        }

        return new AddScmResult( null, consumer.getAddedFiles() );
    }

    static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet scmFileSet, String issue )
    {
        List args = new ArrayList();

        if ( issue != null && issue.length() != 0 )
        {
            args.add( "-cr" );
            args.add( issue );
        }

        StarteamCommandLineUtils.addEOLOption( args );

        return StarteamCommandLineUtils.createStarteamCommandLine( "add", args, scmFileSet, repo );
    }
}
././@LongLink0000000000000000000000000000021400000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000003141011057610744033521 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam;

/*
 * 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.
 */

import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.add.AddScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.command.diff.DiffScmResult;
import org.apache.maven.scm.command.edit.EditScmResult;
import org.apache.maven.scm.command.remove.RemoveScmResult;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.command.unedit.UnEditScmResult;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.provider.AbstractScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.starteam.command.add.StarteamAddCommand;
import org.apache.maven.scm.provider.starteam.command.changelog.StarteamChangeLogCommand;
import org.apache.maven.scm.provider.starteam.command.checkin.StarteamCheckInCommand;
import org.apache.maven.scm.provider.starteam.command.checkout.StarteamCheckOutCommand;
import org.apache.maven.scm.provider.starteam.command.diff.StarteamDiffCommand;
import org.apache.maven.scm.provider.starteam.command.edit.StarteamEditCommand;
import org.apache.maven.scm.provider.starteam.command.remove.StarteamRemoveCommand;
import org.apache.maven.scm.provider.starteam.command.status.StarteamStatusCommand;
import org.apache.maven.scm.provider.starteam.command.tag.StarteamTagCommand;
import org.apache.maven.scm.provider.starteam.command.unedit.StarteamUnEditCommand;
import org.apache.maven.scm.provider.starteam.command.update.StarteamUpdateCommand;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;
import org.codehaus.plexus.util.StringUtils;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author Trygve Laugstøl
 * @version $Id: StarteamScmProvider.java 691810 2008-09-03 22:38:28Z vsiveton $
 * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="starteam"
 */
public class StarteamScmProvider
    extends AbstractScmProvider
{
    public static final String STARTEAM_URL_FORMAT =
        "[username[:password]@]hostname:port:/projectName/[viewName/][folderHiearchy/]";

    // ----------------------------------------------------------------------
    // ScmProvider Implementation
    // ----------------------------------------------------------------------

    /** {@inheritDoc} */
    public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter )
        throws ScmRepositoryException
    {
        String user = null;

        String password = null;

        int index = scmSpecificUrl.indexOf( '@' );

        String rest = scmSpecificUrl;

        if ( index != -1 )
        {
            String userAndPassword = scmSpecificUrl.substring( 0, index );

            rest = scmSpecificUrl.substring( index + 1 );

            index = userAndPassword.indexOf( ":" );

            if ( index != -1 )
            {
                user = userAndPassword.substring( 0, index );

                password = userAndPassword.substring( index + 1 );
            }
            else
            {
                user = userAndPassword;
            }
        }

        String[] tokens = StringUtils.split( rest, Character.toString( delimiter ) );

        String host;

        int port;

        String path;

        if ( tokens.length == 3 )
        {
            host = tokens[0];

            port = new Integer( tokens[1] ).intValue();

            path = tokens[2];
        }
        else if ( tokens.length == 2 )
        {
            if ( getLogger().isWarnEnabled() )
            {
                getLogger().warn(
                                  "Your scm URL use a deprecated format. The new format is :"
                                      + STARTEAM_URL_FORMAT );
            }

            host = tokens[0];

            if ( tokens[1].indexOf( '/' ) == -1 )
            {
                throw new ScmRepositoryException(
                    "Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
            }

            int at = tokens[1].indexOf( '/' );

            port = new Integer( tokens[1].substring( 0, at ) ).intValue();

            path = tokens[1].substring( at );
        }
        else
        {
            throw new ScmRepositoryException(
                "Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
        }

        try
        {
            return new StarteamScmProviderRepository( user, password, host, port, path );
        }
        catch ( Exception e )
        {
            throw new ScmRepositoryException(
                "Invalid SCM URL: The url has to be on the form: " + STARTEAM_URL_FORMAT );
        }
    }

    public String getScmType()
    {
        return "starteam";
    }

    /** {@inheritDoc} */
    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamAddCommand command = new StarteamAddCommand();

        command.setLogger( getLogger() );

        return (AddScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
                                         CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamChangeLogCommand command = new StarteamChangeLogCommand();

        command.setLogger( getLogger() );

        return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
                                     CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamCheckInCommand command = new StarteamCheckInCommand();

        command.setLogger( getLogger() );

        return (CheckInScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
                                       CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamCheckOutCommand command = new StarteamCheckOutCommand();

        command.setLogger( getLogger() );

        return (CheckOutScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamDiffCommand command = new StarteamDiffCommand();

        command.setLogger( getLogger() );

        return (DiffScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamStatusCommand command = new StarteamStatusCommand();

        command.setLogger( getLogger() );

        return (StatusScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamTagCommand command = new StarteamTagCommand();

        command.setLogger( getLogger() );

        return (TagScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamUpdateCommand command = new StarteamUpdateCommand();

        command.setLogger( getLogger() );

        return (UpdateScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamEditCommand command = new StarteamEditCommand();

        command.setLogger( getLogger() );

        return (EditScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    protected UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet,
                                      CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamUnEditCommand command = new StarteamUnEditCommand();

        command.setLogger( getLogger() );

        return (UnEditScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );

        StarteamRemoveCommand command = new StarteamRemoveCommand();

        command.setLogger( getLogger() );

        return (RemoveScmResult) command.execute( repository, fileSet, parameters );
    }

    /**
     * Starteam provider requires that all files in ScmFileSet must be relative to basedir
     * This function ensures and converts all absolute paths to relative paths
     *
     * @param currentFileSet
     * @return
     * @throws ScmException
     */
    private static ScmFileSet fixUpScmFileSetAbsoluteFilePath( ScmFileSet currentFileSet )
        throws ScmException
    {
        ScmFileSet newFileSet = null;
        try
        {
            File basedir = getAbsoluteFilePath( currentFileSet.getBasedir() );

            File[] files = currentFileSet.getFiles();

            for ( int i = 0; i < files.length; ++i )
            {
                if ( files[i].isAbsolute() )
                {
                    files[i] = new File( getRelativePath( basedir, files[i] ) );
                }
            }

            newFileSet = new ScmFileSet( basedir, Arrays.asList( files ) );
        }
        catch ( IOException e )
        {
            throw new ScmException( "Invalid file set.", e );
        }

        return newFileSet;
    }

    public static String getRelativePath( File basedir, File f )
        throws ScmException, IOException
    {
        File fileOrDir = getAbsoluteFilePath( f );

        if ( !fileOrDir.getCanonicalPath().startsWith( basedir.getCanonicalPath() ) )
        {
            throw new ScmException( fileOrDir.getPath() + " was not contained in " + basedir.getPath() );
        }

        return fileOrDir.getPath().substring( basedir.getPath().length() + 1, fileOrDir.getPath().length() );
    }

    private static File getAbsoluteFilePath( File fileOrDir )
        throws IOException
    {
        String javaPathString = fileOrDir.getCanonicalPath().replace( '\\', '/' );

        if ( javaPathString.endsWith( "/" ) )
        {
            javaPathString = javaPathString.substring( 0, javaPathString.length() - 1 );
        }

        return new File( javaPathString );
    }
}
././@LongLink0000000000000000000000000000017100000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000435711051372533033526 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.util;

/*
 * 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.
 */

import org.apache.maven.scm.providers.starteam.settings.Settings;
import org.apache.maven.scm.providers.starteam.settings.io.xpp3.StarteamXpp3Reader;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author Dan T. Tran
 * @version $Id: $
 */
public class StarteamUtil
{
    private StarteamUtil()
    {
    }

    public static Settings getSettings()
    {
        File scmUserDir = new File( System.getProperty( "user.home" ), ".scm" );
        File settingsFile = new File( scmUserDir, "starteam-settings.xml" );

        if ( settingsFile.exists() )
        {
            StarteamXpp3Reader reader = new StarteamXpp3Reader();
            try
            {
                return reader.read( ReaderFactory.newXmlReader( settingsFile ) );
            }
            catch ( FileNotFoundException e )
            {
                // nop
            }
            catch ( IOException e )
            {
                // nop
            }
            catch ( XmlPullParserException e )
            {
                String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED." + e.getMessage();

                System.err.println( message );
            }
        }

        return new Settings();
    }
}
././@LongLink0000000000000000000000000000017700000000000011572 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000755000175000017500000000000011345536666033532 5ustar  twernertwerner././@LongLink0000000000000000000000000000024100000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/repository/StarteamScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/pro0000644000175000017500000000427510535556312033532 0ustar  twernertwernerpackage org.apache.maven.scm.provider.starteam.repository;

/*
 * 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.
 */

import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;

/**
 * @author Emmanuel Venisse
 * @version $Id: StarteamScmProviderRepository.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class StarteamScmProviderRepository
    extends ScmProviderRepositoryWithHost
{
    private String path;

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    public StarteamScmProviderRepository( String user, String password, String host, int port, String path )
    {
        setUser( user );

        setPassword( password );

        setHost( host );

        setPort( port );

        if ( !path.startsWith( "/" ) )
        {
            throw new IllegalArgumentException( "The path must be start with a slash?" );
        }

        this.path = path;
    }

    public String getUrl()
    {
        return getHost() + ":" + getPort() + path;
    }

    public String getFullUrl()
    {
        String fullUrl = getUser() + ":";

        if ( getPassword() != null )
        {
            fullUrl += getPassword();
        }

        fullUrl += "@" + getUrl();

        return fullUrl;
    }

    /**
     * @return Returns the path.
     */
    public String getPath()
    {
        return path;
    }
}
maven-scm-1.3/maven-scm-providers/maven-scm-provider-starteam/pom.xml0000644000175000017500000000452611322611461025757 0ustar  twernertwerner




  4.0.0

  
    org.apache.maven.scm
    maven-scm-providers
    1.3
  

  maven-scm-provider-starteam

  Maven SCM Starteam Provider
  SCM Provider implementation for Starteam (http://www.borland.com/us/products/starteam/index.html).

  
    
      
        org.codehaus.plexus
        plexus-maven-plugin
        
          
            
              descriptor
            
          
        
      
      
        org.codehaus.modello
        modello-maven-plugin
        
          
            
              java
              xpp3-reader
              xsd
            
          
        
        
          1.0.0
          
            src/main/mdo/starteam-settings.mdo
          
        
      
    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/0000755000175000017500000000000011345536670023722 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/0000755000175000017500000000000011345536670024511 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/site/0000755000175000017500000000000011345536670025455 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/site/site.xml0000644000175000017500000000212511051127665027135 0ustar  twernertwerner




  
    

    
      
    

    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/0000755000175000017500000000000011345536670025470 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/0000755000175000017500000000000011345536670026411 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/0000755000175000017500000000000011345536670027200 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/0000755000175000017500000000000011345536670030421 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/0000755000175000017500000000000011345536670031527 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536670032311 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000001456211050561465033540 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.local.metadata.LocalScmMetadata;
import org.apache.maven.scm.provider.local.metadata.io.xpp3.LocalScmMetadataXpp3Reader;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;

import java.io.File;
import java.io.FileReader;
import java.io.Reader;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalUpdateCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $
 */
public class LocalUpdateCommandTckTest
    extends UpdateCommandTckTest
{
    private static final String moduleName = "update-tck";

    public String getScmUrl()
        throws Exception
    {
        return "scm:local|" + getRepositoryRoot() + "|" + moduleName;
    }

    public void initRepo()
        throws Exception
    {
        makeRepo( getRepositoryRoot() );
    }

    /**
     * Tests that a file that has been deleted from repository after checkout will be removed by scm-local. Local
     * additions must not be deleted.
     */
    public void testDeletion()
        throws Exception
    {
        FileUtils.deleteDirectory( getUpdatingCopy() );

        ScmRepository repository = makeScmRepository( getScmUrl() );

        checkOut( getUpdatingCopy(), repository );

        // Check preconditions
        File readmeFileLocal = new File( getUpdatingCopy(), "readme.txt" );
        assertTrue( readmeFileLocal.exists() );
        File newFileLocal = new File( getUpdatingCopy(), "newfile.xml" );
        assertTrue( !newFileLocal.exists() );

        // Delete readme.txt from repository
        File readmeFileRepo = new File( getRepositoryRoot(), moduleName + "/readme.txt" );
        assertTrue( readmeFileRepo.exists() );
        assertTrue( "Could not delete", readmeFileRepo.delete() );
        assertFalse( readmeFileRepo.exists() );

        // Make local addition to updating copy - this one must not be touched
        ScmTestCase.makeFile( getUpdatingCopy(), "newfile.xml", "added newfile.xml locally" );
        assertTrue( newFileLocal.exists() );

        // ----------------------------------------------------------------------
        // Update the project
        // ----------------------------------------------------------------------

        ScmManager scmManager = getScmManager();
        Date lastUpdate = new Date( System.currentTimeMillis() );
        Thread.sleep( 1000 );
        UpdateScmResult result =
            scmManager.update( repository, new ScmFileSet( getUpdatingCopy() ), lastUpdate );

        assertNotNull( "The command returned a null result.", result );

        assertResultIsSuccess( result );

        List updatedFiles = result.getUpdatedFiles();

        assertEquals( "Expected 1 files in the updated files list " + updatedFiles, 1, updatedFiles.size() );

        // ----------------------------------------------------------------------
        // Assert the files in the updated files list
        // ----------------------------------------------------------------------

        Iterator files = new TreeSet( updatedFiles ).iterator();

        // readme.txt
        ScmFile file = (ScmFile) files.next();
        assertPath( "/readme.txt", file.getPath() );
        assertTrue( file.getStatus().isUpdate() );

        // ----------------------------------------------------------------------
        // Assert working directory contents
        // ----------------------------------------------------------------------

        // readme.txt
        assertTrue( "Expected local copy of readme.txt to be deleted", !readmeFileLocal.exists() );

        // newfile.xml
        assertTrue( "Expected local copy of newfile.xml NOT to be deleted", newFileLocal.exists() );

        // ----------------------------------------------------------------------
        // Assert metadata file
        // ----------------------------------------------------------------------
        File metadataFile = new File( getUpdatingCopy(), ".maven-scm-local" );
        assertTrue( "Expected metadata file .maven-scm-local does not exist", metadataFile.exists() );
        Reader reader = new FileReader( metadataFile );
        LocalScmMetadata metadata;
        try
        {
            metadata = new LocalScmMetadataXpp3Reader().read( reader );
        }
        finally
        {
            IOUtil.close( reader );
        }
        File root = new File( getRepositoryRoot() + "/" + moduleName );
        List fileNames = FileUtils.getFileNames( root, "**", null, false );
        assertEquals( fileNames, metadata.getRepositoryFileNames() );

    }


    private void makeRepo( File workingDirectory )
        throws Exception
    {
        makeFile( workingDirectory, moduleName + "/pom.xml", "/pom.xml" );

        makeFile( workingDirectory, moduleName + "/readme.txt", "/readme.txt" );

        makeFile( workingDirectory, moduleName + "/src/main/java/Application.java", "/src/main/java/Application.java" );

        makeFile( workingDirectory, moduleName + "/src/test/java/Test.java", "/src/test/java/Test.java" );

        makeDirectory( workingDirectory, moduleName + "/src/test/resources" );
    }
}
././@LongLink0000000000000000000000000000017700000000000011572 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000000663310604260544033536 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.provider.local.metadata.LocalScmMetadata;
import org.apache.maven.scm.provider.local.metadata.io.xpp3.LocalScmMetadataXpp3Reader;
import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;

import java.io.File;
import java.io.FileReader;
import java.io.Reader;
import java.util.List;

/**
 * @author Emmanuel Venisse
 * @version $Id: LocalCheckOutCommandTckTest.java 524909 2007-04-02 20:02:44Z evenisse $
 */
public class LocalCheckOutCommandTckTest
    extends CheckOutCommandTckTest
{
    private String module = "check-out";

    public String getScmUrl()
        throws Exception
    {
        return "scm:local|" + getRepositoryRoot().getAbsolutePath() + "|" + module;
    }

    public void initRepo()
        throws Exception
    {
        File root = new File( getRepositoryRoot() + "/" + module );

        makeFile( root, "/pom.xml" );

        makeFile( root, "/readme.txt" );

        makeFile( root, "/src/main/java/Application.java" );

        makeFile( root, "/src/test/java/Test.java" );

        makeDirectory( root, "/src/test/resources" );
    }

    /**
     * Tests that the metadata file .maven-scm-local is written correctly
     */
    public void testMetadata()
        throws Exception
    {
        FileUtils.deleteDirectory( getWorkingCopy() );

        CheckOutScmResult result = checkOut( getWorkingCopy(), getScmRepository() );

        assertResultIsSuccess( result );

        List checkedOutFiles = result.getCheckedOutFiles();

        assertEquals( 4, checkedOutFiles.size() );

        // ----------------------------------------------------------------------
        // Assert metadata file
        // ----------------------------------------------------------------------
        File metadataFile = new File( getWorkingCopy(), ".maven-scm-local" );
        assertTrue( "Expected metadata file .maven-scm-local does not exist", metadataFile.exists() );
        Reader reader = new FileReader( metadataFile );
        LocalScmMetadata metadata;
        try
        {
            metadata = new LocalScmMetadataXpp3Reader().read( reader );
        }
        finally
        {
            IOUtil.close( reader );
        }
        File root = new File( getRepositoryRoot() + "/" + module );
        List fileNames = FileUtils.getFileNames( root, "**", null, false );
        assertEquals( fileNames, metadata.getRepositoryFileNames() );
    }
}
././@LongLink0000000000000000000000000000017600000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/checkin/LocalCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000000401311050561465033526 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest;

import java.io.File;

/**
 * @author Brett Porter
 * @version $Id: LocalCheckInCommandTckTest.java 685548 2008-08-13 13:35:49Z vsiveton $
 */
public class LocalCheckInCommandTckTest
    extends CheckInCommandTckTest
{
    private static final String moduleName = "checkin-tck";

    public String getScmUrl()
        throws Exception
    {
        return "scm:local|" + getRepositoryRoot() + "|" + moduleName;
    }

    public void initRepo()
        throws Exception
    {
        makeRepo( getRepositoryRoot() );
    }

    private void makeRepo( File workingDirectory )
        throws Exception
    {
        makeFile( workingDirectory, moduleName + "/pom.xml", "/pom.xml" );

        makeFile( workingDirectory, moduleName + "/readme.txt", "/readme.txt" );

        makeFile( workingDirectory, moduleName + "/src/main/java/Application.java", "/src/main/java/Application.java" );

        makeFile( workingDirectory, moduleName + "/src/test/java/Test.java", "/src/test/java/Test.java" );

        makeDirectory( workingDirectory, moduleName + "/src/test/resources" );
    }
}
././@LongLink0000000000000000000000000000017300000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000022700000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/command/list/LocalListCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000000334710575517216033545 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.list;

/*
 * 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.
 */

import org.apache.maven.scm.tck.command.list.ListCommandTckTest;

import java.io.File;

/**
 * @author Emmanuel Venisse
 * @version $Id: LocalListCommandTckTest.java 517675 2007-03-13 12:52:30Z evenisse $
 */
public class LocalListCommandTckTest
    extends ListCommandTckTest
{
    private String module = "check-out";

    public String getScmUrl()
        throws Exception
    {
        return "scm:local|" + getRepositoryRoot().getAbsolutePath() + "|" + module;
    }

    public void initRepo()
        throws Exception
    {
        File root = new File( getRepositoryRoot() + "/" + module );

        makeFile( root, "/pom.xml" );

        makeFile( root, "/readme.txt" );

        makeFile( root, "/src/main/java/Application.java" );

        makeFile( root, "/src/test/java/Test.java" );

        makeDirectory( root, "/src/test/resources" );
    }
}
././@LongLink0000000000000000000000000000020700000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/LocalScmProviderTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000000274610535556312033543 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalScmProviderTest.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class LocalScmProviderTest
    extends ScmTestCase
{
    public void testFixModuleName()
    {
        assertEquals( "my-module", LocalScmProvider.fixModuleName( "my-module" ) );

        assertEquals( "my-module", LocalScmProvider.fixModuleName( "/my-module" ) );

        assertEquals( "my-module", LocalScmProvider.fixModuleName( "my-module/" ) );

        assertEquals( "my-module", LocalScmProvider.fixModuleName( "/my-module/" ) );
    }
}
././@LongLink0000000000000000000000000000017100000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033535 5ustar  twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provider/local/repository/LocalRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/java/org/apache/maven/scm/provid0000644000175000017500000001000310535556312033524 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.repository;

/*
 * 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.
 */

import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;
import org.codehaus.plexus.util.FileUtils;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalRepositoryTest.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class LocalRepositoryTest
    extends ScmTestCase
{
    public void setUp()
        throws Exception
    {
        super.setUp();

        FileUtils.mkdir( getWorkingDirectory().getAbsolutePath() );
    }

    public void testExistingRepository()
        throws Exception
    {
        ScmRepository repository = getScmManager().makeScmRepository( "scm:local:src/test/repository:test-repo" );

        assertNotNull( repository );

        assertEquals( "local", repository.getProvider() );

//        assertEquals( "src/test/repositories:test-repo", repository.getScmSpecificUrl() );

        ScmProviderRepository providerRepository = repository.getProviderRepository();

        assertNotNull( providerRepository );

        assertTrue( providerRepository instanceof LocalScmProviderRepository );

        LocalScmProviderRepository local = (LocalScmProviderRepository) providerRepository;

        assertEquals( getTestFile( "src/test/repository" ).getAbsolutePath(), local.getRoot() );

        assertEquals( "test-repo", local.getModule() );
    }

    public void testMissingRepositoryRoot()
        throws Exception
    {
        try
        {
            getScmManager().makeScmRepository( "scm:local:" );

            fail( "Expected ScmRepositoryException." );
        }
        catch ( ScmRepositoryException ex )
        {
            // expected
        }
    }

    public void testNonExistingMissingRepositoryRoot()
        throws Exception
    {
        try
        {
            getScmManager().makeScmRepository( "scm:local:non-existing-directory:module" );

            fail( "Expected ScmRepositoryException." );
        }
        catch ( ScmRepositoryException ex )
        {
            // expected
        }
    }

    public void testMissingModule()
        throws Exception
    {
        try
        {
            getScmManager().makeScmRepository( "scm:local:src/test/repository" );

            fail( "Expected ScmRepositoryException." );
        }
        catch ( ScmRepositoryException ex )
        {
            // expected
        }

        try
        {
            getScmManager().makeScmRepository( "scm:local:src/test/repository:" );

            fail( "Expected ScmRepositoryException." );
        }
        catch ( ScmRepositoryException ex )
        {
            // expected
        }
    }


    public void testNonExistingModule()
        throws Exception
    {
        try
        {
            getScmManager().makeScmRepository( "scm:local:src/test/repository:non-existing-module" );

            fail( "Expected ScmRepositoryException." );
        }
        catch ( ScmRepositoryException ex )
        {
            // expected
        }
    }

    protected String getScmUrl()
    {
        return "scm:local|" + getRepository() + "|" + getModule();
    }
}
maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/0000755000175000017500000000000011345536670027707 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/0000755000175000017500000000000011345536670031631 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/readme.txt0000644000175000017500000000000710135524171033611 0ustar  twernertwernerHey yo!maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/0000755000175000017500000000000011345536670032420 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/0000755000175000017500000000000011345536670033344 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/java/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/ja0000755000175000017500000000000011345536670033657 5ustar  twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/java/Test.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/test/repository/test-repo/src/main/ja0000644000175000017500000000000010135524171033634 0ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/0000755000175000017500000000000011345536670025435 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/mdo/0000755000175000017500000000000011345536670026214 5ustar  twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/mdo/maven-scm-local-metadata.mdomaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/mdo/maven-scm-local-metadata.mdo0000644000175000017500000000410211315117331033430 0ustar  twernertwerner




  maven-scm-local-metadata
  LocalScmMetadata
  Metadata for Maven SCM Local provider
  
    
      package
      org.apache.maven.scm.provider.local.metadata
    
  

  
    
      LocalScmMetadata
      1.0.0+
      
        
          repositoryFileNames
          1.0.0+
          
             String
             *
          
          The list of filenames contained in the repository during last checkout or update operation.
        
       
    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/0000755000175000017500000000000011345536670026356 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/0000755000175000017500000000000011345536670027145 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/0000755000175000017500000000000011345536670030366 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/0000755000175000017500000000000011345536670031474 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536670032256 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001675511057610744033515 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.changelog.ChangeLogCommand;
import org.apache.maven.scm.command.update.AbstractUpdateCommand;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import org.apache.maven.scm.provider.local.command.changelog.LocalChangeLogCommand;
import org.apache.maven.scm.provider.local.metadata.LocalScmMetadata;
import org.apache.maven.scm.provider.local.metadata.LocalScmMetadataUtils;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalUpdateCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class LocalUpdateCommand
    extends AbstractUpdateCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version )
        throws ScmException
    {
        LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

        if ( version != null )
        {
            throw new ScmException( "The local scm doesn't support tags." );
        }

        File root = new File( repository.getRoot() );

        String module = repository.getModule();

        File source = new File( root, module );

        File baseDestination = fileSet.getBasedir();

        if ( !baseDestination.exists() )
        {
            throw new ScmException(
                "The working directory doesn't exist (" + baseDestination.getAbsolutePath() + ")." );
        }

        if ( !root.exists() )
        {
            throw new ScmException( "The base directory doesn't exist (" + root.getAbsolutePath() + ")." );
        }

        if ( !source.exists() )
        {
            throw new ScmException( "The module directory doesn't exist (" + source.getAbsolutePath() + ")." );
        }

        if ( !baseDestination.exists() && !baseDestination.isDirectory() )
        {
            throw new ScmException( "The destination directory isn't a directory or doesn't exist ("
                + baseDestination.getAbsolutePath() + ")." );
        }

        List updatedFiles;

        try
        {
            if ( getLogger().isInfoEnabled() )
            {
                getLogger().info(
                                  "Updating '" + baseDestination.getAbsolutePath() + "' from '"
                                      + source.getAbsolutePath() + "'." );
            }

            List fileList = FileUtils.getFiles( source.getAbsoluteFile(), "**", null );

            updatedFiles = update( source, baseDestination, fileList );

            // process deletions in repository
            LocalScmMetadataUtils metadataUtils = new LocalScmMetadataUtils( getLogger() );
            LocalScmMetadata originalMetadata = metadataUtils.readMetadata( baseDestination );
            if ( originalMetadata != null )
            {
                LocalScmMetadata newMetadata = metadataUtils.buildMetadata( source );
                for ( Iterator it = originalMetadata.getRepositoryFileNames().iterator(); it.hasNext(); )
                {
                    String filename = (String) it.next();
                    if ( !newMetadata.getRepositoryFileNames().contains( filename ) )
                    {
                        File localFile = new File( baseDestination, filename );
                        if ( localFile.exists() )
                        {
                            localFile.delete();
                            updatedFiles.add( new ScmFile( "/" + filename, ScmFileStatus.UPDATED ) );
                        }
                    }
                }
            }

            // rewrite metadata file
            metadataUtils.writeMetadata( baseDestination, metadataUtils.buildMetadata( source ) );

        }
        catch ( IOException ex )
        {
            throw new ScmException( "Error while checking out the files.", ex );
        }

        return new LocalUpdateScmResult( null, updatedFiles );
    }

    private List update( File source, File baseDestination, List files )
        throws ScmException, IOException
    {
        String sourcePath = source.getAbsolutePath();

        List updatedFiles = new ArrayList();

        for ( Iterator i = files.iterator(); i.hasNext(); )
        {
            File repositoryFile = (File) i.next();

            File repositoryDirectory = repositoryFile.getParentFile();

            // TODO: Add more excludes here
            if ( repositoryDirectory != null && repositoryDirectory.getName().equals( "CVS" ) )
            {
                continue;
            }

            String dest = repositoryFile.getAbsolutePath().substring( sourcePath.length() + 1 );

            File destinationFile = new File( baseDestination, dest );

            String repositoryFileContents = FileUtils.fileRead( repositoryFile );

            if ( destinationFile.exists() )
            {
                String destionationFileContents = FileUtils.fileRead( destinationFile );

                if ( repositoryFileContents.equals( destionationFileContents ) )
                {
                    continue;
                }
            }

            File destinationDirectory = destinationFile.getParentFile();

            if ( !destinationDirectory.exists() && !destinationDirectory.mkdirs() )
            {
                throw new ScmException(
                    "Could not create destination directory '" + destinationDirectory.getAbsolutePath() + "'." );
            }

            ScmFileStatus status;

            if ( destinationFile.exists() )
            {
                status = ScmFileStatus.UPDATED;
            }
            else
            {
                status = ScmFileStatus.ADDED;
            }

            FileUtils.copyFileToDirectory( repositoryFile, destinationDirectory );

            int chop = baseDestination.getAbsolutePath().length();

            String fileName = "/" + destinationFile.getAbsolutePath().substring( chop + 1 );

            updatedFiles.add( new ScmFile( fileName, status ) );
        }

        return updatedFiles;
    }

    /** {@inheritDoc} */
    protected ChangeLogCommand getChangeLogCommand()
    {
        return new LocalChangeLogCommand();
    }
}
././@LongLink0000000000000000000000000000022600000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/update/LocalUpdateScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000242010535556312033475 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.command.update.UpdateScmResult;

import java.util.List;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalUpdateScmResult.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class LocalUpdateScmResult
    extends UpdateScmResult
{
    public LocalUpdateScmResult( String commandLine, List files )
    {
        super( commandLine, files );
    }
}
././@LongLink0000000000000000000000000000017700000000000011572 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001325611057610744033506 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import org.apache.maven.scm.provider.local.metadata.LocalScmMetadataUtils;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class LocalCheckOutCommand
    extends AbstractCheckOutCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                        ScmVersion version, boolean recursive )
        throws ScmException
    {
        LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

        if ( version != null )
        {
            throw new ScmException( "The local scm doesn't support tags." );
        }

        File root = new File( repository.getRoot() );

        String module = repository.getModule();

        File source = new File( root, module );

        File baseDestination = fileSet.getBasedir();

        if ( !root.exists() )
        {
            throw new ScmException( "The base directory doesn't exist (" + root.getAbsolutePath() + ")." );
        }

        if ( !source.exists() )
        {
            throw new ScmException( "The module directory doesn't exist (" + source.getAbsolutePath() + ")." );
        }

        List checkedOutFiles;

        try
        {
            if ( baseDestination.exists() )
            {
                FileUtils.deleteDirectory( baseDestination );
            }

            if ( !baseDestination.mkdirs() )
            {
                throw new ScmException(
                    "Could not create destination directory '" + baseDestination.getAbsolutePath() + "'." );
            }

            if ( getLogger().isInfoEnabled() )
            {
                getLogger().info(
                                  "Checking out '" + source.getAbsolutePath() + "' to '"
                                      + baseDestination.getAbsolutePath() + "'." );
            }

            List fileList;

            if ( fileSet.getFiles().length == 0 )
            {
                fileList = FileUtils.getFiles( source.getAbsoluteFile(), "**", null );
            }
            else
            {
                fileList = Arrays.asList( fileSet.getFiles() );
            }

            checkedOutFiles = checkOut( source, baseDestination, fileList, repository.getModule() );

            // write metadata file
            LocalScmMetadataUtils metadataUtils = new LocalScmMetadataUtils( getLogger() );
            metadataUtils.writeMetadata( baseDestination, metadataUtils.buildMetadata( source ) );
        }
        catch ( IOException ex )
        {
            throw new ScmException( "Error while checking out the files.", ex );
        }

        return new LocalCheckOutScmResult( null, checkedOutFiles );
    }

    private List checkOut( File source, File baseDestination, List files, String module )
        throws ScmException, IOException
    {
        String sourcePath = source.getAbsolutePath();

        List checkedOutFiles = new ArrayList();

        for ( Iterator i = files.iterator(); i.hasNext(); )
        {
            File file = (File) i.next();

            String dest = file.getAbsolutePath();

            dest = dest.substring( sourcePath.length() + 1 );

            File destination = new File( baseDestination, dest );

            destination = destination.getParentFile();

            if ( !destination.exists() && !destination.mkdirs() )
            {
                throw new ScmException(
                    "Could not create destination directory '" + destination.getAbsolutePath() + "'." );
            }

            FileUtils.copyFileToDirectory( file, destination );

            File parent = file.getParentFile();

            // TODO: Add more excludes here
            if ( parent != null && parent.getName().equals( "CVS" ) )
            {
                continue;
            }

            String fileName = "/" + module + "/" + dest;

            checkedOutFiles.add( new ScmFile( fileName, ScmFileStatus.CHECKED_OUT ) );
        }

        return checkedOutFiles;
    }


}
././@LongLink0000000000000000000000000000023200000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkout/LocalCheckOutScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000243610535556312033504 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.command.checkout.CheckOutScmResult;

import java.util.List;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalCheckOutScmResult.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class LocalCheckOutScmResult
    extends CheckOutScmResult
{
    public LocalCheckOutScmResult( String commandLine, List files )
    {
        super( commandLine, files );
    }
}
././@LongLink0000000000000000000000000000017500000000000011570 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/status/LocalStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000337411203112741033471 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.status;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.status.AbstractStatusCommand;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import java.util.List;
import java.util.Collections;

/**
 * @author Matthew McCullough
 * @version $Id: LocalStatusCommand.java 774947 2009-05-14 22:06:25Z olamy $
 */
public class LocalStatusCommand
    extends AbstractStatusCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected StatusScmResult executeStatusCommand( ScmProviderRepository repository, ScmFileSet fileSet)
        throws ScmException
    {
        List fileList = Collections.EMPTY_LIST;
        return new StatusScmResult( null, fileList );
    }
}
././@LongLink0000000000000000000000000000020700000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/LocalCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000213310535556312033476 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command;

/*
 * 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.
 */

import org.apache.maven.scm.command.Command;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalCommand.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public interface LocalCommand
    extends Command
{
}
././@LongLink0000000000000000000000000000017200000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/tag/LocalTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000425411203112741033467 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.tag;

/*
 * 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.
 */

import org.apache.maven.scm.command.tag.AbstractTagCommand;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.ScmResult;

import java.util.List;
import java.util.Collections;

/**
 * @author Matthew McCullough
 * @version $Id: LocalTagCommand.java 774947 2009-05-14 22:06:25Z olamy $
 */
public class LocalTagCommand
    extends AbstractTagCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message, ScmTagParameters scmTagParameters)
        throws ScmException
    {
        List fileList = Collections.EMPTY_LIST;
        return new TagScmResult( null, fileList );
    }

    //Satisfies deprecated interface
    /** {@inheritDoc} */
    protected ScmResult executeTagCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tagName, String message)
        throws ScmException
    {
        List fileList = Collections.EMPTY_LIST;
        return new TagScmResult( null, fileList );
    }
}
././@LongLink0000000000000000000000000000017600000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/checkin/LocalCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001260611057610744033504 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.checkin;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.checkin.AbstractCheckInCommand;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalCheckInCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class LocalCheckInCommand
    extends AbstractCheckInCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                                      ScmVersion version )
        throws ScmException
    {
        LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

        if ( version != null && StringUtils.isNotEmpty( version.getName() ) )
        {
            throw new ScmException( "The local scm doesn't support tags." );
        }

        File root = new File( repository.getRoot() );

        String module = repository.getModule();

        File source = new File( root, module );

        File baseDestination = fileSet.getBasedir();

        if ( !baseDestination.exists() )
        {
            throw new ScmException(
                "The working directory doesn't exist (" + baseDestination.getAbsolutePath() + ")." );
        }

        if ( !root.exists() )
        {
            throw new ScmException( "The base directory doesn't exist (" + root.getAbsolutePath() + ")." );
        }

        if ( !source.exists() )
        {
            throw new ScmException( "The module directory doesn't exist (" + source.getAbsolutePath() + ")." );
        }

        List checkedInFiles = new ArrayList();

        try
        {
            // Only copy files newer than in the repo
            File repoRoot = new File( repository.getRoot(), repository.getModule() );

            List files = Arrays.asList( fileSet.getFiles() );

            if ( files.isEmpty() )
            {
                files = FileUtils.getFiles( baseDestination, "**", null, false );
            }

            Iterator it = files.iterator();

            while ( it.hasNext() )
            {
                File file = (File) it.next();

                String path = file.getPath().replace( '\\', '/' );
                File repoFile = new File( repoRoot, path );
                file = new File( baseDestination, path );

                ScmFileStatus status;

                if ( repoFile.exists() )
                {
                    String repoFileContents = FileUtils.fileRead( repoFile );

                    String fileContents = FileUtils.fileRead( file );

                    if ( getLogger().isDebugEnabled() )
                    {
                        getLogger().debug( "fileContents:" + fileContents );
                        getLogger().debug( "repoFileContents:" + repoFileContents );
                    }
                    if ( fileContents.equals( repoFileContents ) )
                    {
                        continue;
                    }

                    status = ScmFileStatus.CHECKED_IN;
                }
                else if ( repository.isFileAdded( path ) )
                {
                    status = ScmFileStatus.CHECKED_IN;
                }
                else
                {
                    if ( getLogger().isWarnEnabled() )
                    {
                        getLogger().warn( "skipped unknown file in checkin:" + path );
                    }
                    // unknown file, skip
                    continue;
                }

                FileUtils.copyFile( file, repoFile );

                System.err.println( new ScmFile( path, status ) );
                checkedInFiles.add( new ScmFile( path, status ) );
            }
        }
        catch ( IOException ex )
        {
            throw new ScmException( "Error while checking in the files.", ex );
        }

        return new CheckInScmResult( null, checkedInFiles );
    }
}
././@LongLink0000000000000000000000000000017300000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001104511057610744033500 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.list;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.list.AbstractListCommand;
import org.apache.maven.scm.command.list.ListScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.codehaus.plexus.util.StringUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author Emmanuel Venisse
 * @version $Id: LocalListCommand.java 691810 2008-09-03 22:38:28Z vsiveton $
 */
public class LocalListCommand
    extends AbstractListCommand
{
    /** {@inheritDoc} */
    protected ListScmResult executeListCommand( ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive,
                                                ScmVersion version )
        throws ScmException
    {
        if ( version != null )
        {
            throw new ScmException( "The local scm doesn't support tags." );
        }

        LocalScmProviderRepository repository = (LocalScmProviderRepository) repo;

        File root = new File( repository.getRoot() );

        String module = repository.getModule();

        File source = new File( root, module );

        if ( !root.exists() )
        {
            throw new ScmException( "The base directory doesn't exist (" + root.getAbsolutePath() + ")." );
        }

        if ( !source.exists() )
        {
            throw new ScmException( "The module directory doesn't exist (" + source.getAbsolutePath() + ")." );
        }

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Listing files of '" + source.getAbsolutePath() + "'." );
        }

        try
        {
            if ( fileSet.getFileList() == null || fileSet.getFileList().isEmpty() )
            {
                return new LocalListScmResult( null, getFiles( source, source, recursive ) );
            }
            else
            {
                List files = new ArrayList();
                Iterator it = fileSet.getFileList().iterator();

                while ( it.hasNext() )
                {
                    File file = (File) it.next();

                    files.addAll( getFiles( source, new File( source, file.getPath() ), recursive ) );
                }

                return new LocalListScmResult( null, files );
            }
        }
        catch ( Exception e )
        {
            return new ListScmResult( null, "The svn command failed.", e.getMessage(), false );
        }
    }

    private List getFiles( File source, File directory, boolean recursive )
        throws Exception
    {
        if ( !directory.exists() )
        {
            throw new Exception( "Directory '" + directory.getAbsolutePath() + "' doesn't exist." );
        }

        List files = new ArrayList();

        File[] filesArray = directory.listFiles();

        if ( filesArray != null )
        {
            for ( int i = 0; i < filesArray.length; i++ )
            {
                File f = filesArray[i];

                String path = f.getAbsolutePath().substring( source.getAbsolutePath().length() );
                path = StringUtils.replace( path, "\\", "/" );
                path = StringUtils.replace( path, "/./", "/" );

                files.add( new ScmFile( path, ScmFileStatus.CHECKED_IN ) );

                if ( f.isDirectory() && recursive )
                {
                    files.addAll( getFiles( source, f, recursive ) );
                }
            }
        }

        return files;
    }
}
././@LongLink0000000000000000000000000000022200000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/list/LocalListScmResult.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000237711051357615033507 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.list;

/*
 * 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.
 */

import org.apache.maven.scm.command.list.ListScmResult;

import java.util.List;

/**
 * @author Emmanuel Venisse
 * @version $Id: LocalListScmResult.java 686352 2008-08-15 19:57:01Z vsiveton $
 */
public class LocalListScmResult
    extends ListScmResult
{
    public LocalListScmResult( String commandLine, List files )
    {
        super( commandLine, files );
    }
}
././@LongLink0000000000000000000000000000020000000000000011555 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/changelog/LocalChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001307411051357615033503 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.ChangeFile;
import org.apache.maven.scm.ChangeSet;
import org.apache.maven.scm.ScmBranch;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogSet;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

/**
 * @author Emmanuel Venisse
 * @version $Id: LocalChangeLogCommand.java 686352 2008-08-15 19:57:01Z vsiveton $
 */
public class LocalChangeLogCommand
    extends AbstractChangeLogCommand
{
    /** {@inheritDoc} */
    protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                          Date startDate, Date endDate, ScmBranch branch,
                                                          String datePattern )
        throws ScmException
    {
        LocalScmProviderRepository repo = (LocalScmProviderRepository) repository;

        if ( branch != null )
        {
            throw new ScmException( "The local scm doesn't support tags." );
        }

        File root = new File( repo.getRoot() );

        String module = repo.getModule();

        File source = new File( root, module );

        File baseDestination = fileSet.getBasedir();

        if ( !baseDestination.exists() )
        {
            throw new ScmException(
                "The working directory doesn't exist (" + baseDestination.getAbsolutePath() + ")." );
        }

        if ( !root.exists() )
        {
            throw new ScmException( "The base directory doesn't exist (" + root.getAbsolutePath() + ")." );
        }

        if ( !source.exists() )
        {
            throw new ScmException( "The module directory doesn't exist (" + source.getAbsolutePath() + ")." );
        }

        List changeLogList = new ArrayList();

        try
        {
            File repoRoot = new File( repo.getRoot(), repo.getModule() );

            List files = Arrays.asList( fileSet.getFiles() );

            if ( files.isEmpty() )
            {
                files = FileUtils.getFiles( baseDestination, "**", null, false );
            }

            Iterator it = files.iterator();

            while ( it.hasNext() )
            {
                File file = (File) it.next();

                String path = file.getPath().replace( '\\', '/' );

                File repoFile = new File( repoRoot, path );

                file = new File( baseDestination, path );

                ChangeSet changeSet = new ChangeSet();

                int chop = repoRoot.getAbsolutePath().length();

                String fileName = "/" + repoFile.getAbsolutePath().substring( chop + 1 );

                changeSet.addFile( new ChangeFile( fileName, null ) );

                if ( repoFile.exists() )
                {
                    long lastModified = repoFile.lastModified();

                    Date modifiedDate = new Date( lastModified );

                    if ( startDate != null )
                    {
                        if ( startDate.before( modifiedDate ) || startDate.equals( modifiedDate ) )
                        {
                            if ( endDate != null )
                            {
                                if ( endDate.after( modifiedDate ) || endDate.equals( modifiedDate ) )
                                {
                                    // nop
                                }
                                else
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }

                    changeSet.setDate( modifiedDate );

                    changeLogList.add( changeSet );
                }
                else
                {
                    // This file is deleted
                    changeLogList.add( changeSet );
                }
            }
        }
        catch ( IOException ex )
        {
            throw new ScmException( "Error while getting change logs.", ex );
        }

        return new ChangeLogScmResult( null, new ChangeLogSet( changeLogList, startDate, endDate ) );
    }
}
././@LongLink0000000000000000000000000000017200000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/command/add/LocalAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000465011050561465033502 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.command.add;

/*
 * 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.
 */

import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.add.AbstractAddCommand;
import org.apache.maven.scm.command.add.AddScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.LocalCommand;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Brett Porter
 * @version $Id: LocalAddCommand.java 685548 2008-08-13 13:35:49Z vsiveton $
 */
public class LocalAddCommand
    extends AbstractAddCommand
    implements LocalCommand
{
    /** {@inheritDoc} */
    protected ScmResult executeAddCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message,
                                           boolean binary )
        throws ScmException
    {
        LocalScmProviderRepository localRepo = (LocalScmProviderRepository) repository;

        File[] files = fileSet.getFiles();
        List fileList = new ArrayList();
        for ( int i = 0; i < files.length; i++ )
        {
            String path = files[i].getPath().replace( '\\', '/' );
            localRepo.addFile( path );
            fileList.add( new ScmFile( path, ScmFileStatus.ADDED ) );
        }

        // TODO: Also, ensure it is tested from the update test
        return new AddScmResult( null, fileList );
    }
}
././@LongLink0000000000000000000000000000017100000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/repository/LocalScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000000360710535556312033505 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.repository;

/*
 * 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.
 */

import org.apache.maven.scm.provider.ScmProviderRepository;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Trygve Laugstøl
 * @version $Id: LocalScmProviderRepository.java 483105 2006-12-06 15:07:54Z evenisse $
 */
public class LocalScmProviderRepository
    extends ScmProviderRepository
{
    private String root;

    private String module;

    private Set addedFiles = new HashSet();

    /**
     * @param root
     * @param module
     */
    public LocalScmProviderRepository( String root, String module )
    {
        this.root = root;

        this.module = module;
    }

    /**
     * @return Returns the root.
     */
    public String getRoot()
    {
        return root;
    }

    /**
     * @return Returns the module.
     */
    public String getModule()
    {
        return module;
    }

    public void addFile( String path )
    {
        addedFiles.add( path );
    }

    public boolean isFileAdded( String path )
    {
        return addedFiles.contains( path );
    }
}
././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/metadata/maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000755000175000017500000000000011345536670033502 5ustar  twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/metadata/LocalScmMetadataUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000001022011057621704033470 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local.metadata;

/*
 * 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.
 */

import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.provider.local.metadata.io.xpp3.LocalScmMetadataXpp3Reader;
import org.apache.maven.scm.provider.local.metadata.io.xpp3.LocalScmMetadataXpp3Writer;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.WriterFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.List;

/**
 * Utils for dealing with LocalScmMetadata
 *
 * @author Arne Degenring
 * @version $Id: LocalScmMetadataUtils.java 691832 2008-09-03 23:54:44Z vsiveton $
 */
public class LocalScmMetadataUtils
{
    /**
     * The name of the metadata file
     */
    public static final String FILENAME = ".maven-scm-local";

    protected final ScmLogger logger;

    public LocalScmMetadataUtils( ScmLogger logger )
    {
        this.logger = logger;
    }

    /**
     * Builds LocalScmMetadata based on contents of repository
     *
     * @param repository
     * @return
     * @throws IOException if any
     */
    public LocalScmMetadata buildMetadata( File repository )
        throws IOException
    {
        List repoFilenames = FileUtils.getFileNames( repository.getAbsoluteFile(), "**", null, false );
        LocalScmMetadata metadata = new LocalScmMetadata();
        metadata.setRepositoryFileNames( repoFilenames );
        return metadata;
    }

    /**
     * Writes metadata file
     *
     * @param destinationDir
     * @param metadata
     * @throws IOException if any
     */
    public void writeMetadata( File destinationDir, LocalScmMetadata metadata )
        throws IOException
    {
        File metadataFile = new File( destinationDir, FILENAME );
        metadataFile.createNewFile();
        Writer writer = WriterFactory.newXmlWriter( metadataFile );
        try
        {
            new LocalScmMetadataXpp3Writer().write( writer, metadata );
        }
        finally
        {
            IOUtil.close( writer );
        }
    }

    /**
     * Reads metadata file from given directory.
     *
     * @param dir The directory that should contain the metadata file
     * @return LocalScmMetadata or null in case of problems
     */
    public LocalScmMetadata readMetadata( File dir )
    {
        File metadataFile = new File( dir, FILENAME );
        if ( !metadataFile.exists() )
        {
            return null;
        }
        LocalScmMetadata result = null;
        Reader reader = null;
        try
        {
            reader = ReaderFactory.newXmlReader( metadataFile );
            result = new LocalScmMetadataXpp3Reader().read( reader );
        }
        catch ( XmlPullParserException e )
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Could not interpret .maven-scm-local - ignoring", e );
            }
            return null;
        }
        catch ( IOException e )
        {
            if ( logger.isWarnEnabled() )
            {
                logger.warn( "Could not Read .maven-scm-local - ignoring", e );
            }
        }
        finally
        {
            IOUtil.close( reader );
        }
        return result;
    }

}
././@LongLink0000000000000000000000000000020300000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provider/local/LocalScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-local/src/main/java/org/apache/maven/scm/provid0000644000175000017500000002056111203112741033466 0ustar  twernertwernerpackage org.apache.maven.scm.provider.local;

/*
 * 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.
 */

import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.add.AddScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.command.list.ListScmResult;
import org.apache.maven.scm.command.update.UpdateScmResult;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.command.tag.TagScmResult;
import org.apache.maven.scm.provider.AbstractScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.local.command.add.LocalAddCommand;
import org.apache.maven.scm.provider.local.command.changelog.LocalChangeLogCommand;
import org.apache.maven.scm.provider.local.command.checkin.LocalCheckInCommand;
import org.apache.maven.scm.provider.local.command.checkout.LocalCheckOutCommand;
import org.apache.maven.scm.provider.local.command.list.LocalListCommand;
import org.apache.maven.scm.provider.local.command.update.LocalUpdateCommand;
import org.apache.maven.scm.provider.local.command.status.LocalStatusCommand;
import org.apache.maven.scm.provider.local.command.tag.LocalTagCommand;
import org.apache.maven.scm.provider.local.repository.LocalScmProviderRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;
import org.codehaus.plexus.util.StringUtils;

import java.io.File;

/**
 * @author Trygve Laugstøl
 * @author Emmanuel Venisse
 * @version $Id: LocalScmProvider.java 774947 2009-05-14 22:06:25Z olamy $
 * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="local"
 */
public class LocalScmProvider
    extends AbstractScmProvider
{
    /** {@inheritDoc} */
    public String getScmType()
    {
        return "local";
    }

    /** {@inheritDoc} */
    public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter )
        throws ScmRepositoryException
    {
        String[] tokens = StringUtils.split( scmSpecificUrl, Character.toString( delimiter ) );

        if ( tokens.length != 2 )
        {
            throw new ScmRepositoryException( "The connection string didn't contain the expected number of tokens. "
                + "Expected 2 tokens but got " + tokens.length + " tokens." );
        }

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        String root = tokens[0];

        File rootFile = new File( root );

        if ( !rootFile.isAbsolute() )
        {
            String basedir = System.getProperty( "basedir", new File( "" ).getAbsolutePath() );

            rootFile = new File( basedir, root );
        }

        if ( !rootFile.exists() )
        {
            throw new ScmRepositoryException( "The root doesn't exists (" + rootFile.getAbsolutePath() + ")." );
        }

        if ( !rootFile.isDirectory() )
        {
            throw new ScmRepositoryException( "The root isn't a directory (" + rootFile.getAbsolutePath() + ")." );
        }

        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        String module = tokens[1];

        File moduleFile = new File( rootFile, module );

        if ( !moduleFile.exists() )
        {
            throw new ScmRepositoryException(
                "The module doesn't exist (root: " + rootFile.getAbsolutePath() + ", module: " + module + ")." );
        }

        if ( !moduleFile.isDirectory() )
        {
            throw new ScmRepositoryException( "The module isn't a directory." );
        }

        return new LocalScmProviderRepository( rootFile.getAbsolutePath(), module );
    }

    // ----------------------------------------------------------------------
    // Utility methods
    // ----------------------------------------------------------------------

    public static String fixModuleName( String module )
    {
        if ( module.endsWith( "/" ) )
        {
            module = module.substring( 0, module.length() - 1 );
        }

        if ( module.startsWith( "/" ) )
        {
            module = module.substring( 1 );
        }

        return module;
    }

    /** {@inheritDoc} */
    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        LocalStatusCommand command = new LocalStatusCommand();

        command.setLogger( getLogger() );

        return (StatusScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        LocalTagCommand command = new LocalTagCommand();

        command.setLogger( getLogger() );

        return (TagScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        LocalAddCommand command = new LocalAddCommand();

        command.setLogger( getLogger() );

        return (AddScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    protected ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
                                            CommandParameters parameters )
        throws ScmException
    {
        LocalChangeLogCommand command = new LocalChangeLogCommand();

        command.setLogger( getLogger() );

        return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
                                     CommandParameters parameters )
        throws ScmException
    {
        LocalCheckInCommand command = new LocalCheckInCommand();

        command.setLogger( getLogger() );

        return (CheckInScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
                                       CommandParameters parameters )
        throws ScmException
    {
        LocalCheckOutCommand command = new LocalCheckOutCommand();

        command.setLogger( getLogger() );

        return (CheckOutScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        LocalListCommand command = new LocalListCommand();

        command.setLogger( getLogger() );

        return (ListScmResult) command.execute( repository, fileSet, parameters );
    }

    /** {@inheritDoc} */
    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
        throws ScmException
    {
        LocalUpdateCommand command = new LocalUpdateCommand();

        command.setLogger( getLogger() );

        return (UpdateScmResult) command.execute( repository, fileSet, parameters );
    }
}
maven-scm-1.3/maven-scm-providers/maven-scm-provider-local/pom.xml0000644000175000017500000000450211322611461025223 0ustar  twernertwerner




  4.0.0

  
    org.apache.maven.scm
    maven-scm-providers
    1.3
  

  maven-scm-provider-local

  Maven SCM Local Provider
  SCM Provider implementation for Local.

  
    
      
        org.codehaus.plexus
        plexus-maven-plugin
        
          
            
              descriptor
            
          
        
      
      
        org.codehaus.modello
        modello-maven-plugin
        
          
            
              java
              xpp3-reader
              xpp3-writer
              xsd
            
          
        
        
          1.0.0
          
            src/main/mdo/maven-scm-local-metadata.mdo
          
        
      
    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/0000755000175000017500000000000011345536671023227 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/readme.txt0000644000175000017500000000043710607652040025216 0ustar  twernertwernerhow to build mercurial (hg) scm provider?

you must have mercurial (hg) installed on your machine. mercurial is available at http://selenic.com/mercurial. 

the mercurial provider is basically a copy of the bzr provider written by mailto:torbjorn@smorgrav.org">torbjørn eikli smørgrav.

maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/0000755000175000017500000000000011345536671024016 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/site/0000755000175000017500000000000011345536671024762 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/site/site.xml0000644000175000017500000000212211051127665026436 0ustar  twernertwerner




  
    

    
      
    

    
  

maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/0000755000175000017500000000000011345536671024775 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/0000755000175000017500000000000011345536671025716 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/0000755000175000017500000000000011345536671026505 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/0000755000175000017500000000000011345536671027726 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/0000755000175000017500000000000011345536671031034 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536671031616 5ustar  twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000250110613621271033434 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.update;

/*
 * 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.update.UpdateCommandTckTest;

/**
 * @author thurner rupert
 */
public class HgUpdateCommandTckTest
    extends UpdateCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000017100000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000251310613621271033437 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.checkout;

/*
 * 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.checkout.CheckOutCommandTckTest;

/**
 * @author thurner rupert
 */
public class HgCheckOutCommandTckTest
    extends CheckOutCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000016700000000000011571 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000250110613621271033434 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.status;

/*
 * 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.status.StatusCommandTckTest;

/**
 * @author thurner rupert
 */
public class HgStatusCommandTckTest
    extends StatusCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000016400000000000011566 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/tag/HgTagCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000264410625101605033441 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.tag;

/*
 * 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.tag.TagCommandTckTest;

/**
 * This test tests the tag command.
 *
 * @author Ryan Daum
 * @version $Id: HgTagCommandTckTest.java 541006 2007-05-23 18:10:13Z evenisse $
 */
public class HgTagCommandTckTest
        extends TagCommandTckTest
{
     public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000017000000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000221510613621271033436 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.checkin;

/*
 * Copyright 2001-2006 The Apache Software Foundation.
 *
 * Licensed 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.checkin.CheckInCommandTckTest;

/**
 * @author thurner rupert
 */
public class HgCheckInCommandTckTest
    extends CheckInCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000016500000000000011567 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000001335610613621271033446 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.diff;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.diff.DiffScmResult;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.tck.command.diff.DiffCommandTckTest;

import java.io.File;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;

public class HgDiffCommandTckTest
    extends DiffCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }

    public void testDiffCommand()
        throws Exception
    {
        ScmRepository repository = getScmRepository();

        // ----------------------------------------------------------------------
        // Change the files
        // ----------------------------------------------------------------------

        //
        // readme.txt is changed (changed file in the root directory)
        // project.xml is added (added file in the root directory)
        // src/test/resources is untouched (a empty directory is left untouched)
        // src/test/java is untouched (a non empty directory is left untouched)

        // This following test has no meaning to mercurial as mercurial does not track
        // empty directories, only the files contained within
        // See: http://www.selenic.com/mercurial/wiki/index.cgi/FAQ
        // src/test/java/org (a empty directory is added)

        // src/main/java/org/Foo.java (a non empty directory is added)
        //

        // /readme.txt
        ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" );

        // /project.xml
        ScmTestCase.makeFile( getWorkingCopy(), "/project.xml", "changed project.xml" );

        addToWorkingTree( getWorkingCopy(), new File( "project.xml" ), repository );

        // /src/test/java/org
//		ScmTestCase.makeDirectory(getWorkingCopy(), "/src/test/java/org");
//
//		addToWorkingTree(getWorkingCopy(), new File("src/test/java/org"),
//				repository);

        // /src/main/java/org/Foo.java
        ScmTestCase.makeFile( getWorkingCopy(), "/src/main/java/org/Foo.java" );

//		addToWorkingTree(getWorkingCopy(), new File("src/main/java/org"),
//				repository);

        // src/main/java/org/Foo.java
        addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org/Foo.java" ), repository );

        // ----------------------------------------------------------------------
        // Diff the project
        // ----------------------------------------------------------------------

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );
        ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() );
        DiffScmResult result = provider.diff( repository, fileSet, (ScmVersion) null, null );

//		todo: check asserts
//		assertNotNull("The command returned a null result.", result);

//      assertResultIsSuccess(result);

        List changedFiles = result.getChangedFiles();

        Map differences = result.getDifferences();

//		assertEquals("Expected 3 files in the changed files list "
//				+ changedFiles, 3, changedFiles.size());

//		assertEquals("Expected 3 files in the differences list " + differences,
//				3, differences.size());

//		 ----------------------------------------------------------------------
//		 Assert the files in the changed files list
//		 ----------------------------------------------------------------------

        Iterator files = new TreeSet( changedFiles ).iterator();

//		Check Foo.java
        ScmFile file = (ScmFile) files.next();

//		assertPath("/src/main/java/org/Foo.java", file.getPath());

//		assertTrue(file.getStatus().isDiff());

        String postRangeStr = "+/src/main/java/org/Foo.java\n\\ No newline at end of file\n";
        String actualStr = differences.get( file.getPath() ).toString();
//		assertTrue(actualStr.endsWith(postRangeStr));

//		Check readme.txt
        file = (ScmFile) files.next();

//		assertPath("/readme.txt", file.getPath());

//		assertTrue(file.getStatus().isDiff());

        postRangeStr =
            "-/readme.txt\n\\ No newline at end of file\n+changed readme.txt\n\\ No newline at end of file\n";
        actualStr = differences.get( file.getPath() ).toString();
//		assertTrue(actualStr.endsWith(postRangeStr));

//		Check project.xml
        file = (ScmFile) files.next();

//		assertPath("/project.xml", file.getPath());

        postRangeStr = "+changed project.xml\n\\ No newline at end of file\n";
        actualStr = differences.get( file.getPath() ).toString();
//		assertTrue(actualStr.endsWith(postRangeStr));

//		assertTrue(file.getStatus().isDiff());
        assertTrue( true );
    }

}
././@LongLink0000000000000000000000000000017200000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommandTckTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000000240010613621271033432 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command.changelog;

/*
 * 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.
 */

import org.apache.maven.scm.provider.hg.HgRepoUtils;
import org.apache.maven.scm.tck.command.changelog.ChangeLogCommandTckTest;

public class HgChangeLogCommandTckTest
    extends ChangeLogCommandTckTest
{
    public String getScmUrl()
        throws Exception
    {
        return HgRepoUtils.getScmUrl();
    }

    public void initRepo()
        throws Exception
    {
        HgRepoUtils.initRepo();
    }
}
././@LongLink0000000000000000000000000000017000000000000011563 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/HgRepoUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000001057311051646056033451 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.provider.hg.command.HgCommandConstants;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Common code used in all tests.
 *
 * @author thurner rupert
 */
public class HgRepoUtils
    extends PlexusTestCase
{

    public static final String[] filesInTestBranch =
        new String[]{"pom.xml", "readme.txt", "src/main/java/Application.java", "src/test/java/Test.java"};

    public static final String TCK_FILE_CONSTANT = "/";

    public static final String BRANCH_NAME = "target" + File.separator + "test-branch";

    public static final File WORKING_DIR = new File( getBasedir(), BRANCH_NAME );

    public static final String COMMIT_MESSAGE = "Add files to test branch";

    public static String getScmUrl()
        throws Exception
    {
        return "scm:hg:" + WORKING_DIR.getAbsolutePath();
    }

    public static void initRepo()
        throws Exception
    {
        // Prepare tmp directory
        if ( WORKING_DIR.exists() )
        {
            FileUtils.deleteDirectory( WORKING_DIR );

            if ( WORKING_DIR.exists() )
            {
                throw new IOException( WORKING_DIR.getAbsolutePath() + " wasn't deleted." );
            }
        }

        boolean workingDirReady = WORKING_DIR.mkdirs();

        if ( !workingDirReady )
        {
            throw new IOException( "Could not initiate test branch at: " + WORKING_DIR );
        }

        // Init repository
        String[] init_cmd = new String[]{HgCommandConstants.INIT_CMD};
        HgUtils.execute( WORKING_DIR, init_cmd );

        // Create and add files to repository
        List files = new ArrayList();
        for ( int i = 0; i < filesInTestBranch.length; i++ )
        {
            File file = new File( WORKING_DIR.getAbsolutePath(), filesInTestBranch[i] );
            if ( file.getParentFile() != null && !file.getParentFile().exists() )
            {
                boolean success = file.getParentFile().mkdirs();
                if ( !success )
                {
                    throw new IOException( "Could not create directories in branch for: " + file );
                }
            }
            file.createNewFile();

            FileUtils.fileWrite( file.getAbsolutePath(), TCK_FILE_CONSTANT + filesInTestBranch[i] );

            files.add( file );
        }

        //Add to repository
        String[] add_cmd = new String[]{HgCommandConstants.ADD_CMD};
        ScmFileSet filesToAdd = new ScmFileSet( new File( "" ), files );
        add_cmd = HgUtils.expandCommandLine( add_cmd, filesToAdd );
        ScmResult result = HgUtils.execute( WORKING_DIR, add_cmd );
        if ( !result.isSuccess() )
        {
            String message =
                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
            throw new Exception( message );
        }

        // Commit the initial repository
        String[] commit_cmd = new String[]{HgCommandConstants.COMMIT_CMD, HgCommandConstants.MESSAGE_OPTION, COMMIT_MESSAGE};
        result = HgUtils.execute( WORKING_DIR, commit_cmd );
        if ( !result.isSuccess() )
        {
            String message =
                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
            throw new Exception( message );
        }
    }
}
././@LongLink0000000000000000000000000000016300000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033450 5ustar  twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepositoryTest.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/test/java/org/apache/maven/scm/provider/0000644000175000017500000001102511052265355033442 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.repository;

/*
 * 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.
 */

import junit.framework.TestCase;

public class HgScmProviderRepositoryTest
    extends TestCase
{

//    public void testInvalidRepo()
//    {
//        //No protocol - makes it invalid
//        String url = "username:password@myhost.com/~/dev/maven";
//        HgScmProviderRepository repo = new HgScmProviderRepository( url );
//        assertNotNull( repo.validateURI() );
//    }

    public void testFileRepo()
    {
        //1. Test *nix like paths
        String url = "/home/username/dev/maven";
        HgScmProviderRepository repo = new HgScmProviderRepository( url );
        assertNull( repo.validateURI() );

        //2. Test windows like paths (with slash)
        url = "C:/Documents and Settings/username/dev/maven";
        repo = new HgScmProviderRepository( url );
        assertNull( repo.validateURI() );

        //3. Test windows like paths (with backslash)
        url = "C:\\Documents and Settings\\username\\dev\\maven";
        repo = new HgScmProviderRepository( url );
        assertNull( repo.validateURI() );

//        //4. Test invalid file url
//        url = "file:/C:\\Documents and Settings\\username\\dev\\maven";
//        repo = new HgScmProviderRepository( url );
//        assertNotNull( repo.validateURI() );
    }

    public void testSSHRepo()
    {
        //todo: check assert
        //1. Test with relativ path
        String url = "ssh://username:password@myhost.com/~/dev/maven";
        HgScmProviderRepository repo = new HgScmProviderRepository( url );
        assertEquals( url, repo.getURI() );
        assertNull( repo.validateURI() );

        //2. Test with absolute path
        url = "ssh://username:password@myhost.com/home/username/dev/maven";
        repo = new HgScmProviderRepository( url );
        assertEquals( url, repo.getURI() );
        assertNull( repo.validateURI() );

        //3. Test with passwordless (Public-key auth)
        String incompleteUrl = "ssh://username@myhost.com/home/username/dev/maven";
        repo = new HgScmProviderRepository( incompleteUrl );
        assertEquals( incompleteUrl, repo.getURI() );
        assertNull( repo.validateURI() );
    }

    public void testHTTPRepo()
    {
        //todo: check assert
        //1. Test with relativ path
        String url = "http://www.myhost.com/~username/dev/maven";
        HgScmProviderRepository repo = new HgScmProviderRepository( url );
        assertEquals( url, repo.getURI() );
        assertNull( repo.validateURI() );

        //2. Test with absolute path
        url = "http://www.myhost.com/dev/maven";
        repo = new HgScmProviderRepository( url );
        assertEquals( url, repo.getURI() );
        assertNull( repo.validateURI() );

        //3. Test with unessesary authentication information
        repo.setPassword( "Password" );
        repo.setUser( "User" );
        repo.setPassphrase( "Passphrase" );
        assertEquals( "http://www.myhost.com/dev/maven", repo.getURI() );
        assertNull( repo.validateURI() );
        repo.setPort( 81 );
        assertEquals( "http://www.myhost.com:81/dev/maven", repo.getURI() );
        assertNull( repo.validateURI() );
        assertTrue( true );
    }

    /**
     * Test SCM-391
     *
     * @throws Exception
     */
    public void testParseHostAndPort()
        throws Exception
    {
        String url = "http://localhost:8000/";
        HgScmProviderRepository repo = new HgScmProviderRepository( url );
        assertEquals( repo.getURI(), url );

        url = "http://localhost/";
        repo = new HgScmProviderRepository( url );
        assertEquals( repo.getURI(), url );

        url = "http://www.myhost.com:81/dev/maven";
        repo = new HgScmProviderRepository( url );
        assertEquals( repo.getURI(), url );
    }
}maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/0000755000175000017500000000000011345536671024742 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/0000755000175000017500000000000011345536671025663 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/0000755000175000017500000000000011345536671026452 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/0000755000175000017500000000000011345536671027673 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/0000755000175000017500000000000011345536671031001 5ustar  twernertwernermaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536671031563 5ustar  twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar  twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar  twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar  twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar  rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001412611057610744033415 0ustar  twernertwernerpackage org.apache.maven.scm.provider.hg.command;

/*
 * 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.
 */

import org.apache.maven.scm.ScmFileStatus;
import org.apache.maven.scm.log.ScmLogger;
import org.apache.maven.scm.util.AbstractConsumer;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Base consumer to do common parsing for all hg commands.
 * 

* More specific: log line each line if debug is enabled, get file status * and detect warnings from hg * * @author thurner rupert * @version $Id: HgConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class HgConsumer extends AbstractConsumer { /** * A list of known keywords from hg */ private static final Map IDENTIFIERS = new HashMap(); /** * A list of known message prefixes from hg */ private static final Map MESSAGES = new HashMap(); /** * Number of lines to keep from Std.Err * This size is set to ensure that we capture enough info * but still keeps a low memory footprint. */ private static final int MAX_STDERR_SIZE = 10; /** * A list of the MAX_STDERR_SIZE last errors or warnings. */ private final List stderr = new ArrayList(); static { /** Statuses from hg add */ IDENTIFIERS.put( "adding", ScmFileStatus.ADDED ); IDENTIFIERS.put( "unknown", ScmFileStatus.UNKNOWN ); IDENTIFIERS.put( "modified", ScmFileStatus.MODIFIED ); IDENTIFIERS.put( "removed", ScmFileStatus.DELETED ); IDENTIFIERS.put( "renamed", ScmFileStatus.MODIFIED ); /** Statuses from hg status; */ IDENTIFIERS.put( "A", ScmFileStatus.ADDED ); IDENTIFIERS.put( "?", ScmFileStatus.UNKNOWN ); IDENTIFIERS.put( "M", ScmFileStatus.MODIFIED ); IDENTIFIERS.put( "R", ScmFileStatus.DELETED ); IDENTIFIERS.put( "C", ScmFileStatus.CHECKED_IN ); IDENTIFIERS.put( "!", ScmFileStatus.MISSING ); IDENTIFIERS.put( "I", ScmFileStatus.UNKNOWN ); // not precisely the same, but i think semantics work? - rwd MESSAGES.put( "hg: WARNING:", "WARNING" ); MESSAGES.put( "hg: ERROR:", "ERROR" ); MESSAGES.put( "'hg' ", "ERROR" ); // hg isn't found in windows path } public HgConsumer( ScmLogger logger ) { super( logger ); } public void doConsume( ScmFileStatus status, String trimmedLine ) { //override this } /** {@inheritDoc} */ public void consumeLine( String line ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( line ); } String trimmedLine = line.trim(); String statusStr = processInputForKnownIdentifiers( trimmedLine ); //If its not a status report - then maybe its a message? if ( statusStr == null ) { boolean isMessage = processInputForKnownMessages( trimmedLine ); //If it is then its already processed and we can ignore futher processing if ( isMessage ) { return; } } else { //Strip away identifier trimmedLine = trimmedLine.substring( statusStr.length() ); trimmedLine = trimmedLine.trim(); //one or more spaces } ScmFileStatus status = statusStr != null ? ( (ScmFileStatus) IDENTIFIERS.get( statusStr.intern() ) ) : null; doConsume( status, trimmedLine ); } /** * Warnings and errors is usually printed out in Std.Err, thus for derived consumers * operating on Std.Out this would typically return an empty string. * * @return Return the last lines interpreted as an warning or an error */ public String getStdErr() { String str = ""; for ( Iterator it = stderr.iterator(); it.hasNext(); ) { str += it.next(); } return str; } private static String processInputForKnownIdentifiers( String line ) { for ( Iterator it = IDENTIFIERS.keySet().iterator(); it.hasNext(); ) { String id = (String) it.next(); if ( line.startsWith( id ) ) { return id; } } return null; } private boolean processInputForKnownMessages( String line ) { for ( Iterator it = MESSAGES.keySet().iterator(); it.hasNext(); ) { String prefix = (String) it.next(); if ( line.startsWith( prefix ) ) { stderr.add( line ); //Add line if ( stderr.size() > MAX_STDERR_SIZE ) { stderr.remove( 0 ); //Rotate list } String message = line.substring( prefix.length() ); if ( MESSAGES.get( prefix ).equals( "WARNING" ) ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( message ); } } else { if ( getLogger().isErrorEnabled() ) { getLogger().error( message ); } } return true; } } return false; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/HgCommandConstants.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000661611161143666033422 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command; /* * 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. */ /** * Available/Used hg commands. *

* These commands do not necessarily correspond to the SCM API. * Eg. "check in" is translated to be "commit" and "push". * * @author thurner rupert * @version $Id: HgCommandConstants.java 756914 2009-03-21 10:55:50Z olamy $ */ public class HgCommandConstants { /** * Executable for Hg */ public static final String EXEC = "hg"; /** * Use to create an empty branch or before importing an existing project */ public static final String INIT_CMD = "init"; /** * Default recursive. Common option: --dry-run and --no-recursive */ public static final String ADD_CMD = "add"; /** * Reports the following states: added, removed, modified, unchanged, unknown */ public static final String STATUS_CMD = "status"; /** * Make a file unversioned */ public static final String REMOVE_CMD = "remove"; /** * Create a new copy of a branch. Alias get or clone */ public static final String BRANCH_CMD = "clone"; /** * Commit changes into a new revision */ public static final String COMMIT_CMD = "commit"; /** * update working-copy to tip */ public static final String UPDATE_CMD = "update"; /** * Pull any changes from another branch into the current one */ public static final String PULL_CMD = "pull"; /** * Show log of this branch Common option: --revision */ public static final String LOG_CMD = "log"; /** * Show differences in workingtree. Common option: --revision */ public static final String DIFF_CMD = "diff"; /** * Push this branch into another branch */ public static final String PUSH_CMD = "push"; /** * Show current revision number */ public static final String REVNO_CMD = "id"; /** * Tag this revision */ public static final String TAG_CMD = "tag"; /** * Show list of the current working copy or a revision */ public static final String INVENTORY_CMD = "locate"; /** * no recurse option does not exist in mercurial */ public static final String NO_RECURSE_OPTION = ""; public static final String MESSAGE_OPTION = "--message"; public static final String REVISION_OPTION = "-r"; public static final String VERBOSE_OPTION = "--verbose"; public static final String VERSION = "version"; public static final String CHECK = "check"; public static final String ALL_OPTION = "-A"; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000575211051646056033421 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.inventory; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.list.AbstractListCommand; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; /** * Get a list of all files in the repository * * @author ryan daum * @version $Id: HgListCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgListCommand extends AbstractListCommand implements Command { /** {@inheritDoc} */ protected ListScmResult executeListCommand( ScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion scmVersion ) throws ScmException { if ( fileSet.getFileList().size() != 0 ) { throw new ScmException( "This provider doesn't support listing subsets of a directory" ); } // File workingDir = fileSet.getBasedir(); // build the command String[] listCmd = new String[] { HgCommandConstants.STATUS_CMD, HgCommandConstants.ALL_OPTION }; // keep the command about in string form for reporting StringBuffer cmd = new StringBuffer(); for ( int i = 0; i < listCmd.length; i++ ) { String s = listCmd[i]; cmd.append( s ); if ( i < listCmd.length - 1 ) { cmd.append( " " ); } } HgListConsumer consumer = new HgListConsumer( getLogger() ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, listCmd ); if ( result.isSuccess() ) { return new ListScmResult( consumer.getFiles(), result ); } else { throw new ScmException( "Error while executing command " + cmd.toString() ); } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/inventory/HgListConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000325211051271456033410 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.inventory; /* * 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. */ import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmFile; import java.util.List; import java.util.ArrayList; /** * Get a list of all files in the repository * * @author ryan daum * @version $Id: HgListConsumer.java 686200 2008-08-15 12:14:38Z vsiveton $ */ public class HgListConsumer extends HgConsumer { private List files = new ArrayList(); public HgListConsumer( ScmLogger logger ) { super( logger ); } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { files.add( new ScmFile( trimmedLine, status ) ); } public List getFiles() { return files; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/update/HgUpdateCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001113511161143666033412 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.update; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.changelog.ChangeLogCommand; import org.apache.maven.scm.command.update.AbstractUpdateCommand; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.command.update.UpdateScmResultWithRevision; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.apache.maven.scm.provider.hg.command.changelog.HgChangeLogCommand; import org.apache.maven.scm.provider.hg.command.diff.HgDiffConsumer; import org.codehaus.plexus.util.StringUtils; /** * @author thurner rupert * @version $Id: HgUpdateCommand.java 756914 2009-03-21 10:55:50Z olamy $ */ public class HgUpdateCommand extends AbstractUpdateCommand implements Command { /** {@inheritDoc} */ protected UpdateScmResult executeUpdateCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion tag ) throws ScmException { File workingDir = fileSet.getBasedir(); // Update branch String[] updateCmd = new String[] { HgCommandConstants.PULL_CMD, HgCommandConstants.REVISION_OPTION, tag != null && !StringUtils.isEmpty( tag.getName() ) ? tag.getName() : "tip" }; ScmResult updateResult = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir, updateCmd ); if ( !updateResult.isSuccess() ) { return new UpdateScmResult( null, null, updateResult ); } // Find changes from last revision int currentRevision = HgUtils.getCurrentRevisionNumber( getLogger(), workingDir ); int previousRevision = currentRevision - 1; String[] diffCmd = new String[] { HgCommandConstants.DIFF_CMD, HgCommandConstants.REVISION_OPTION, "" + previousRevision }; HgDiffConsumer diffConsumer = new HgDiffConsumer( getLogger(), workingDir ); ScmResult diffResult = HgUtils.execute( diffConsumer, getLogger(), workingDir, diffCmd ); // Now translate between diff and update file status List updatedFiles = new ArrayList(); List changes = new ArrayList(); List diffFiles = diffConsumer.getChangedFiles(); Map diffChanges = diffConsumer.getDifferences(); for ( Iterator it = diffFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); changes.add( diffChanges.get( file.getPath() ) ); if ( file.getStatus() == ScmFileStatus.MODIFIED ) { updatedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.PATCHED ) ); } else { updatedFiles.add( file ); } } String[] hgUpdateCmd = new String[] { HgCommandConstants.UPDATE_CMD }; HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir, hgUpdateCmd ); return new UpdateScmResultWithRevision( updatedFiles, changes, String.valueOf( currentRevision ), diffResult ); } protected ChangeLogCommand getChangeLogCommand() { HgChangeLogCommand command = new HgChangeLogCommand(); command.setLogger( getLogger() ); return command; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000364711050561465033421 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author thurner rupert * @version $Id: HgCheckOutConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class HgCheckOutConsumer extends HgConsumer { private final File workingDirectory; private final ArrayList checkedOut = new ArrayList(); public HgCheckOutConsumer( ScmLogger logger, File workingDirectory ) { super( logger ); this.workingDirectory = workingDirectory; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String line ) { File file = new File( workingDirectory, line ); if ( file.isFile() ) { checkedOut.add( new ScmFile( line, ScmFileStatus.CHECKED_OUT ) ); } } List getCheckedOutFiles() { return checkedOut; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkout/HgCheckOutCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000704011057610744033412 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.io.IOException; /** * @author thurner rupert * @version $Id: HgCheckOutCommand.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class HgCheckOutCommand extends AbstractCheckOutCommand implements Command { /** {@inheritDoc} */ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion scmVersion, boolean recursive ) throws ScmException { HgScmProviderRepository repository = (HgScmProviderRepository) repo; String url = repository.getURI(); File checkoutDir = fileSet.getBasedir(); try { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Removing " + checkoutDir ); } FileUtils.deleteDirectory( checkoutDir ); } catch ( IOException e ) { throw new ScmException( "Cannot remove " + checkoutDir ); } // Do the actual checkout String[] checkoutCmd = new String[] { HgCommandConstants.BRANCH_CMD, HgCommandConstants.REVISION_OPTION, scmVersion != null && !StringUtils.isEmpty( scmVersion.getName() ) ? scmVersion.getName() : "tip", url, checkoutDir.getAbsolutePath() }; HgConsumer checkoutConsumer = new HgConsumer( getLogger() ); HgUtils.execute( checkoutConsumer, getLogger(), checkoutDir.getParentFile(), checkoutCmd ); // Do inventory to find list of checkedout files String[] inventoryCmd = new String[] { HgCommandConstants.INVENTORY_CMD }; HgCheckOutConsumer consumer = new HgCheckOutConsumer( getLogger(), checkoutDir ); ScmResult result = HgUtils.execute( consumer, getLogger(), checkoutDir, inventoryCmd ); return new CheckOutScmResult( consumer.getCheckedOutFiles(), result ); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000422711051646056033415 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.status; /* * 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. */ import java.io.File; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.status.AbstractStatusCommand; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; /* * @author thurner rupert * * @version $Id: HgStatusCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgStatusCommand extends AbstractStatusCommand implements Command { public HgStatusCommand() { super(); } /** {@inheritDoc} */ public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet ) throws ScmException { File workingDir = fileSet.getBasedir(); HgStatusConsumer consumer = new HgStatusConsumer( getLogger(), workingDir ); String[] statusCmd = new String[] { HgCommandConstants.STATUS_CMD }; ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, statusCmd ); return new StatusScmResult( consumer.getStatus(), result ); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/status/HgStatusConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000474611057610744033424 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author thurner rupert * @version $Id: HgStatusConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ class HgStatusConsumer extends HgConsumer { private final List repositoryStatus = new ArrayList(); private final File workingDir; HgStatusConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "Not a file: " + tmpFile + ". Ignoring" ); } } else if ( tmpFile.isDirectory() ) { if ( getLogger().isInfoEnabled() ) { getLogger().info( "New directory added: " + tmpFile ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, status ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } repositoryStatus.add( scmFile ); } } List getStatus() { return repositoryStatus; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000471711057610744033422 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.remove; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author thurner rupert * @version $Id: HgRemoveConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class HgRemoveConsumer extends HgConsumer { private final File workingDir; private final List removedFiles = new ArrayList(); public HgRemoveConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( status != null && status == ScmFileStatus.DELETED ) { //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Not a file: " + tmpFile + ". Ignored" ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, ScmFileStatus.DELETED ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } removedFiles.add( scmFile ); } } } public List getRemovedFiles() { return removedFiles; } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/remove/HgRemoveCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000425711304273665033423 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.remove; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.remove.AbstractRemoveCommand; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import java.io.File; /** * @author thurner rupert * @version $Id: HgRemoveCommand.java 885134 2009-11-28 19:19:17Z olamy $ */ public class HgRemoveCommand extends AbstractRemoveCommand implements Command { /** {@inheritDoc} */ protected ScmResult executeRemoveCommand( ScmProviderRepository repository, ScmFileSet fileSet, String message ) throws ScmException { String[] command = new String[] { HgCommandConstants.REMOVE_CMD }; command = HgUtils.expandCommandLine( command, fileSet ); File workingDir = fileSet.getBasedir(); HgRemoveConsumer consumer = new HgRemoveConsumer( getLogger(), workingDir ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, command ); return new RemoveScmResult( consumer.getRemovedFiles(), result ); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/tag/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/tag/HgTagConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000257111050561465033414 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; /** * @author ryan daum * @version $Id: HgTagConsumer.java 685548 2008-08-13 13:35:49Z vsiveton $ */ public class HgTagConsumer extends HgConsumer { public HgTagConsumer( ScmLogger logger ) { super( logger ); } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/tag/HgTagCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001257211157300235033410 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.tag; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.tag.AbstractTagCommand; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.apache.maven.scm.provider.hg.command.inventory.HgListConsumer; import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository; import org.codehaus.plexus.util.StringUtils; /** * Tag * * @author ryan daum * @version $Id: HgTagCommand.java 754778 2009-03-15 22:26:37Z olamy $ */ public class HgTagCommand extends AbstractTagCommand implements Command { protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, String tag, String message ) throws ScmException { return executeTagCommand( scmProviderRepository, fileSet, tag, new ScmTagParameters( message ) ); } /** {@inheritDoc} */ protected ScmResult executeTagCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters ) throws ScmException { if ( tag == null || StringUtils.isEmpty( tag.trim() ) ) { throw new ScmException( "tag must be specified" ); } if ( fileSet.getFiles().length != 0 ) { throw new ScmException( "This provider doesn't support tagging subsets of a directory" ); } File workingDir = fileSet.getBasedir(); // build the command String[] tagCmd = new String[] { HgCommandConstants.TAG_CMD, HgCommandConstants.MESSAGE_OPTION, scmTagParameters.getMessage(), tag }; // keep the command about in string form for reporting StringBuffer cmd = joinCmd( tagCmd ); HgTagConsumer consumer = new HgTagConsumer( getLogger() ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, tagCmd ); HgScmProviderRepository repository = (HgScmProviderRepository) scmProviderRepository; if ( result.isSuccess() ) { // now push // Push to parent branch if any if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) ) { String[] pushCmd = new String[] { HgCommandConstants.PUSH_CMD, repository.getURI() }; result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd ); } } else { throw new ScmException( "Error while executing command " + cmd.toString() ); } // do an inventory to return the files tagged (all of them) String[] listCmd = new String[] { HgCommandConstants.INVENTORY_CMD }; HgListConsumer listconsumer = new HgListConsumer( getLogger() ); result = HgUtils.execute( listconsumer, getLogger(), fileSet.getBasedir(), listCmd ); if ( result.isSuccess() ) { List files = listconsumer.getFiles(); ArrayList fileList = new ArrayList(); for ( Iterator i = files.iterator(); i.hasNext(); ) { ScmFile f = (ScmFile) i.next(); if ( !f.getPath().endsWith( ".hgtags" ) ) { fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) ); } } return new TagScmResult( fileList, result ); } else { throw new ScmException( "Error while executing command " + cmd.toString() ); } } private StringBuffer joinCmd( String[] cmd ) { StringBuffer result = new StringBuffer(); for ( int i = 0; i < cmd.length; i++ ) { String s = cmd[i]; result.append( s ); if ( i < cmd.length - 1 ) { result.append( " " ); } } return result; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/checkin/HgCheckInCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001067411051646056033420 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.AbstractCheckInCommand; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.apache.maven.scm.provider.hg.command.status.HgStatusCommand; import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * @author thurner rupert * @version $Id: HgCheckInCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgCheckInCommand extends AbstractCheckInCommand { /** {@inheritDoc} */ protected CheckInScmResult executeCheckInCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion tag ) throws ScmException { if ( tag != null && !StringUtils.isEmpty( tag.getName() ) ) { throw new ScmException( "This provider can't handle tags for this operation" ); } // Get files that will be committed (if not specified in fileSet) List commitedFiles = new ArrayList(); File[] files = fileSet.getFiles(); if ( files.length == 0 ) { //Either commit all changes HgStatusCommand statusCmd = new HgStatusCommand(); statusCmd.setLogger( getLogger() ); StatusScmResult status = statusCmd.executeStatusCommand( repo, fileSet ); List statusFiles = status.getChangedFiles(); for ( Iterator it = statusFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); if ( file.getStatus() == ScmFileStatus.ADDED || file.getStatus() == ScmFileStatus.DELETED || file.getStatus() == ScmFileStatus.MODIFIED ) { commitedFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) ); } } } else { //Or commit spesific files for ( int i = 0; i < files.length; i++ ) { commitedFiles.add( new ScmFile( files[i].getPath(), ScmFileStatus.CHECKED_IN ) ); } } // Commit to local branch String[] commitCmd = new String[]{HgCommandConstants.COMMIT_CMD, HgCommandConstants.MESSAGE_OPTION, message}; commitCmd = HgUtils.expandCommandLine( commitCmd, fileSet ); ScmResult result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), commitCmd ); // Push to parent branch if any HgScmProviderRepository repository = (HgScmProviderRepository) repo; if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) ) { String[] pushCmd = new String[]{HgCommandConstants.PUSH_CMD, repository.getURI()}; result = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd ); } return new CheckInScmResult( commitedFiles, result ); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001175511057621704033420 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author thurner rupert * @version $Id: HgDiffConsumer.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class HgDiffConsumer extends HgConsumer { // private static final String MODIFIED_FILE_TOKEN = "=== modified file "; private static final String INDEX_TOKEN = "diff -r "; private static final String FILE_SEPARATOR_TOKEN = "==="; private static final String START_REVISION_TOKEN = "---"; private static final String END_REVISION_TOKEN = "+++"; private static final String ADDED_LINE_TOKEN = "+"; private static final String REMOVED_LINE_TOKEN = "-"; private static final String UNCHANGED_LINE_TOKEN = " "; private static final String CHANGE_SEPARATOR_TOKEN = "@@"; private static final String NO_NEWLINE_TOKEN = "\\ No newline at end of file"; private static final int HASH_ID_LEN = 12; private ScmLogger logger; private String currentFile; private StringBuffer currentDifference; private List changedFiles = new ArrayList(); private Map differences = new HashMap(); private StringBuffer patch = new StringBuffer(); private File workingDirectory; public HgDiffConsumer( ScmLogger logger, File workingDirectory ) { super( logger ); this.logger = logger; this.workingDirectory = workingDirectory; } // ---------------------------------------------------------------------- // StreamConsumer Implementation // ---------------------------------------------------------------------- /** {@inheritDoc} */ public void consumeLine( String line ) { if ( line.startsWith( INDEX_TOKEN ) ) { // start a new file currentFile = line.substring( INDEX_TOKEN.length() + HASH_ID_LEN + 1 ); changedFiles.add( new ScmFile( currentFile, ScmFileStatus.MODIFIED ) ); currentDifference = new StringBuffer(); differences.put( currentFile, currentDifference ); patch.append( line ).append( "\n" ); return; } if ( currentFile == null ) { if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); return; } if ( line.startsWith( FILE_SEPARATOR_TOKEN ) ) { // skip patch.append( line ).append( "\n" ); } else if ( line.startsWith( START_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, start revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( END_REVISION_TOKEN ) ) { // skip, though could parse to verify filename, end revision patch.append( line ).append( "\n" ); } else if ( line.startsWith( ADDED_LINE_TOKEN ) || line.startsWith( REMOVED_LINE_TOKEN ) || line.startsWith( UNCHANGED_LINE_TOKEN ) || line.startsWith( CHANGE_SEPARATOR_TOKEN ) || line.equals( NO_NEWLINE_TOKEN ) ) { // add to buffer currentDifference.append( line ).append( "\n" ); patch.append( line ).append( "\n" ); } else { // TODO: handle property differences if ( logger.isWarnEnabled() ) { logger.warn( "Unparseable line: '" + line + "'" ); } patch.append( line ).append( "\n" ); // skip to next file currentFile = null; currentDifference = null; } } public List getChangedFiles() { return changedFiles; } public Map getDifferences() { return differences; } public String getPatch() { return patch.toString(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/diff/HgDiffCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000544111051646056033414 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.diff; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.diff.AbstractDiffCommand; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.codehaus.plexus.util.StringUtils; /** * @author thurner rupert * @version $Id: HgDiffCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgDiffCommand extends AbstractDiffCommand implements Command { /** {@inheritDoc} */ protected DiffScmResult executeDiffCommand( ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision ) throws ScmException { String[] diffCmd; if ( startRevision != null && !StringUtils.isEmpty( startRevision.getName() ) ) { String revArg = startRevision.getName(); if ( endRevision != null && !StringUtils.isEmpty( endRevision.getName() ) ) { revArg += ".." + endRevision; } diffCmd = new String[] { HgCommandConstants.DIFF_CMD, HgCommandConstants.REVISION_OPTION, revArg }; } else { diffCmd = new String[] { HgCommandConstants.DIFF_CMD }; } diffCmd = HgUtils.expandCommandLine( diffCmd, fileSet ); HgDiffConsumer consumer = new HgDiffConsumer( getLogger(), fileSet.getBasedir() ); ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), diffCmd ); return new DiffScmResult( consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result ); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000640111051646056033411 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.changelog.AbstractChangeLogCommand; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.changelog.ChangeLogSet; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; /** * @author thurner rupert * @version $Id: HgChangeLogCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgChangeLogCommand extends AbstractChangeLogCommand implements Command { /** {@inheritDoc} */ protected ChangeLogScmResult executeChangeLogCommand( ScmProviderRepository scmProviderRepository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern ) throws ScmException { String[] cmd = new String[] { HgCommandConstants.LOG_CMD, HgCommandConstants.VERBOSE_OPTION }; HgChangeLogConsumer consumer = new HgChangeLogConsumer( getLogger(), datePattern ); ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd ); List logEntries = consumer.getModifications(); List inRangeAndValid = new ArrayList(); startDate = startDate == null ? new Date( 0 ) : startDate; // From 1. Jan 1970 endDate = endDate == null ? new Date() : endDate; // Upto now for ( Iterator it = logEntries.iterator(); it.hasNext(); ) { ChangeSet change = (ChangeSet) it.next(); if ( change.getFiles().size() > 0 ) { if ( !change.getDate().before( startDate ) && !change.getDate().after( endDate ) ) { inRangeAndValid.add( change ); } } } ChangeLogSet changeLogSet = new ChangeLogSet( inRangeAndValid, startDate, endDate ); return new ChangeLogScmResult( changeLogSet, result ); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/changelog/HgChangeLogConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001616711304536546033426 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeFile; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; /** * @author thurner rupert * @version $Id: HgChangeLogConsumer.java 885254 2009-11-29 18:28:54Z olamy $ */ public class HgChangeLogConsumer extends HgConsumer { private static final String TIME_PATTERN = "EEE MMM dd HH:mm:ss yyyy Z"; private static final String REVNO_TAG = "changeset: "; private static final String TAG_TAG = "tag: "; private static final String AUTHOR_TAG = "user: "; private static final String TIME_STAMP_TOKEN = "date: "; private static final String MESSAGE_TOKEN = "description:"; private static final String MERGED_TOKEN = "merged: "; private static final String FILES_TOKEN = "files: "; private String prevLine = ""; private String prevPrevLine = ""; private ArrayList logEntries = new ArrayList(); private ChangeSet currentChange; private ChangeSet lastChange; private boolean isMergeEntry; private String currentRevision; private String currentTag; // don't know what to do with this private String userDatePattern; private boolean spoolingComments; private List currentComment = null; public HgChangeLogConsumer( ScmLogger logger, String userDatePattern ) { super( logger ); this.userDatePattern = userDatePattern; } public List getModifications() { return logEntries; } /** {@inheritDoc} */ public void consumeLine( String line ) { // override default behaviour which tries to pick through things for some standard messages. that // does not apply here doConsume( null, line ); } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String line ) { String tmpLine = line; // If current status == null then this is a new entry // If the line == "" and previous line was "", then this is also a new entry if ( ( line.equals( "" ) && ( prevLine.equals( "" ) && prevPrevLine.equals( "" ) ) ) || currentComment == null ) { if ( currentComment != null ) { StringBuffer comment = new StringBuffer(); for ( int i = 0; i < currentComment.size() - 1; i++ ) { comment.append( currentComment.get( i ) ); if ( i + 1 < currentComment.size() - 1 ) { comment.append( '\n' ); } } currentChange.setComment( comment.toString() ); } spoolingComments = false; //If last entry was part a merged entry if ( isMergeEntry && lastChange != null ) { String comment = lastChange.getComment(); comment += "\n[MAVEN]: Merged from " + currentChange.getAuthor(); comment += "\n[MAVEN]: " + currentChange.getDateFormatted(); comment += "\n[MAVEN]: " + currentChange.getComment(); lastChange.setComment( comment ); } //Init a new changeset currentChange = new ChangeSet(); currentChange.setFiles( new ArrayList() ); logEntries.add( currentChange ); //Reset memeber vars currentComment = new ArrayList(); currentRevision = ""; isMergeEntry = false; } if ( spoolingComments ) { currentComment.add( line ); } else if ( line.startsWith( MESSAGE_TOKEN ) ) { spoolingComments = true; } else if ( line.startsWith( MERGED_TOKEN ) ) { //This is part of lastChange and is not a separate log entry isMergeEntry = true; logEntries.remove( currentChange ); if ( logEntries.size() > 0 ) { lastChange = (ChangeSet) logEntries.get( logEntries.size() - 1 ); } else { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "First entry was unexpectedly a merged entry" ); } lastChange = null; } } else if ( line.startsWith( REVNO_TAG ) ) { tmpLine = line.substring( REVNO_TAG.length() ); tmpLine = tmpLine.trim(); currentRevision = tmpLine; String revision = currentRevision.substring( 0, currentRevision.indexOf( ':' ) ); currentChange.setRevision( revision ); } else if ( line.startsWith( TAG_TAG ) ) { tmpLine = line.substring( TAG_TAG.length() ).trim(); currentTag = tmpLine; } else if ( line.startsWith( AUTHOR_TAG ) ) { tmpLine = line.substring( AUTHOR_TAG.length() ); tmpLine = tmpLine.trim(); currentChange.setAuthor( tmpLine ); } else if ( line.startsWith( TIME_STAMP_TOKEN ) ) { // TODO: FIX Date Parsing to match Mercurial or fix with template tmpLine = line.substring( TIME_STAMP_TOKEN.length() ).trim(); Date date = parseDate( tmpLine, userDatePattern, TIME_PATTERN, Locale.ENGLISH ); currentChange.setDate( date ); } else if ( line.startsWith( FILES_TOKEN ) ) { tmpLine = line.substring( FILES_TOKEN.length() ).trim(); String[] files = tmpLine.split( " " ); for ( int i = 0; i < files.length; i++ ) { String file = files[i]; ChangeFile changeFile = new ChangeFile( file, currentRevision ); currentChange.addFile( changeFile ); } } else { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Could not figure out: " + line ); } } // record previous line prevLine = line; prevPrevLine = prevLine; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddConsumer.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000467011057610744033420 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.add; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgConsumer; import java.io.File; import java.util.ArrayList; import java.util.List; /** * @author thurner rupert * @version $Id: HgAddConsumer.java 691810 2008-09-03 22:38:28Z vsiveton $ */ public class HgAddConsumer extends HgConsumer { private final File workingDir; private final List addedFiles = new ArrayList(); public HgAddConsumer( ScmLogger logger, File workingDir ) { super( logger ); this.workingDir = workingDir; } /** {@inheritDoc} */ public void doConsume( ScmFileStatus status, String trimmedLine ) { if ( status != null && status == ScmFileStatus.ADDED ) { //Only include real files (not directories) File tmpFile = new File( workingDir, trimmedLine ); if ( !tmpFile.exists() ) { if ( getLogger().isWarnEnabled() ) { getLogger().warn( "Not a file: " + tmpFile + ". Ignored" ); } } else { ScmFile scmFile = new ScmFile( trimmedLine, ScmFileStatus.ADDED ); if ( getLogger().isInfoEnabled() ) { getLogger().info( scmFile.toString() ); } addedFiles.add( scmFile ); } } } public List getAddedFiles() { return addedFiles; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/command/add/HgAddCommand.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000000577011051646056033421 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.command.add; /* * 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. */ import java.io.File; import java.util.Iterator; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.command.Command; import org.apache.maven.scm.command.add.AbstractAddCommand; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.HgUtils; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; /** * Add no recursive. * * @author thurner rupert * @version $Id: HgAddCommand.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgAddCommand extends AbstractAddCommand implements Command { /** {@inheritDoc} */ protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary ) throws ScmException { //String[] addCmd = new String[] { ADD_CMD, NO_RECURSE_OPTION }; String[] addCmd = new String[] { HgCommandConstants.ADD_CMD, HgCommandConstants.VERBOSE_OPTION }; addCmd = HgUtils.expandCommandLine( addCmd, fileSet ); File workingDir = fileSet.getBasedir(); HgAddConsumer consumer = new HgAddConsumer( getLogger(), workingDir ); ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, addCmd ); AddScmResult addScmResult = new AddScmResult( consumer.getAddedFiles(), result ); // add in bogus 'added' results for empty directories. only need to do this because the maven scm unit test // framework seems to think that this is the way we should behave. it's pretty hacky. -rwd for ( Iterator iterator = fileSet.getFileList().iterator(); iterator.hasNext(); ) { File workingFile = (File) iterator.next(); File file = new File( workingDir + "/" + workingFile.getPath() ); if ( file.isDirectory() && file.listFiles().length == 0 ) { addScmResult.getAddedFiles().add( workingFile ); } } return addScmResult; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgUtils.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001732111057621704033413 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Common code for executing hg commands. * * @author thurner rupert * @version $Id: HgUtils.java 691832 2008-09-03 23:54:44Z vsiveton $ */ public class HgUtils { /** * Map between command and its valid exit codes */ private static final Map EXIT_CODE_MAP = new HashMap(); /** * Default exit codes for entries not in exitCodeMap */ private static final List DEFAULT_EXIT_CODES = new ArrayList(); /** Setup exit codes*/ static { DEFAULT_EXIT_CODES.add( new Integer( 0 ) ); //Diff is different List diffExitCodes = new ArrayList(); diffExitCodes.add( new Integer( 0 ) ); //No difference diffExitCodes.add( new Integer( 1 ) ); //Conflicts in merge-like or changes in diff-like diffExitCodes.add( new Integer( 2 ) ); //Unrepresentable diff changes EXIT_CODE_MAP.put( HgCommandConstants.DIFF_CMD, diffExitCodes ); } public static ScmResult execute( HgConsumer consumer, ScmLogger logger, File workingDir, String[] cmdAndArgs ) throws ScmException { try { //Build commandline Commandline cmd = buildCmd( workingDir, cmdAndArgs ); if ( logger.isInfoEnabled() ) { logger.info( "EXECUTING: " + cmd ); } //Execute command int exitCode = executeCmd( consumer, cmd ); //Return result List exitCodes = DEFAULT_EXIT_CODES; if ( EXIT_CODE_MAP.containsKey( cmdAndArgs[0] ) ) { exitCodes = (List) EXIT_CODE_MAP.get( cmdAndArgs[0] ); } boolean success = exitCodes.contains( new Integer( exitCode ) ); //On failure (and not due to exceptions) - run diagnostics String providerMsg = "Execution of hg command succeded"; if ( !success ) { HgConfig config = new HgConfig( workingDir ); providerMsg = "\nEXECUTION FAILED" + "\n Execution of cmd : " + cmdAndArgs[0] + " failed with exit code: " + exitCode + "." + "\n Working directory was: " + "\n " + workingDir.getAbsolutePath() + config.toString( workingDir ) + "\n"; if ( logger.isErrorEnabled() ) { logger.error( providerMsg ); } } return new ScmResult( cmd.toString(), providerMsg, consumer.getStdErr(), success ); } catch ( ScmException se ) { String msg = "EXECUTION FAILED" + "\n Execution failed before invoking the Hg command. Last exception:" + "\n " + se.getMessage(); //Add nested cause if any if ( se.getCause() != null ) { msg += "\n Nested exception:" + "\n " + se.getCause().getMessage(); } //log and return if ( logger.isErrorEnabled() ) { logger.error( msg ); } throw se; } } static Commandline buildCmd( File workingDir, String[] cmdAndArgs ) throws ScmException { Commandline cmd = new Commandline(); cmd.setExecutable( HgCommandConstants.EXEC ); cmd.setWorkingDirectory( workingDir.getAbsolutePath() ); cmd.addArguments( cmdAndArgs ); if ( !workingDir.exists() ) { boolean success = workingDir.mkdirs(); if ( !success ) { String msg = "Working directory did not exist" + " and it couldn't be created: " + workingDir; throw new ScmException( msg ); } } return cmd; } static int executeCmd( HgConsumer consumer, Commandline cmd ) throws ScmException { final int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cmd, consumer, consumer ); } catch ( CommandLineException ex ) { throw new ScmException( "Command could not be executed: " + cmd, ex ); } return exitCode; } public static ScmResult execute( File workingDir, String[] cmdAndArgs ) throws ScmException { ScmLogger logger = new DefaultLog(); return execute( new HgConsumer( logger ), logger, workingDir, cmdAndArgs ); } public static String[] expandCommandLine( String[] cmdAndArgs, ScmFileSet additionalFiles ) { List filesList = additionalFiles.getFileList(); String[] cmd = new String[filesList.size() + cmdAndArgs.length]; // Copy command into array System.arraycopy( cmdAndArgs, 0, cmd, 0, cmdAndArgs.length ); // Add files as additional parameter into the array int i = 0; for ( Iterator iterator = filesList.iterator(); iterator.hasNext(); i++ ) { File scmFile = (File) iterator.next(); String file = scmFile.getPath().replace( '\\', File.separatorChar ); cmd[i + cmdAndArgs.length] = file; } return cmd; } public static int getCurrentRevisionNumber( ScmLogger logger, File workingDir ) throws ScmException { String[] revCmd = new String[]{HgCommandConstants.REVNO_CMD}; HgRevNoConsumer consumer = new HgRevNoConsumer( logger ); HgUtils.execute( consumer, logger, workingDir, revCmd ); return consumer.getCurrentRevisionNumber(); } /** * Get current (working) revision. *

* Resolve revision to the last integer found in the command output. */ private static class HgRevNoConsumer extends HgConsumer { private int revNo; HgRevNoConsumer( ScmLogger logger ) { super( logger ); } public void doConsume( ScmFileStatus status, String line ) { try { revNo = Integer.valueOf( line ).intValue(); } catch ( NumberFormatException e ) { // ignore } } int getCurrentRevisionNumber() { return revNo; } } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536671033415 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001616011052265355033414 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; import org.codehaus.plexus.util.StringUtils; import java.io.File; /** * @author thurner rupert * @version $Id: HgScmProviderRepository.java 686735 2008-08-18 12:28:29Z vsiveton $ */ public class HgScmProviderRepository extends ScmProviderRepositoryWithHost { //Known and tested protocols private static final String FILE = ""; private static final String SFTP = "sftp://"; private static final String FTP = "ftp://"; private static final String AFTP = "aftp://"; private static final String HTTP = "http://"; private static final String HTTPS = "https://"; private final String path; private final String protocol; private final String orgUrl; public HgScmProviderRepository( String url ) { orgUrl = url; protocol = getProtocol( url ); path = parseUrl( url ); } public String getURI() { return protocol + ( needsAuthentication() ? addUser() + addPassword() + addAt() : "" ) + addHost() + addPort() + addPath(); } /** * @return A message if the repository as an invalid URI, null if the URI seems fine. */ public String validateURI() { String msg = null; if ( needsAuthentication() ) { if ( getUser() == null ) { msg = "Username is missing for protocol " + protocol; } else if ( getPassword() == null ) { msg = "Password is missing for protocol " + protocol; } else if ( getHost() == null ) { msg = "Host (eg. www.myhost.com) is missing for protocol " + protocol; } } else if ( getPort() != 0 && getHost() == null ) { msg = "Got port information without any host for protocol " + protocol; } if ( msg != null ) { msg = "Something could be wrong about the repository URL: " + orgUrl + "\nReason: " + msg + "\nCheck http://maven.apache.org/scm for usage and hints."; } return msg; } private String getProtocol( String url ) { // Assume we have a file unless we find a URL based syntax String prot = FILE; if ( url.startsWith( SFTP ) ) { prot = SFTP; } else if ( url.startsWith( HTTP ) ) { prot = HTTP; } else if ( url.startsWith( HTTPS ) ) { prot = HTTPS; } return prot; } private String parseUrl( String url ) { if ( protocol == FILE ) { return url; } //Strip protocol url = url.substring( protocol.length() ); url = parseUsernameAndPassword( url ); url = parseHostAndPort( url ); url = parsePath( url ); return url; //is now only the path } private String parseHostAndPort( String url ) { if ( protocol != FILE ) { int indexSlash = url.indexOf( "/" ); String hostPort = url; if ( indexSlash > 0 ) { hostPort = url.substring( 0, indexSlash ); } int indexColon = hostPort.indexOf( ":" ); if ( indexColon > 0 ) { setHost( hostPort.substring( 0, indexColon ) ); url = StringUtils.replace( url, getHost(), "" ); setPort( Integer.parseInt( hostPort.substring( indexColon + 1 ) ) ); url = StringUtils.replace( url, ":" + getPort(), "" ); } else { setHost( hostPort ); url = StringUtils.replace( url, getHost(), "" ); } } return url; } private String parseUsernameAndPassword( String url ) { if ( needsAuthentication() ) { String[] split = url.split( "@" ); if ( split.length == 2 ) { url = split[1]; //Strip away 'username:password@' from url split = split[0].split( ":" ); if ( split.length == 2 ) { //both username and password setUser( split[0] ); setPassword( split[1] ); } else { //only username setUser( split[0] ); } } } return url; } private String parsePath( String url ) { if ( protocol == FILE ) { //Use OS dependent path separator url = StringUtils.replace( url, "/", File.separator ); //Test first path separator (*nix systems use them to denote root) File tmpFile = new File( url ); //most likly a *nix system String url2 = url.substring( File.pathSeparator.length() ); File tmpFile2 = new File( url2 ); //most likly a windows system if ( !tmpFile.exists() && !tmpFile2.exists() ) { // This is trouble - Trouble is reported in validateURI() } url = tmpFile2.exists() ? url2 : url; } return url; } private String addUser() { return ( getUser() == null ) ? "" : getUser(); } private String addPassword() { return ( getPassword() == null ) ? "" : ":" + getPassword(); } private String addAt() { return needsAuthentication() ? "@" : ""; } private String addHost() { return ( getHost() == null ) ? "" : getHost(); } private String addPort() { return ( getPort() == 0 ) ? "" : ":" + getPort(); } private String addPath() { return path; } private boolean needsAuthentication() { return protocol == SFTP || protocol == FTP || protocol == HTTPS || protocol == AFTP; } /** {@inheritDoc} */ public String toString() { return "Hg Repository Interpreted from: " + orgUrl + ":\nProtocol: " + protocol + "\nHost: " + getHost() + "\nPort: " + getPort() + "\nUsername: " + getUser() + "\nPassword: " + getPassword() + "\nPath: " + path; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgConfig.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000001257411051646056033421 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg; /* * 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. */ import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.log.DefaultLog; import org.apache.maven.scm.provider.hg.command.HgCommandConstants; import org.apache.maven.scm.provider.hg.command.HgConsumer; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; /** * Check hg installation. * * @author thurner rupert * @author ryan daum * @version $Id: HgConfig.java 686566 2008-08-16 21:52:46Z olamy $ */ public class HgConfig { //Minimum version for the Hg SCM private static final String HG_REQ = "0.9.2"; // The string which indicates the beginning of the Mercurial line private static final String HG_VERSION_TAG = "ercurial Distributed SCM (version "; // URL to download mercurial from private static final String HG_INSTALL_URL = "'http://www.selenic.com/mercurial/wiki/index.cgi/Download'"; //Configuration to check with default values (not installed) private HgVersionConsumer hgVersion = new HgVersionConsumer( null ); HgConfig( File workingDir ) { try { hgVersion = getHgVersion( workingDir ); } catch ( ScmException e ) { //Ignore - is not installed. //This is already recorded thus we do not generate more info. } } /** * @return True if one can run basic hg commands */ private boolean isInstalled() { return hgVersion.isVersionOk( HG_REQ ); } /** * @return True if all modules for hg are installed. */ private boolean isComplete() { return isInstalled(); } // Consumer to find the Mercurial version public static HgVersionConsumer getHgVersion( File workingDir ) throws ScmException { String[] versionCmd = new String[]{HgCommandConstants.VERSION}; HgVersionConsumer consumer = new HgVersionConsumer( HG_VERSION_TAG ); Commandline cmd = HgUtils.buildCmd( workingDir, versionCmd ); // Execute command HgUtils.executeCmd( consumer, cmd ); // Return result return consumer; } /** * Iterate through two dot-notation version strings, normalize them to the same length, then * do alphabetic comparison * * @param version1 * @param version2 * @return true if version2 is greater than version1 */ private static boolean compareVersion( String version1, String version2 ) { int l1, l2; String v1, v2; v1 = version1; v2 = version2; l1 = version1.length(); l2 = version2.length(); if ( l1 > l2 ) { for ( int x = l2; x >= l1; x-- ) { v2 += ' '; } } if ( l2 > l1 ) { for ( int x = l1; x <= l2; x++ ) { v1 += ' '; } } return v2.compareTo( v1 ) >= 0; } /** * Get version of the executable. * Version is resolved by splitting the line starting with the version tag and finding * the second last word. */ private static class HgVersionConsumer extends HgConsumer { private String versionStr = "NA"; private String versionTag; HgVersionConsumer( String versionTag ) { super( new DefaultLog() ); this.versionTag = versionTag; } public void doConsume( ScmFileStatus status, String line ) { if ( line.startsWith( versionTag ) ) { String[] elements = line.split( " " ); versionStr = elements[elements.length - 1].split( "\\)" )[0]; } } String getVersion() { return versionStr; } boolean isVersionOk( String version ) { // build one number out of the whole version # return compareVersion( version, versionStr ); } } private String getInstalledStr() { if ( isComplete() ) { return "valid and complete."; } return ( isInstalled() ? "incomplete. " : "invalid. " ) + "Consult " + HG_INSTALL_URL; } public String toString( File workingDir ) { boolean hgOk = hgVersion.isVersionOk( HG_REQ ); return "\n Your Hg installation seems to be " + getInstalledStr() + "\n Hg version: " + hgVersion.getVersion() + ( hgOk ? " (OK)" : " (May be INVALID)" ) + "\n"; } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/HgScmProvider.javamaven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/0000644000175000017500000002312311051646056033411 0ustar twernertwernerpackage org.apache.maven.scm.provider.hg; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.maven.scm.CommandParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.provider.hg.command.add.HgAddCommand; import org.apache.maven.scm.provider.hg.command.changelog.HgChangeLogCommand; import org.apache.maven.scm.provider.hg.command.checkin.HgCheckInCommand; import org.apache.maven.scm.provider.hg.command.checkout.HgCheckOutCommand; import org.apache.maven.scm.provider.hg.command.diff.HgDiffCommand; import org.apache.maven.scm.provider.hg.command.remove.HgRemoveCommand; import org.apache.maven.scm.provider.hg.command.status.HgStatusCommand; import org.apache.maven.scm.provider.hg.command.tag.HgTagCommand; import org.apache.maven.scm.provider.hg.command.update.HgUpdateCommand; import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; /** * Mercurial (HG) is a decentralized revision control system. * http://www.selenic.com/mercurial * * @author thurner rupert * @version $Id: HgScmProvider.java 686566 2008-08-16 21:52:46Z olamy $ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" * role-hint="hg" */ public class HgScmProvider extends AbstractScmProvider { /** {@inheritDoc} */ public String getScmSpecificFilename() { return ".hg"; } private static class HgUrlParserResult { private List messages = new ArrayList(); private ScmProviderRepository repository; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { HgUrlParserResult result = parseScmUrl( scmSpecificUrl ); if ( result.messages.size() > 0 ) { throw new ScmRepositoryException( "The scm url is invalid.", result.messages ); } return result.repository; } private HgUrlParserResult parseScmUrl( String scmSpecificUrl ) { HgUrlParserResult result = new HgUrlParserResult(); String url = scmSpecificUrl; // ---------------------------------------------------------------------- // Do some sanity checking of the SVN url // ---------------------------------------------------------------------- if ( url.startsWith( "file" ) ) { if ( !url.startsWith( "file:///" ) && !url.startsWith( "file://localhost/" ) ) { result.messages.add( "An hg 'file' url must be on the form 'file:///' or 'file://localhost/'." ); return result; } } else if ( url.startsWith( "https" ) ) { if ( !url.startsWith( "https://" ) ) { result.messages.add( "An hg 'http' url must be on the form 'https://'." ); return result; } } else if ( url.startsWith( "http" ) ) { if ( !url.startsWith( "http://" ) ) { result.messages.add( "An hg 'http' url must be on the form 'http://'." ); return result; } } else { try { File file = new File( url ); } catch ( Throwable e ) { result.messages.add( "The filename provided is not valid" ); return result; } } result.repository = new HgScmProviderRepository( url ); return result; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { if ( path == null || !path.isDirectory() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a valid directory." ); } File hgDir = new File( path, ".hg" ); if ( !hgDir.exists() ) { throw new ScmRepositoryException( path.getAbsolutePath() + " isn't a hg directory." ); } return makeProviderScmRepository( path.getAbsolutePath(), ':' ); } /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { HgUrlParserResult result = parseScmUrl( scmSpecificUrl ); return result.messages; } /** {@inheritDoc} */ public String getScmType() { return "hg"; } /** {@inheritDoc} */ public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgAddCommand command = new HgAddCommand(); command.setLogger( getLogger() ); return (AddScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgChangeLogCommand command = new HgChangeLogCommand(); command.setLogger( getLogger() ); return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgCheckInCommand command = new HgCheckInCommand(); command.setLogger( getLogger() ); return (CheckInScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgCheckOutCommand command = new HgCheckOutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgTagCommand command = new HgTagCommand(); command.setLogger( getLogger() ); return (TagScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgDiffCommand command = new HgDiffCommand(); command.setLogger( getLogger() ); return (DiffScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgRemoveCommand command = new HgRemoveCommand(); command.setLogger( getLogger() ); return (RemoveScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgStatusCommand command = new HgStatusCommand(); command.setLogger( getLogger() ); return (StatusScmResult) command.execute( repository, fileSet, parameters ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) throws ScmException { HgUpdateCommand command = new HgUpdateCommand(); command.setLogger( getLogger() ); return (UpdateScmResult) command.execute( repository, fileSet, parameters ); } } maven-scm-1.3/maven-scm-providers/maven-scm-provider-hg/pom.xml0000644000175000017500000000437011322611461024532 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm-providers 1.3 maven-scm-provider-hg Maven SCM Mercurial (Hg) Provider SCM Provider implementation for Mercurial Hg (http://www.selenic.com/mercurial/wiki/). Thurner Rupert thurner.rupert@ymono.net Alain Hoang hoanga@alum.rpi.edu Ryan Daum ryan@darksleep.com regexp regexp org.codehaus.plexus plexus-maven-plugin descriptor maven-scm-1.3/maven-scm-providers/pom.xml0000644000175000017500000000707211322611461020422 0ustar twernertwerner 4.0.0 maven-scm org.apache.maven.scm 1.3 maven-scm-providers pom Maven SCM Providers Parent for all SCM providers supported. maven-scm-provider-accurev maven-scm-provider-bazaar maven-scm-provider-clearcase maven-scm-providers-cvs maven-scm-provider-hg maven-scm-providers-git maven-scm-provider-local maven-scm-provider-perforce maven-scm-providers-standard maven-scm-provider-starteam maven-scm-providers-svn maven-scm-provider-synergy maven-scm-provider-vss maven-scm-provider-tfs regexp regexp 1.3 org.apache.maven.scm maven-scm-api org.apache.maven.scm maven-scm-test test default true org.apache.maven.plugins maven-surefire-plugin **/*TckTest.java tck org.apache.maven.plugins maven-surefire-plugin **/*Test*.java maven-scm-1.3/src/0000755000175000017500000000000011345536673014005 5ustar twernertwernermaven-scm-1.3/src/site/0000755000175000017500000000000011345536673014751 5ustar twernertwernermaven-scm-1.3/src/site/resources/0000755000175000017500000000000011345536673016763 5ustar twernertwernermaven-scm-1.3/src/site/resources/images/0000755000175000017500000000000011345536673020230 5ustar twernertwernermaven-scm-1.3/src/site/resources/images/error.gif0000644000175000017500000000117111051551223022026 0ustar twernertwernerGIF89aæ¢ØÔØä`:Û&ÑŒŒÿýøÇÜA)ìwOÝêîÛ8È'Ô¹½ÿMãåå·ñ;ñfCæQ3ÿàºâ¬ ñññ ÿ¤gÌ2ÿnñA÷O)ð3Ò· ÿsDÿêàÞ‰ÿJñôô躰® ï)õÜÖŸ ý¡‘ÿšVÒ5ÿf3î×ÓãL1ëT8Åÿ<÷÷÷ã3øÙÏÖ?(ùDäÇÀÌ™™ôãß蛓äíî×äØÙÿøï¾ ÿ„Eå@Ç! ¦ ¼ øb;õ4ª æ ÷iH® ö8úg@ÿïêì[<îJ&Ê-ïJ!÷HÿR(ÿÞÐßH,ܸ¶ÿŽVÓ7!¶ ÿÿÿ¦ õîîØàC Ïí3ìT.÷4ÿßÔ÷÷ÿï]?° ÑàíñõeBÿíÞø(­à××ð_=Â'ÿ«mïB!ÿKïÁ°ÿ \Ó6ìßÙöE¿ÿZ)!ùÿ,Ö€Z‚ƒ„…‚)LIIeN/.U5:‚Et*@,y6ww P‚ipu 3"1F'KH: ÚÛQ[‚7#9 ¸VL‚,998€ý¢Ä –,!(£áDŒir…K-A ¤<$J”+^j@eI’&Q¬dá"ÒHºxaâ"¤›ƒ;maven-scm-1.3/src/site/resources/images/check.gif0000644000175000017500000000113411051551223021751 0ustar twernertwernerGIF89aælœàwOÀ&×ìÊ.°„µ„™²Ö²fÈC¨ ˆ9Œ;¿è¿úöüùêúm&:µ…Ìz§Éªï÷ï…ÑáÑyÓL,'fÌ3 £§åƒ•Üw@¦AsP¾;êæìE»"r2ˆØ^. *…%£ßïÛ}!”lÆSŒÅŒ:µ!f3žõðöˆ¿Ž*ª ©~ÓY|)ÿÿÿZÅ,G¼!'­ éóÜ/¨$z$­Bµ!¸ß¸†»†1¨(‘sÊVl:›Ý{TÃ):”:B«BËŽMÀ' )¥)3¯"ª ÿ÷ÿ@¹–Ûxq6‰Øa†­>´+ÿÿÿ!ùW,¹€W‚ƒ„…†HG##*†‚ LB31(>… @"E7 K™ƒLŸ  <‚H)S«6J N&OI?‚6 E 8&55Q/ ‚#3%0–ÌË` â‰!òAAÁ‹'B<è ÑЄ vtXPà¡£—ƒ;maven-scm-1.3/src/site/resources/css/0000755000175000017500000000000011345536673017553 5ustar twernertwernermaven-scm-1.3/src/site/resources/css/site.css0000644000175000017500000000306610535556312021226 0ustar twernertwerner/* * 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. */ a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { background: none; padding-right: 0; } /* body ul { list-style-type: square; } */ #downloadbox { float: right; margin: 0 10px 20px 20px; padding: 5px; border: 1px solid #999; background-color: #eee; } #downloadbox h5 { color: #000; margin: 0; border-bottom: 1px solid #aaaaaa; font-size: smaller; padding: 0; } #downloadbox p { margin-top: 1em; margin-bottom: 0; } #downloadbox ul { margin-top: 0; margin-bottom: 1em; list-style-type: disc; } #downloadbox li { font-size: smaller; } /* h4 { padding: 0; border: none; color: #000; margin: 0; font-size: larger; font-weight: bold; } */ maven-scm-1.3/src/site/site.xml0000644000175000017500000000501411246172601016422 0ustar twernertwerner org.apache.maven.skins maven-stylus-skin 1.1

maven-scm-1.3/src/site/xdoc/0000755000175000017500000000000011345536673015706 5ustar twernertwernermaven-scm-1.3/src/site/xdoc/matrix.xml0000644000175000017500000005005711246172601017726 0ustar twernertwerner Maven SCM Providers Matrix Vincent Siveton

This matrix presents all SCM providers acutally supported by the Maven SCM project.

SCM add branch changelog checkin checkout diff edit export list login remove status tag unedit update Pure Java
Bazaar
Clearcase
CM Synergy
CVS
CVS (Pure Java client)
GIT
Local
Mercurial (hg)
Microsoft TFS
Microsoft VSS
Perforce
Starteam
Subversion

Keys:

  • : Functional
  • : Doesn't exist in SCM tool
  • : Not implemented

maven-scm-1.3/src/site/apt/0000755000175000017500000000000011345536673015535 5ustar twernertwernermaven-scm-1.3/src/site/apt/scms-overview.apt0000644000175000017500000000352711246172601021046 0ustar twernertwerner ------ Overview of SCM's ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Overview of SCM's Maven SCM supports many SCM's. This is a list of all currently known SCM's: * Fully implemented SCM's * {{{bazaar.html}Bazaar}} * {{{cvs.html}CVS}} * {{{mercurial.html}Mercurial}} * {{{perforce.html}Perforce}} * {{{starteam.html}StarTeam}} * {{{subversion.html}Subversion}} * {{{synergy.html}CM Synergy}} * Partially implemented SCM's * {{{accurev.html}Accurev}} * {{{clearcase.html}ClearCase}} * {{{git.html}Git}} * {{{local.html}File system}} * {{{vss.html}Visual Source Safe}} * {{{tfs.html}Team Foundation Server}} * Not implemented SCM's This is a list of all the known SCM's that are not implemented currently. * Aegis * Arch * BitKeeper * ClearCase Multisite * Code Co-op * Darcs * Monotone * OpenCM * PureCM * Serena PVCS / Dimension * Starteam Enterprise * Svk * Vesta maven-scm-1.3/src/site/apt/guide/0000755000175000017500000000000011345536673016632 5ustar twernertwernermaven-scm-1.3/src/site/apt/guide/new_provider.apt0000644000175000017500000002100511237266723022035 0ustar twernertwerner ------ How to write a new SCM provider ------ Maven Team ------ 2007-03-27 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html How to write a new SCM provider? * What are the steps to write a new Maven-SCM provider? * Define allowed scm urls for this provider * Create a class that extends <<>> or <<>>, this class is the corresponding bean of the scm url * Create a class that extends <<>>. This class parse the scm url and link all scm commands methods to their implementations. Important methods are <<>> and <<>> * Implement all commands and link them in the scm provider class created in the step above * For each command, implement junit tests that test the command line format * For each command, implement TCK tests * Test the release plugin with the new provider. For that, you must add the dependency to the release plugin and run it * Add the dependency to Continuum libs and test the provider with a sample project * Update the site [] In the next section, we'll see all the steps in details to write a new Maven-SCM provider. * Create a new Maven project for the provider Your project need to use some jars from the Maven-SCM framework. Add them to your POM. +------------------------------------------+ maven-scm-providers org.apache.maven.scm LATEST VERSION OF MAVEN-SCM PROVIDERS MASTER POM 4.0.0 maven-scm-provider-YOUR_PROVIDER_NAME My Maven-SCM Provider 1.0-SNAPSHOT org.codehaus.plexus plexus-maven-plugin 1.3.8 descriptor +------------------------------------------+ The plexus maven plugin will generate the plexus meta-data file used by the Maven-SCM manager. * Create an SCM Provider Repository class This class will contain all SCM information about your SCM connection (user, password, host, port, path...). +------------------------------------------+ package org.apache.maven.scm.provider.myprovider.repository; import org.apache.maven.scm.provider.ScmProviderRepository; public class MyScmProviderRepository extends ScmProviderRepository { } +------------------------------------------+ Before you add more information to this class, you can look at the <<>> sub-classes, if they are already implemented. * Create the Provider class This class is the central point of the provider. The Maven-SCM framework will know only this class in the provider, so this class must validate the scm url, populate the <<>> and provide all commands supported by your provider. We start with a basic class, then we'll add commands to it when we implement them. Before you start to write your SCM provider, you must define the SCM URLs you want to support. +------------------------------------------+ package org.apache.maven.scm.provider.myprovider; import org.apache.maven.scm.provider.myprovider.repository.MyScmProviderRepository; import org.apache.maven.scm.provider.AbstractScmProvider; import org.apache.maven.scm.provider.ScmProviderRepository; import org.apache.maven.scm.repository.ScmRepositoryException; /** * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="provider_name" */ public class MyScmProvider extends AbstractScmProvider { public String getScmType() { return "provider_name"; } /** * This method parse the scm URL and return a SCM provider repository. * At this point, the scmSpecificUrl is the part after scm:provider_name: in your SCM URL. */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { MyScmProviderRepository providerRepository = new MyScmProviderRepository(); //Parse scmSpecificUrl and populate there your provider repository return providerRepository; } } +------------------------------------------+ The javadoc tag will be used by the plexus maven plugin, declared in the POM, to generate plexus meta-data. Generally, we use the string just after in the scm URL as the . * Commands implementation When you write a new SCM command, you must extend base classes for the Maven-SCM framework. We have one base command for each command supported by Maven-SCM and each command have an <<>> method that return an SCM result. +------------------------------------------+ package org.apache.maven.scm.provider.myprovider.command.checkout; import org.apache.maven.scm.command.checkout.AbstractCheckOutCommand; public class MyCheckoutCommand extends AbstractCheckOutCommand { protected abstract CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { CheckOutScmResult result = new CheckOutScmResult(); //Add the code there to run the command //If you need to run a native commandline like cvs/svn/cleartool..., look at other providers how to launch it and parse the output return result; } } +------------------------------------------+ * Allow the command in the SCM provider Now that your command is implemented, you need to add it in your SCM provider (<<>>). Open the provider class and override the method that relates to your command. +------------------------------------------+ public class MyScmProvider extends AbstractScmProvider { ... protected CheckOutScmResult checkout( ScmRepository repository, ScmFileSet fileSet, CommandParameters params ) throws ScmException { MyCheckoutCommand command = new MyCheckoutCommand(); command.setLogger( getLogger() ); return (CheckOutScmResult) command.execute( repository.getProviderRepository(), fileSet, params ); } } +------------------------------------------+ * Provider Tests ** Automated tests To be sure your provider works as expected, you must implement some tests. You can implement two levels of tests: * Simple JUnit tests that use your command directly and test that the command line you launch in your SCM command is correct * Implementation of the TCK. The TCK provides a set of tests that validate that your implementation is compatible with the Maven-SCM framework. The TCK requires access to the SCM tool. ** Other tests You can do manual tests in the real world with the Maven-SCM plugin, the maven release plugin, the maven changelog plugin and Continuum. It's important to test your SCM provider with these tools, because they are used by users that will use your provider. * Document your provider Now that your provider works fine, you must document it (which scm URLs are supported, which commands are supported...). You can use the same template that is used by the other providers. maven-scm-1.3/src/site/apt/guide/usage.apt0000644000175000017500000001406011051550673020433 0ustar twernertwerner ------ How to use Maven-SCM in my application ------ Maven Team ------ 2007-03-26 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html How to use Maven-SCM in my application? * Create an SCM Manager ** With Plexus IOC With {{{http://plexus.codehaus.org}Plexus}}, it's very easy to use Maven SCM because it injects all dependencies in fields, so you only have to write minimal code. +------------------------------------------+ import org.apache.maven.scm.manager.ScmManager; public class MyApp { private ScmManager scmManager; public MyApp() { plexus = new Embedder(); plexus.start(); scmManager = (ScmManager) plexus.lookup( ScmManager.ROLE ); } public ScmManager getScmManager() { return scmManager; } +------------------------------------------+ ** Without Plexus IOC Without Plexus, you must add all your SCM providers in the manager and that will require more work. You can use the basic SCM manager or write your own: +------------------------------------------+ import org.apache.maven.scm.manager.BasicScmManager; public class MyApp { private ScmManager scmManager; public MyApp() { scmManager = new BasicScmManager(); //Add all SCM providers we want to use scmManager.setScmProvider( "cvs", new CvsJavaScmProvider() ); scmManager.setScmProvider( "svn", new SvnExeScmProvider() ); ... } public ScmManager getScmManager() { return scmManager; } +------------------------------------------+ * Run a SCM command Before you call a command, the SCM manager needs an <<>>. This object contains all the information about the SCM connection. +------------------------------------------+ public ScmRepository getScmRepository( String scmUrl ) throw Exception { ScmRepository repository; try { return getScmManager().makeScmRepository( scmUrl ); } catch ( NoSuchScmProviderException ex ) { throw new Exception( "Could not find a provider." ); } catch ( ScmRepositoryException ex ) { throw new Exception( "Error while connecting to the repository" ); } } +------------------------------------------+ ** Checkout command +------------------------------------------+ public void checkOut( ScmRepository scmRepository, File workingDirectory ) throws ScmException { if ( workingDirectory.exists() ) { System.err.println( "The working directory already exist: '" + workingDirectory.getAbsolutePath() + "'." ); return; } if ( !workingDirectory.mkdirs() ) { System.err.println( "Error while making the working directory: '" + workingDirectory.getAbsolutePath() + "'." ); return; } CheckOutScmResult result = scmManager.checkOut( scmRepository, new ScmFileSet( workingDirectory ) ); checkResult( result ); List checkedOutFiles = result.getCheckedOutFiles(); System.out.println( "Checked out these files: " ); for ( Iterator it = checkedOutFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); System.out.println( " " + file.getPath() ); } } +------------------------------------------+ ** Update command +------------------------------------------+ public void update( ScmRepository scmRepository, File workingDirectory ) throws ScmException { if ( !workingDirectory.exists() ) { System.err.println( "The working directory doesn't exist: '" + workingDirectory.getAbsolutePath() + "'." ); return; } UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( workingDirectory ) ); checkResult( result ); List updatedFiles = result.getUpdatedFiles(); System.out.println( "Updated these files: " ); for ( Iterator it = updatedFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); System.out.println( " " + file.getPath() ); } } +------------------------------------------+ * The checkResult method In each sample command code, we use the <<>> method, it isn't required but can be useful if something failed in the command execution. +------------------------------------------+ public void checkResult( ScmResult result ) throws Exception { if ( !result.isSuccess() ) { System.err.println( "Provider message:" ); System.err.println( result.getProviderMessage() == null ? "" : result.getProviderMessage() ); System.err.println( "Command output:" ); System.err.println( result.getCommandOutput() == null ? "" : result.getCommandOutput() ); throw new Exception( "Command failed." + StringUtils.defaultString( result.getProviderMessage() ) ); } } +------------------------------------------+ * Sample code The code above is available here: {{{http://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-client/}Maven-SCM client}}. maven-scm-1.3/src/site/apt/guide/index.apt0000644000175000017500000000240011051550673020431 0ustar twernertwerner ------ Guides ------ Maven Team ------ 2007-03-12 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Guides * {{{usage.html}How to use Maven-SCM in my application?}} This {{{usage.html}document}} describe API usage for a SCM client. * {{{new_provider.html}How to write a new SCM provider?}} This {{{new_provider.html}document}} describe step by step the implementation of a new SCM proviser. maven-scm-1.3/src/site/apt/subversion.apt0000644000175000017500000000535411053631431020431 0ustar twernertwerner ------ SCM Implementation: Subversion ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Subversion * General Info Link : {{http://subversion.tigris.org/}} License : CollabNet/Tigris.org Apache-style license * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:svn:svn://[username[:password]@]server_name[:port]/path_to_repository scm:svn:svn+ssh://[username@]server_name[:port]/path_to_repository scm:svn:file://[hostname]/path_to_repository scm:svn:http://[username[:password]@]server_name[:port]/path_to_repository scm:svn:https://[username[:password]@]server_name[:port]/path_to_repository ------- * Examples ------- scm:svn:file:///svn/root/module scm:svn:file://localhost/path_to_repository scm:svn:file://my_server/path_to_repository scm:svn:http://svn.apache.org/svn/root/module scm:svn:https://username@svn.apache.org/svn/root/module scm:svn:https://username:password@svn.apache.org/svn/root/module ------- * Provider Configuration The provider configuration is defined in ${user.home}/.scm/svn-settings.xml ** Configuration directory You can define the subversion configuration directory ('--config-dir' svn global option) in the provider configuration file or with 'maven.scm.svn.config_directory' command line parameter. ------- your_configuration_directory true in order to use cygwin path /cygdrive/c the mount path to use default is /cygwin if false --non-interactive will not be used in the svn command line ------- ------- mvn -Dmaven.scm.svn.config_directory=your_configuration_directory scm:update ------- maven-scm-1.3/src/site/apt/accurev.apt0000644000175000017500000000223411051550673017662 0ustar twernertwerner ------ SCM Implementation: Accurev ------ Olivier Lamy ------ 2008-08-10 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Accurev * General Info Link : {{http://www.accurev.com//}} License : Commercial * SCM Url ------- scm:accurev:server:port/depot/my_app/ -------maven-scm-1.3/src/site/apt/scm-url-format.apt0000644000175000017500000000256011051550673021104 0ustar twernertwerner ------ SCM URL format ------ Emmanuel Venisse ------ 2005-06-05 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM URL Format * SCM Url The general format for a SCM Url is ------- scm: ------- As delimiter you can use either colon ':' or, if you use a colon for one of the variables (e.g. a windows path), you can use a pipe '|'. For information about the provider specific part, see the appropriate {{{scms-overview.html}SCM implementation}}. maven-scm-1.3/src/site/apt/bazaar.apt0000644000175000017500000000421311051550673017471 0ustar twernertwerner ------ SCM Implementation: Bazaar ------ Torbj�rn Eikli Sm�rgrav ------ 2006-02-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Bazaar * General Info Link : {{http://bazaar-vcs.org/}} License : GNU General Public License "Bazaar-NG is a decentralized revision control system designed to be easy for developers and end users alike. Decentralized revision control systems give people the ability to work over the internet using the bazaar development model. When you use Bazaar-NG, you can commit to your own branches of your favorite free software projects without needing special permission." The provider supports Bazaar from version 0.7, though important features like sftp transport where not included before version 0.8. * SCM Url Path or url to the branch location. Supported protocols: FTP, SFTP, AFTP, HTTP, HTTPS and FILE. ------- scm:bazaar:url_to_repository ------- * Examples ------- scm:bazaar:http://host/v3 (read only) scm:bazaar:sftp://username:password@host/~/dev/project/v3 (relativ path) scm:bazaar:sftp://host:port/home/smorgrav/dev/project/v3 (absolute path without explicit username) scm:bazaar:file://C:/dev/project/v3 (windows drive) scm:bazaar:file:///home/smorgrav/dev/project/v3 (linux drive) ------- maven-scm-1.3/src/site/apt/starteam.apt0000644000175000017500000000636511051550673020063 0ustar twernertwerner ------ SCM Implementation: StarTeam ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: StarTeam * General Info Link : {{http://www.borland.com/us/products/starteam/index.html}} License : Commercial * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:starteam:[username[:password]@]host:port/projectName/[viewName/][folderHiearchy/] (DEPRECATED) scm:starteam:[username[:password]@]host:port:/projectName/[viewName/][folderHiearchy/] ------- * Examples ------- scm:starteam:username:password@hostname:23456/project/view/folder1/folder2 scm:starteam:username@hostname:23456/project/view/folder scm:starteam:hostname:23456/project/view/folder ------- * Hidden Features Starteam provider has a few hidden features that currently not accessible thru maven-scm-api. Hidden features can be activated via system properties settings ( ie -Dkey=value ) or ${user.home}/.scm/starteam-settings.xml *--------------------------------+----------+-------------------+------------------------------------------+ | Key |location |Type | Description | *--------------------------------+----------+-------------------+------------------------------------------+ | compressionEnable |settings |boolean | Add "-cmp" option to all stcmd executions| *--------------------------------+----------+-------------------+------------------------------------------+ | maven.scm.starteam.deleteLocal |properties|boolean | Issue stdcmd delete-local command after an update.| | | | | This feature is activated by Continuum by default| *--------------------------------+----------+-------------------+------------------------------------------+ | maven.scm.issue.type |properties|cr,req,task,active | Additional comment type during checkin | *--------------------------------+----------+-------------------+------------------------------------------+ | maven.scm.issue.value |properties|issue type value | Full path to the issue type value, if required| *--------------------------------+----------+-------------------+------------------------------------------+ maven-scm-1.3/src/site/apt/cvs.apt0000644000175000017500000001233711057347502017033 0ustar twernertwerner ------ SCM Implementation: CVS ------ Wim Deblauwe ------ 2008-09-02 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: CVS * General Info Link : {{https://www.cvshome.org/}} License : GPL * SCM Url The general format for a CVS SCM Url is ------- scm:cvs[username_password_servername_port]path_to_repositorymodule_name ------- As delimiter you can use either colon ':' or, if you use a colon for one of the variables (e.g. a windows path), a pipe '|'. The following methods are supported: * ext, connecting to a server using an external rsh program * local, connecting to the local file system * lserver, connecting to a local server * pserver, connecting to a password-authenticating server * sspi, secure authentication (less supported by clients and servers, may require using native implementation, for more details see "How to choose the CVS provider implementation") * sserver, SSL connection method for CVS (only if cvs_native is used i.e. using -Dmaven.scm.provider.cvs.implementation=cvs_native with Maven) [] Here are the format for each of the supported methods, using colon as delimiter. ------- scm:cvslocalpath_to_repositorymodule_name scm:cvslserver[username@]servername[port]path_to_repositorymodule_name scm:cvspserver[username[password]@]servername[port]path_to_repositorymodule_name scm:cvsext[username@]servername[port]path_to_repositorymodule_name scm:cvssspi[username@]hostpathmodule ------- * Examples ------- scm:cvs:pserver:anoncvs:@cvs.apache.org:/cvs/root:module scm:cvs|pserver|username@localhost|C:/Program Files/cvsnt/repositories|module_name scm:cvs:ext:username@cvs.apache.org:/cvs/root:module scm:cvs:local:/cvs/root:module scm:cvs:sspi:cvs.apache.org:2222:/cvs/root:module ------- If you use anonymous access, with an empty password, you need to add a colon (:) between the username and "@" like it's done in the first example. This tells the SCM provider that there is a password and that it is empty. * How to choose the CVS provider implementation By default, the pure java CVS provider is used (which may not support SSPI protocol), so you don't need a cvs client installed on your machine. In some case, you can want to use the installed CVS client (for example, CVSNT). To do it, you can change the implementation to use by settings the 'maven.scm.provider.cvs.implementation' system property: ------- -Dmaven.scm.provider.cvs.implementation=cvs_native ------- * Provider Configuration The provider configuration is defined in ${user.home}/.scm/cvs-settings.xml ** Compression level You can define the compression level in the provider configuration file (default value is 3). If compression level is equals to 0, there won't be any compression. ------- 5 ------- If you don't want compression, you can define the system property 'maven.scm.cvs.use_compression'. ------- mvn -Dmaven.scm.cvs.use_compression=true scm:changelog ------- ** .cvsrc file By default, maven-scm doesn't use .cvsrc file. If you want to use it, you should allow it inprovider configuration file. ------- true ------- ** Trace CVS commands By default, maven-scm doesn't use '-t' global option of cvs command line to trace. If you want to use it, add the following lines in your provider configuration file : ------- true ------- ** Temporary CVS files If you want to store CVS temporary files in a specific directory instead of default or value define in $TMPDIR, add the following lines in your provider configuration file : ------- your_directory ------- ** Internal CVS variables If you want to add some internal CVS variables to the cvs command line, , add the following lines in your provider configuration file : ------- value1 value2 ------- maven-scm-1.3/src/site/apt/synergy.apt0000644000175000017500000001300311322606411017717 0ustar twernertwerner ------ SCM Implementation: CM/Synergy ------ Julien Henry (Capgemini) & La Poste ------ 2006-10-23 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: CM/Synergy * General Info Link : {{http://www.telelogic.com/Products/synergy/synergycm/index.cfm}} License : Commercial * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:synergyproject_namedatabase_delimiterproject_versionreleasepurposeinstance ------- : This is the name of the project from which the checkout is done. : This is the version of the project from which the checkout is done (usually a prep project). : This is the release. : This is the purpose. : This is the (optional) instance of the project from which the checkout is done (usually a prep project). Default is 1. * Examples ------- scm:synergy:MyProject:~:int_1.0:MyProject/2.0:Devel:1 scm|synergy|MyProject|-|int_1.0|MyProject/2.0|Devel:db1#1 ------- * Extra Information ** General ccm start command shall use -rc in addition to below options for remote linux clients. ** Checkout Checkout purpose is to get sources from a working Work Area to a given folder. First, it checks if a work area already exists with the given version. If yes, it only synchronizes and reconfigures the existing one, and then copies file to the expecting folder. If no Work Area exists, then a checkout is done. To specify the version of the checkout working project, use parameter. When a 'checkout' happens, the following scm commands are generated ------- ccm start -m -q -nogui -n -pw ccm query -u -f %objectname "owner='' and status='working' and type='project' and has_predecessor('')" //Check for existing checkout ccm synchronize -p ccm reconfigure -p ccm checkout -subprojects -rel [-t ] -purpose -release -p // If no existing working project exists ccm stop ------- ** Update Reconfigure project with default reconfigure template, and copy file from work area to expected folder. ------- ccm start -m -q -nogui -n -pw ccm query -u -f %objectname "owner='' and status='working' and type='project' and has_predecessor('')" //Check for existing checkout ccm reconfigure -r -p ccm stop ------- ** Add Create a default task, add new file(s) to the repository and checkin the task. You can change the synopsis of the task by setting this parameter ------- ccm start -m -q -nogui -n -pw ccm task -create -def -release -synopsis ccm create -c ccm task -checkin -comment ccm stop ------- ** Remove Remove a file from repository. ------- ccm start -m -q -nogui -n -pw ccm delete ccm stop ------- ** Changelog Get modified files history. In order to parse output of Synergy command, we need to know different parameters: * maven.scm.synergy.ccmDateFormat (default value is EEE MMM dd HH:mm:ss yyyy) * maven.scm.synergy.language (default value is en) * maven.scm.synergy.country (default value is US) [] ------- ccm start -m -q -nogui -n -pw ccm query -u is_task_in_folder_of(is_folder_in_rp_of('')) and completion_date>time() and completion_date) ccm task -show objects ccm stop ------- ** Checkin Checkin the default task. ------- ccm start -m -q -nogui -n -pw ccm task -checkin default -c ccm stop ------- ** Edit Create a default task and checkout file(s). ------- ccm start -m -q -nogui -n -pw ccm task -create -def -release -synopsis ccm co ccm stop ------- ** Unedit Cancel edition. Replace file with previous version. ------- ccm start -m -q -nogui -n -pw ccm delete -replace ccm stop ------- ** Status Get state of files. ------- ccm start -m -q -nogui -n -pw ccm dir -m ccm stop ------- ** Tag Create a baseline on the prep project. You may need to change the purpose in the pom to create the baseline (only prep purpose are allowed). ------- ccm start -m -q -nogui -n -pw ccm baseline -create -p -r -purpose ccm stop ------- maven-scm-1.3/src/site/apt/clearcase.apt0000644000175000017500000002175311057222510020153 0ustar twernertwerner ------ SCM Implementation: ClearCase ------ Wim Deblauwe, Arne Degenring ------ 2008-09-02 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: ClearCase * General Info Link: {{http://www-306.ibm.com/software/awdtools/clearcase/}} License: Commercial * SCM URL For all URLs below, use a colon (:) as the separator. In case of a colon being used within one of the parameters (e.g. a Windows path), then use a pipe (|) as the separator. ------- scm:clearcase[view_name]config_spec ------- : Name of the view that is created on a 'checkout' of the code. This parameter is optional. : Either * a user-supplied config spec file, or * one load rule that is used by the ClearCase SCM provider to automatically generate a config spec when creating a view. [] <>: Since 1.1.1, you could also use: ------- scm:clearcase[loadCommand][VOBName][streamName]/main/fooBar/LATEST ------- OR ------- scm:clearcase[viewName][loadCommand][VOBName][streamName]/main/fooBar/LATEST ------- ** ClearCase UCM If you are using ClearCase UCM, the URL format is the following ------- scm:clearcase[view_name]config_specvob_namestream_name ------- : Identifier of the ClearCase VOB : Name of the project's Stream ** User-supplied config spec If you specify the location of an user-supplied config spec file in the SCM URL, this config spec is used each time a view is created. SCM URL samples: ------- scm:clearcase:\\myserver\clearcase\configspecs\my_module.txt scm:clearcase:my_module_view:\\myserver\clearcase\configspecs\my_module.txt ------- To make sure all the correct elements are loaded in the view, the config spec must have "load" rules specified. You can also include other config specs into your own config spec, as in the following example: ------- include \\myserver\clearcase\configspecs\my_dynamic_configspec.txt load /myvob/modules/my_module ------- Notice that checking out from a tag (which is used by the maven-release-plugin) is currently not supported for user-supplied config specs. Another point to remember is that ClearCase does not check out projects directly into the checkout directory, but instead a sub-directory of the checkout directory (e.g. /checkoutdir/myvob/modules/my_module instead of just /checkoutdir). This is unexpected by the scm:bootstrap command, Continuum, the Maven-Release-Plugin and other users of the ClearCase SCM provider. Adjust the build working directory after the checkout (in Continuum, for example, by adjusting the POM file location within the Build definition). ** Auto-generated config spec For many users of a base ClearCase SCM installation, auto-generated config specs are more convenient than user-supplied config specs. Instead of being forced to provide a config spec file at an external location, the SCM URL contains all information that is needed to check out the code. Specify one load rule for the project you want to check out within the SCM URL, as in the following examples: ------- scm:clearcase:load /MY_VOB/my/project/dir scm:clearcase:my_module_view:load /MY_VOB/my/project/dir ------- This information is used by the ClearCase SCM provider to automatically generate the following config spec: ------- element * CHECKEDOUT element * /main/LATEST load ------- When working with auto-generated config specs, checking out from version tags (= ClearCase label types) is supported as well. (Notice that checking out from a branch tag (= ClearCase branch type) is currently not supported.) In case a tag has been specified, the following config spec is created: ------- element * CHECKEDOUT element * element -directory * /main/LATEST load ------- Notice that ClearCase does not check out projects directly into the checkout directory, but instead a sub-directory of the checkout directory (e.g. /checkoutdir/myvob/modules/my_module instead of just /checkoutdir). When using auto-generated config specs, the correct location of the project directory is provided to other modules that use the ClearCase SCM provider, such as the scm:bootstrap command. As a consequence, the build can automatically be run from the correct working directory. * Creating and removing views Each time a 'checkout' of code is performed (e.g. when adding a project to Continuum), the ClearCase SCM provider creates a new snapshot view using the <> command. As the view name, the parameter is used if it has been specified. Many users prefer to leave the parameter out, as the ClearCase SCM provider automatically chooses a view name according to the following pattern: --maven-, e.g. johndoe-mymachine-maven-myproject. Notice that the ClearCase SCM provider does not remove views once they have been created. When you don't need the view any longer, remember to explicitly remove it using ClearCase HomeBase or cleartool, e.g. using one of the following commands: ------- cleartool rmview /views/myproject cleartool rmview -tag johndoe-mymachine-maven-myproject ------- In case a view name already exists when checking out, ClearCase reports an error like the following: ------- cleartool: Error: A registry entry already exists for "johndoe-mymachine-maven-myproject". ------- * ClearCase settings file You can configure the behaviour of the ClearCase SCM provider by providing a <> file, either at ${user.home}/.scm/clearcase-settings.xml or at ${maven.home}/conf/clearcase-settings.xml. Notice: If the file is present at both locations, the settings from the .scm subdirectory of the user's home directory is used; the settings are not merged. ** -vws parameter on mkview command By default, when creating a view, the -vws parameter of the mkview command is used to specify the location of the view store. In many environments, however, the -vws parameter can be omitted, and ClearCase uses appropriate defaults. To turn off the usage of the -vws parameter, configure it in the clearcase-settings.xml file: ------- false ------- ** Viewstore location This setting is only relevant if and when <> has been left or set to the default value of <>. By default the viewstore location <<\\\\${hostname}\viewstore>> is used. To define another viewstore location, use the following setting: ------- \\mymachine\myvwstore ------- ** ClearCase Type By default, the ClearCase SCM provider uses commands appropriate for the full ClearCase version. If you are using ClearCase LT or ClearCase UCM instead, you must specify this fact in the clearcase-settings.xml file. ------- UCM ------- As ClearCase LT uses a predefined and unchangeable folder as the viewstore directory, you should also specify the viewstore root location in the clearcase-settings.xml file: ------- LT \\mymachine\myvwstore ------- * ClearCase dynamic views The ClearCase SCM provider uses snapshot views. In case you are forced to use ClearCase dynamic views, one option is to use the {{{local.html}SCM local file system provider}} instead. Within the SCM URL, you could specify the view name that the Continous Integration Server is using, for example: ------- scm:local|\\view\continuum_view\MY_VOB\my\project|module1 ------- Notice that this option provides only very limited integration of Maven into the configuration management system. As no SCM metadata can be accessed, it is not possible to use SCM plugin features like creating tags (applying labels), creating changelogs, and so on. maven-scm-1.3/src/site/apt/mercurial.apt0000644000175000017500000000332711051550673020221 0ustar twernertwerner ------ SCM Implementation: Mercurial (hg) ------ Ryan Daum ------ 2007-04-12 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Mercurial * General Info Link : {{http://www.selenic.com/mercurial/wiki/}} License : GNU General Public License "Mercurial: a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects." This provider supports version 0.9.2 and greater of Mercurial. * SCM Url Path or url to the branch location. Supported protocols: HTTP, HTTPS, FILE, and local path. ------- scm:hg:url_to_repository/local_repository_directory ------- * Examples ------- scm:hg:http://host/v3 scm:hg:file://C:/dev/project/v3 (windows drive) scm:hg:file:///home/smorgrav/dev/project/v3 (linux drive) scm:hg:/home/smorgrav/dev/project/v3 (local directory) ------- maven-scm-1.3/src/site/apt/perforce.apt0000644000175000017500000000475411051550673020050 0ustar twernertwerner ------ SCM Implementation: Perforce ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Perforce * General Info Link : {{http://www.perforce.com/}} License : Commercial (It is licensed at no charge for use on open source projects.) * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:perforce:[username@]path_to_repository scm:perforce:host:[port:][username@]path_to_repository (DEPRECATED) scm:perforce:[username@]host:[port:]path_to_repository ------- * Examples ------- scm:perforce://depot/modules/myproject ------- * Associating Jobs with checkin changelist Many Perforce installation have a 'require job' rule/trigger turned on. To allow checkin when such a rule is defined, the system property maven.scm.jobs can be set to specify a job that will be associated with the changelist on checkin. Handling of multiple jobs is currently not implemented. Sample: -Dmaven.scm.jobs=JOB1234 *--------------------------------+----------+-------------------+------------------------------------------+ | Key |location |Type | Description | *--------------------------------+----------+-------------------+------------------------------------------+ | maven.scm.jobs |properties|word, The job name | Job name | *--------------------------------+----------+-------------------+------------------------------------------+ maven-scm-1.3/src/site/apt/scm-commands.apt0000644000175000017500000000504211051550673020613 0ustar twernertwerner ------ SCM Commands ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven SCM Commands Maven SCM uses a exposes a fixed set of commands for it users. The providers for each SCM must implements those commands through the ScmProvider interface. This is an overview of all the commands: * Add Adds a new file to the source control system * Changelog Produces a list of changed (a new version has been put in the system) files. This list can then be used to display the latest changes or the developer(s) who did the latest changes. * Checkin Save the changes you have done into the repository. This will create a new version of the file or directory in the repository. * Checkout Copy (part of) the contents of the source control system to a certain location on your local machine. It should be possible to scm operations in that location. * Edit Mark a file as editable with the source control system. This is used in source control systems where you look at read-only files and you need to make them not read-only anymore before you can edit them. In some scm's this means that no other user can then do an edit at the same time. * Diff TODO * Remove Removes a file from the source control system * Status Gives a list of files that still need some source control operation (files that still need to be added, files that are in edit mode, ...) * Tag Tags (label in some scm's) a source tree with a certain tag. This allows to make reproducable builds later by checking out the source code that has this tag. * Update Updates the checkout'ed source code to the latest state in the source control repository. maven-scm-1.3/src/site/apt/vss.apt0000644000175000017500000000445711057353025017054 0ustar twernertwerner ------ SCM Implementation: Visual Source Safe ------ Wim Deblauwe ------ 2008-09-02 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Visual Source Safe * General Info Link : {{http://msdn.microsoft.com/ssafe/}} License : Commercial * SCM Url Because a colon is used for one of the variables (a windows path), a pipe (|) is used as the delimiter. The general format for a VSS SCM Url is ------- scm:vss|path_to_repository|/module_name ------- The third variable is the path to the Visual Source Safe repository (where srcsafe.ini resides). Note that a forward slash is necessary before the module name in the final variable. * Examples ------- scm:vss|C:\Program Files\Microsoft Visual Studio\VSS|/SomeProject ------- * Provider Configuration The provider configuration is defined in ${user.home}/.scm/vss-settings.xml ** VSS Installation directory The provider needs to know the installation path of the ss.exe in order to fulfill VSS commands. The installation path can be set in two ways - either in the vss-settings.xml file: ------- ss_exe_directory ------- or on the command line: ------- mvn -DvssDirectory=ss_exe_directory scm:update ------- In either case, ss_exe_directory should be set to the full path to the directory where ss.exe resides (e.g. C:\Program Files\Microsoft Visual Studio\VSS\bin). maven-scm-1.3/src/site/apt/local.apt0000644000175000017500000000310411051550673017321 0ustar twernertwerner ------ SCM Implementation: File System ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: File System * General Info Link : - License : - * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:localpath_to_repositorymodule_name ------- : The absolute or relative path to the parent directory of your pom.xml : The name of the directory that contains your pom.xml * Examples ------- scm:local:/usr/modules:my_module scm:local|C:/javaprojects|my_module ------- maven-scm-1.3/src/site/apt/tfs.apt0000644000175000017500000000306311246172601017024 0ustar twernertwerner ------ SCM Implementation: TFS - Team Foundation Server ------ Mark Struberg ------ 2009-08-24 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: TFS - Team Foundation Server * General Info Link : {{http://www.microsoft.com/germany/visualstudio/products/team-system/}} License : Commercial * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. ------- scm:tfs:[[domain\\]username[;password]@]http[s]://server_name[:port]:workspace:$/TeamProject/Path/To/Project ------- * Examples ------- scm:tfs:https://tfs10.codeplex.com:/maventest/ExampleProject ------- maven-scm-1.3/src/site/apt/index.apt0000644000175000017500000000255011051550673017342 0ustar twernertwerner ------ Home ------ Wim Deblauwe ------ 2005-12-01 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven SCM Maven SCM supports Maven 2.x plugins (e.g. {{{http://maven.apache.org/plugins/maven-release-plugin/}maven-release-plugin}}) and other tools (e.g. {{{http://continuum.apache.org/}Continuum}}) by providing them with a common API for doing SCM operations. You can look at {{{scms-overview.html}the list of SCM's}} for more information on using Maven SCM with your favorite SCM tool. maven-scm-1.3/src/site/apt/git.apt0000644000175000017500000000660411263356573017032 0ustar twernertwerner ------ SCM Implementation: Git ------ Olivier Lamy ------ 2008-08-10 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html SCM Implementation: Git * General Info Link : {{http://git-scm.com/}} License : GNU General Public License v2 * SCM Url For all URLs below, we use a colon (:) as separator. If you use a colon for one of the variables (e.g. a windows path), then use a pipe (|) as separator. The separator for the port has to be a colon in any case since this part is specified in the git URL specification. See man git-fetch. ------- scm:git:git://server_name[:port]/path_to_repository scm:git:http://server_name[:port]/path_to_repository scm:git:https://server_name[:port]/path_to_repository scm:git:ssh://server_name[:port]/path_to_repository scm:git:file://[hostname]/path_to_repository ------- * Examples ------- scm:git:git://github.com/path_to_repository scm:git:http://github.com/path_to_repository scm:git:https://github.com/path_to_repository scm:git:ssh://github.com/path_to_repository scm:git:file://localhost/path_to_repository ------- * Different Fetch and Push URLs In some cases a different URL has to be used for read and write operations. This can happen if e.g. fetch is performed via the http protocol, but writing to the repository is only possible via ssh. In this case both URLs may be written into the tag. The fetch URL has to be prefixed with <<<[fetch=]>>> and the push URL with <<<[push=]>>> * Example: ------- scm:git:[fetch=]http://mywebserver.org/path_to_repository[push=]ssh://username@otherserver:8898/~/repopath.git ------- * Working with branches Since version 1.3, we assume that the name of the branch in the upstream repo is the same as the name of the current local branch. So whenever you invoke a maven-scm action which has to access the upstream repository, e.g. start a release, you should be on that very branch. In other words: If no branch is specified manually, every git-fetch, git-pull, git-push, etc will always work on the branch in the upstream repository which has the same branch name as your current local branch ------- git push pushUrl currentBranch:currentBranch ------- * Provider Configuration The provider configuration is defined in ${user.home}/.scm/git-settings.xml. ------- false ------- maven-scm-1.3/maven-scm-test/0000755000175000017500000000000011345536673016061 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/0000755000175000017500000000000011345536673016650 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/site/0000755000175000017500000000000011345536673017614 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/site/site.xml0000644000175000017500000000215011051127665021267 0ustar twernertwerner maven-scm-1.3/maven-scm-test/src/test/0000755000175000017500000000000011345536672017626 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/0000755000175000017500000000000011345536672020547 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/0000755000175000017500000000000011345536672021336 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/apache/0000755000175000017500000000000011345536672022557 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/apache/maven/0000755000175000017500000000000011345536672023665 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/apache/maven/scm/0000755000175000017500000000000011345536672024447 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/apache/maven/scm/manager/0000755000175000017500000000000011345536672026061 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/test/java/org/apache/maven/scm/manager/ScmManagerStubTest.java0000644000175000017500000000754410535556312032442 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.provider.ScmProviderStub; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryStub; import java.io.File; import java.util.ArrayList; import java.util.List; /** * Test for the ScmManagerStub * * @author Carlos Sanchez * @version $Id: ScmManagerStubTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ScmManagerStubTest extends TestCase { private ScmManagerStub scmManagerStub; private List messages; private ScmProvider scmProvider; private ScmRepository scmRepository; protected void setUp() throws Exception { super.setUp(); messages = new ArrayList( 0 ); scmProvider = new ScmProviderStub(); scmRepository = new ScmRepositoryStub(); scmManagerStub = new ScmManagerStub(); scmManagerStub.setMessages( messages ); scmManagerStub.setScmProvider( scmProvider ); scmManagerStub.setScmRepository( scmRepository ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.makeScmRepository(String)' */ public void testMakeScmRepository() throws Exception { ScmRepository repository = scmManagerStub.makeScmRepository( "" ); assertSame( scmRepository, repository ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.makeProviderScmRepository(String, File)' */ public void testMakeProviderScmRepository() throws Exception { ScmRepository repository = scmManagerStub.makeProviderScmRepository( "", new File( "" ) ); assertSame( scmRepository, repository ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.validateScmRepository(String)' */ public void testValidateScmRepository() { List list = scmManagerStub.validateScmRepository( "" ); assertSame( messages, list ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.getProviderByUrl(String)' */ public void testGetProviderByUrl() throws Exception { ScmProvider providerByUrl = scmManagerStub.getProviderByUrl( "" ); assertSame( scmProvider, providerByUrl ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.getProviderByType(String)' */ public void testGetProviderByType() throws Exception { ScmProvider providerByType = scmManagerStub.getProviderByType( "" ); assertSame( scmProvider, providerByType ); } /* * Test method for 'org.apache.maven.scm.manager.ScmManagerStub.getProviderByRepository(ScmRepository)' */ public void testGetProviderByRepository() throws Exception { ScmProvider providerByRepository = scmManagerStub.getProviderByRepository( new ScmRepositoryStub() ); assertSame( scmProvider, providerByRepository ); } } maven-scm-1.3/maven-scm-test/src/main/0000755000175000017500000000000011345536672017573 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/0000755000175000017500000000000011345536672020514 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/0000755000175000017500000000000011345536672021303 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/0000755000175000017500000000000011345536672022524 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/0000755000175000017500000000000011345536672023632 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536673024415 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/manager/0000755000175000017500000000000011345536673026027 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java0000644000175000017500000004013411050652666031541 0ustar twernertwernerpackage org.apache.maven.scm.manager; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.provider.ScmProviderStub; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.ScmRepositoryStub; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Stub implementation of ScmManager for unit testing purposes. * It allows setting the expected results that the different methods will return. * More information about Stubs on Martin Fowler's TestDouble * * @author Carlos Sanchez * @version $Id: ScmManagerStub.java 685686 2008-08-13 21:44:22Z olamy $ */ public class ScmManagerStub implements ScmManager { private ScmRepository scmRepository; private ScmProvider scmProvider; private List messages; /** * Creates a new stub with stub repository and provider, and empty list of messages */ public ScmManagerStub() { setScmRepository( new ScmRepositoryStub() ); setScmProvider( new ScmProviderStub() ); setMessages( new ArrayList( 0 ) ); } public void setScmProvider( ScmProvider scmProvider ) { this.scmProvider = scmProvider; } public ScmProvider getScmProvider() { return scmProvider; } /** {@inheritDoc} */ public void setScmProvider( String providerType, ScmProvider provider ) { setScmProvider( provider ); } /** {@inheritDoc} */ public void setScmProviderImplementation( String providerType, String providerImplementation ) { //Do nothing there } public void setScmRepository( ScmRepository scmRepository ) { this.scmRepository = scmRepository; } public ScmRepository getScmRepository() { return scmRepository; } /** * Set the messages to return in validateScmRepository * * @param messages List of String objects */ public void setMessages( List messages ) { this.messages = messages; } /** * Get the messages to return in validateScmRepository * * @return List of String objects */ public List getMessages() { return messages; } /** {@inheritDoc} */ public ScmRepository makeScmRepository( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException { return getScmRepository(); } /** {@inheritDoc} */ public ScmRepository makeProviderScmRepository( String providerType, File path ) throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException { return getScmRepository(); } /** * Returns the same list as getMessages() * * @param scmUrl ignored * @return List of String objects, the same list returned by getMessages() */ public List validateScmRepository( String scmUrl ) { return getMessages(); } /** {@inheritDoc} */ public ScmProvider getProviderByUrl( String scmUrl ) throws ScmRepositoryException, NoSuchScmProviderException { return getScmProvider(); } /** {@inheritDoc} */ public ScmProvider getProviderByType( String providerType ) throws NoSuchScmProviderException { return getScmProvider(); } /** {@inheritDoc} */ public ScmProvider getProviderByRepository( ScmRepository repository ) throws NoSuchScmProviderException { return getScmProvider(); } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).add( repository, fileSet ); } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).add( repository, fileSet, message ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException { return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName ); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException { return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName, message ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startDate, endDate, numDays, branch ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startDate, endDate, numDays, branch, datePattern ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startVersion, endVersion ); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startRevision, endRevision, datePattern ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).checkIn( repository, fileSet, message ); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) throws ScmException { return this.getProviderByRepository( repository ).checkIn( repository, fileSet, revision, message ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, boolean recursive ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, recursive ); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive ) throws ScmException { return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version, recursive ); } /** {@inheritDoc} */ public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return this.getProviderByRepository( repository ).diff( repository, fileSet, startVersion, endVersion ); } /** {@inheritDoc} */ public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).edit( repository, fileSet ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet, version ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String outputDirectory ) throws ScmException { return this.export( repository, fileSet, outputDirectory ); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException { return this.getProviderByRepository( repository ).export( repository, fileSet, version, outputDirectory ); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).list( repository, fileSet, recursive, version ); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return this.getProviderByRepository( repository ).remove( repository, fileSet, message ); } /** {@inheritDoc} */ public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).status( repository, fileSet ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName ) throws ScmException { return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName ); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message ) throws ScmException { return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName, message ); } /** {@inheritDoc} */ public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).unedit( repository, fileSet ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, runChangelog ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate, datePattern ); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern ) throws ScmException { return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate, datePattern ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTestCase.java0000644000175000017500000002534411053246641027433 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.PlexusTestCase; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; import org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer; import org.codehaus.plexus.util.cli.Commandline; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; /** * Base class for all scm tests. Consumers will typically * extend this class while tck test would extend ScmTckTestCase. *
* This class basically defines default locations for the * test enviroment and implements convenience methods. * * @author Jason van Zyl * @version $Id: ScmTestCase.java 687713 2008-08-21 11:12:33Z vsiveton $ */ public abstract class ScmTestCase extends PlexusTestCase { protected static final TimeZone GMT_TIME_ZONE = TimeZone.getTimeZone( "GMT" ); private static boolean debugExecute; private ScmManager scmManager; protected void setUp() throws Exception { super.setUp(); FileUtils.deleteDirectory( getRepositoryRoot() ); assertFalse( getRepositoryRoot().exists() ); FileUtils.deleteDirectory( getWorkingCopy() ); assertFalse( getWorkingCopy().exists() ); FileUtils.deleteDirectory( getWorkingDirectory() ); assertFalse( getWorkingDirectory().exists() ); FileUtils.deleteDirectory( getAssertionCopy() ); assertFalse( getAssertionCopy().exists() ); FileUtils.deleteDirectory( getUpdatingCopy() ); assertFalse( getUpdatingCopy().exists() ); scmManager = null; } protected String getModule() { fail( "getModule() must be overridden." ); return null; } /** * @return default location of the test read/write repository */ protected File getRepositoryRoot() { return PlexusTestCase.getTestFile( "target/scm-test/repository" ); } /** * @return Location of the revisioned (read only) repository */ protected File getRepository() { return PlexusTestCase.getTestFile( "/src/test/repository" ); } /** * @return location of the working copy (always checkout) */ protected File getWorkingCopy() { return PlexusTestCase.getTestFile( "target/scm-test/working-copy" ); } /** * Legacy method - same as getWorkingCopy() * * @return location of the working copy (always checkout) */ protected File getWorkingDirectory() { return getWorkingCopy(); } /** * @return default location for doing assertions on a working tree */ protected File getAssertionCopy() { return PlexusTestCase.getTestFile( "target/scm-test/assertion-copy" ); } /** * @return default location for doing update operations on a working tree */ protected File getUpdatingCopy() { return PlexusTestCase.getTestFile( "target/scm-test/updating-copy" ); } protected ScmManager getScmManager() throws Exception { if ( scmManager == null ) { scmManager = (ScmManager) lookup( ScmManager.ROLE ); } return scmManager; } protected ScmRepository makeScmRepository( String scmUrl ) throws Exception { return getScmManager().makeScmRepository( scmUrl ); } /** * TODO This method is bogus. ActualPatch is not used and if used, it breaks * some unit tests. */ public void assertPath( String expectedPath, String actualPath ) throws Exception { assertEquals( StringUtils.replace( expectedPath, "\\", "/" ), StringUtils.replace( expectedPath, "\\", "/" ) ); } protected void assertFile( File root, String fileName ) throws Exception { File file = new File( root, fileName ); assertTrue( "Missing file: '" + file.getAbsolutePath() + "'.", file.exists() ); assertTrue( "File isn't a file: '" + file.getAbsolutePath() + "'.", file.isFile() ); String expected = fileName; String actual = FileUtils.fileRead( file ); assertEquals( "The file doesn't contain the expected contents. File: " + file.getAbsolutePath(), expected, actual ); } protected void assertResultIsSuccess( ScmResult result ) { if ( result.isSuccess() ) { return; } System.err.println( "----------------------------------------------------------------------" ); System.err.println( "Provider message" ); System.err.println( "----------------------------------------------------------------------" ); System.err.println( result.getProviderMessage() ); System.err.println( "----------------------------------------------------------------------" ); System.err.println( "----------------------------------------------------------------------" ); System.err.println( "Command output" ); System.err.println( "----------------------------------------------------------------------" ); System.err.println( result.getCommandOutput() ); System.err.println( "----------------------------------------------------------------------" ); fail( "The check out result success flag was false." ); } protected ScmFileSet getScmFileSet() { return new ScmFileSet( getWorkingCopy() ); } protected static void setDebugExecute( boolean debugExecute ) { ScmTestCase.debugExecute = debugExecute; } /** * Execute the command line * * @param workingDirectory not null * @param executable not null, should be a system command * @param arguments not null * @throws Exception if any * @see CommandLineUtils#executeCommandLine(Commandline, org.codehaus.plexus.util.cli.StreamConsumer, * org.codehaus.plexus.util.cli.StreamConsumer) */ public static void execute( File workingDirectory, String executable, String arguments ) throws Exception { Commandline cl = new Commandline(); cl.setExecutable( executable ); cl.setWorkingDirectory( workingDirectory.getAbsolutePath() ); cl.addArguments( Commandline.translateCommandline( arguments ) ); StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer(); StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); System.out.println( "Test command line: " + cl ); int exitValue = CommandLineUtils.executeCommandLine( cl, stdout, stderr ); if ( debugExecute || exitValue != 0 ) { System.err.println( "-----------------------------------------" ); System.err.println( "Command line: " + cl ); System.err.println( "Working directory: " + cl.getWorkingDirectory() ); System.err.println( "-----------------------------------------" ); System.err.println( "Standard output: " ); System.err.println( "-----------------------------------------" ); System.err.println( stdout.getOutput() ); System.err.println( "-----------------------------------------" ); System.err.println( "Standard error: " ); System.err.println( "-----------------------------------------" ); System.err.println( stderr.getOutput() ); System.err.println( "-----------------------------------------" ); } if ( exitValue != 0 ) { fail( "Exit value wasn't 0, was:" + exitValue ); } } protected static void makeDirectory( File basedir, String fileName ) { File dir = new File( basedir, fileName ); if ( !dir.exists() ) { assertTrue( dir.mkdirs() ); } } protected static void makeFile( File basedir, String fileName ) throws IOException { makeFile( basedir, fileName, fileName ); } public static void makeFile( File basedir, String fileName, String contents ) throws IOException { File file = new File( basedir, fileName ); File parent = file.getParentFile(); if ( !parent.exists() ) { assertTrue( parent.mkdirs() ); } FileWriter writer = new FileWriter( file ); writer.write( contents ); writer.close(); } public static Date getDate( int year, int month, int day ) { return getDate( year, month, day, 0, 0, 0, null ); } protected static Date getDate( int year, int month, int day, TimeZone tz ) { return getDate( year, month, day, 0, 0, 0, tz ); } protected static Date getDate( int year, int month, int day, int hourOfDay, int minute, int second, TimeZone tz ) { Calendar cal = Calendar.getInstance(); if ( tz != null ) { cal.setTimeZone( tz ); } cal.set( year, month, day, hourOfDay, minute, second ); cal.set( Calendar.MILLISECOND, 0 ); return cal.getTime(); } public void assertCommandLine( String expectedCommand, File expectedWorkingDirectory, Commandline actualCommand ) { Commandline cl = new Commandline( expectedCommand ); if ( expectedWorkingDirectory != null ) { cl.setWorkingDirectory( expectedWorkingDirectory.getAbsolutePath() ); } assertEquals( cl.toString(), actualCommand.toString() ); } /** * * @param cmd the executable to run, not null. * @return true */ public static boolean isSystemCmd( String cmd ) { try { Runtime.getRuntime().exec( cmd ); return true; } catch ( IOException e ) { return false; } } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/0000755000175000017500000000000011345536672025175 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/0000755000175000017500000000000011345536673026614 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/branch/0000755000175000017500000000000011345536673030051 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/branch/BranchCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/branch/BranchCommandTckT0000644000175000017500000000664610606723477033271 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.branch; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.FileWriter; /** * This test tests the branch command. * * @author Emmanuel Venisse * @version $Id: BranchCommandTckTest.java 527150 2007-04-10 15:03:27Z evenisse $ */ public abstract class BranchCommandTckTest extends ScmTckTestCase { public void testBranchCommandTest() throws Exception { String branch = "test-branch"; BranchScmResult branchResult = getScmManager().getProviderByUrl( getScmUrl() ) .branch( getScmRepository(), new ScmFileSet( getWorkingCopy() ), branch ); assertResultIsSuccess( branchResult ); assertEquals( "check all 4 files branched", 4, branchResult.getBranchedFiles().size() ); File readmeTxt = new File( getWorkingCopy(), "readme.txt" ); assertEquals( "check readme.txt contents", "/readme.txt", FileUtils.fileRead( readmeTxt ) ); changeReadmeTxt( readmeTxt ); CheckInScmResult checkinResult = getScmManager().checkIn( getScmRepository(), new ScmFileSet( getWorkingCopy() ), "commit message" ); assertResultIsSuccess( checkinResult ); CheckOutScmResult checkoutResult = getScmManager().checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ) ); assertResultIsSuccess( checkoutResult ); readmeTxt = new File( getAssertionCopy(), "readme.txt" ); assertEquals( "check readme.txt contents", "changed file", FileUtils.fileRead( readmeTxt ) ); FileUtils.deleteDirectory( getAssertionCopy() ); assertFalse( "check previous assertion copy deleted", getAssertionCopy().exists() ); checkoutResult = getScmManager().getProviderByUrl( getScmUrl() ) .checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ), new ScmBranch( branch ) ); assertResultIsSuccess( checkoutResult ); assertEquals( "check readme.txt contents is from branched version", "/readme.txt", FileUtils.fileRead( readmeTxt ) ); } private void changeReadmeTxt( File readmeTxt ) throws Exception { FileWriter output = new FileWriter( readmeTxt ); output.write( "changed file" ); output.close(); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/0000755000175000017500000000000011345536672030075 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/update/UpdateCommandTckT0000644000175000017500000001524011050652666033324 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.update; /* * 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. */ import java.io.File; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.TreeSet; import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.StringUtils; /** * This test tests the update command. *

* It works like this: *

*

    *
  1. Check out the files to directory getWorkingCopy(). *
  2. Check out the files to directory getUpdatingCopy(). *
  3. Change the files in getWorkingCopy(). *
  4. Commit the files in getWorkingCopy(). Note that the provider must not * use the check in command as it can be guaranteed to work as it's not yet tested. *
  5. Use the update command in getUpdatingCopy() to assert that the files * that was supposed to be updated actually was updated. *
* * @author Trygve Laugstøl * @version $Id: UpdateCommandTckTest.java 685686 2008-08-13 21:44:22Z olamy $ */ public abstract class UpdateCommandTckTest extends ScmTckTestCase { private void commit( File workingDirectory, ScmRepository repository ) throws Exception { CheckInScmResult result = getScmManager().checkIn( repository, new ScmFileSet( workingDirectory ), "No msg" ); assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() ); List committedFiles = result.getCheckedInFiles(); assertEquals( "Expected 3 files in the committed files list:\n " + StringUtils.join( committedFiles.iterator(), "\n " ), 3, committedFiles.size() ); } public void testUpdateCommand() throws Exception { ScmRepository repository = makeScmRepository( getScmUrl() ); checkOut( getUpdatingCopy(), repository ); // ---------------------------------------------------------------------- // Change the files // ---------------------------------------------------------------------- /* * readme.txt is changed (changed file in the root directory) * project.xml is added (added file in the root directory) * src/test/resources is untouched (a empty directory is left untouched) * src/test/java is untouched (a non empty directory is left untouched) * src/test/java/org (a empty directory is added) * src/main/java/org/Foo.java (a non empty directory is added) */ // /readme.txt ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" ); // /project.xml ScmTestCase.makeFile( getWorkingCopy(), "/project.xml", "changed project.xml" ); addToWorkingTree( getWorkingCopy(), new File( "project.xml" ), repository ); // /src/test/java/org ScmTestCase.makeDirectory( getWorkingCopy(), "/src/test/java/org" ); addToWorkingTree( getWorkingCopy(), new File( "src/test/java/org" ), repository ); // /src/main/java/org/Foo.java ScmTestCase.makeFile( getWorkingCopy(), "/src/main/java/org/Foo.java" ); addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org" ), repository ); // src/main/java/org/Foo.java addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org/Foo.java" ), repository ); ScmManager scmManager = getScmManager(); Date lastUpdate = new Date( System.currentTimeMillis() ); Thread.sleep( 1000 ); commit( getWorkingCopy(), repository ); // ---------------------------------------------------------------------- // Update the project // ---------------------------------------------------------------------- UpdateScmResult result = scmManager.update( repository, new ScmFileSet( getUpdatingCopy() ), lastUpdate ); assertNotNull( "The command returned a null result.", result ); assertResultIsSuccess( result ); List updatedFiles = result.getUpdatedFiles(); List changedFiles = result.getChanges(); assertEquals( "Expected 3 files in the updated files list " + updatedFiles, 3, updatedFiles.size() ); assertNotNull( "The changed files list is null", changedFiles ); assertFalse( "The changed files list is empty", changedFiles.isEmpty() ); for ( Iterator i = changedFiles.iterator(); i.hasNext(); ) { ChangeSet changeSet = (ChangeSet) i.next(); System.out.println( changeSet.toXML() ); } // ---------------------------------------------------------------------- // Assert the files in the updated files list // ---------------------------------------------------------------------- Iterator files = new TreeSet( updatedFiles ).iterator(); //Foo.java ScmFile file = (ScmFile) files.next(); assertPath( "/src/main/java/org/Foo.java", file.getPath() ); //TODO : Consolidate file status so that we can remove "|| ADDED" term assertTrue( file.getStatus().isUpdate() || file.getStatus() == ScmFileStatus.ADDED ); //readme.txt file = (ScmFile) files.next(); assertPath( "/readme.txt", file.getPath() ); assertTrue( file.getStatus().isUpdate() ); //project.xml file = (ScmFile) files.next(); assertPath( "/project.xml", file.getPath() ); //TODO : Consolidate file status so that we can remove "|| ADDED" term assertTrue( file.getStatus().isUpdate() || file.getStatus() == ScmFileStatus.ADDED ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/0000755000175000017500000000000011345536672030420 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/CheckOutCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkout/CheckOutCommand0000644000175000017500000000426310535556312033345 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.checkout; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.codehaus.plexus.util.FileUtils; import java.util.Iterator; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; /** * This test tests the check out command. * * @author Trygve Laugstøl * @version $Id: CheckOutCommandTckTest.java 483105 2006-12-06 15:07:54Z evenisse $ */ public abstract class CheckOutCommandTckTest extends ScmTckTestCase { public void testCheckOutCommandTest() throws Exception { FileUtils.deleteDirectory( getWorkingCopy() ); CheckOutScmResult result = checkOut( getWorkingCopy(), getScmRepository() ); assertResultIsSuccess( result ); List checkedOutFiles = result.getCheckedOutFiles(); if ( checkedOutFiles.size() != 4 ) { SortedSet files = new TreeSet( checkedOutFiles ); int i = 0; for ( Iterator it = files.iterator(); it.hasNext(); i++ ) { ScmFile scmFile = (ScmFile) it.next(); System.err.println( "" + i + ": " + scmFile ); } fail( "Expected 4 files in the updated files list, was " + checkedOutFiles.size() ); } } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/0000755000175000017500000000000011345536672030136 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/status/StatusCommandTckT0000644000175000017500000001340010604531451033412 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.status; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import java.io.File; import java.util.Iterator; import java.util.List; import java.util.TreeSet; /** * This test tests the status command. *

* It works like this: *

*

    *
  1. Check out the files to directory getWorkingCopy(). *
  2. Check out the files to directory getUpdatingCopy(). *
  3. Change the files in getWorkingCopy(). *
  4. Commit the files in getWorkingCopy(). Note that the provider must not * use the check in command as it can be guaranteed to work as it's not yet tested. *
  5. Use the update command in getUpdatingCopy() to assert that the files * that was supposed to be updated actually was updated. *
* * @author Brett Porter * @version $Id: StatusCommandTckTest.java 525259 2007-04-03 20:03:53Z evenisse $ */ public abstract class StatusCommandTckTest extends ScmTckTestCase { private void commit( File workingDirectory, ScmRepository repository ) throws Exception { CheckInScmResult result = getScmManager().checkIn( repository, new ScmFileSet( workingDirectory ), "No msg" ); assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() ); List committedFiles = result.getCheckedInFiles(); assertEquals( "Expected 2 files in the committed files list " + committedFiles, 2, committedFiles.size() ); } public void testStatusCommand() throws Exception { ScmRepository repository = makeScmRepository( getScmUrl() ); checkOut( getUpdatingCopy(), repository ); // ---------------------------------------------------------------------- // Change the files // ---------------------------------------------------------------------- /* * readme.txt is changed (changed file in the root directory) * project.xml is added (added file in the root directory) */ // /readme.txt ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" ); // /project.xml ScmTestCase.makeFile( getWorkingCopy(), "/project.xml", "changed project.xml" ); addToWorkingTree( getWorkingCopy(), new File( "project.xml" ), repository ); commit( getWorkingCopy(), repository ); // /pom.xml ScmTestCase.makeFile( getUpdatingCopy(), "/pom.xml", "changed pom.xml" ); // /src/test/java/org ScmTestCase.makeDirectory( getUpdatingCopy(), "/src/test/java/org" ); addToWorkingTree( getUpdatingCopy(), new File( "src/test/java/org" ), repository ); // /src/main/java/org/Foo.java ScmTestCase.makeFile( getUpdatingCopy(), "/src/main/java/org/Foo.java" ); addToWorkingTree( getUpdatingCopy(), new File( "src/main/java/org" ), repository ); // src/main/java/org/Foo.java addToWorkingTree( getUpdatingCopy(), new File( "src/main/java/org/Foo.java" ), repository ); ScmManager scmManager = getScmManager(); // ---------------------------------------------------------------------- // Check status the project // src/main/java/org/Foo.java is added // /pom.xml is modified // check that readme and project.xml are not updated/created // ---------------------------------------------------------------------- StatusScmResult result = scmManager.getProviderByUrl( getScmUrl() ) .status( repository, new ScmFileSet( getUpdatingCopy() ) ); assertNotNull( "The command returned a null result.", result ); assertResultIsSuccess( result ); List changedFiles = result.getChangedFiles(); assertEquals( "Expected 2 files in the updated files list " + changedFiles, 2, changedFiles.size() ); // ---------------------------------------------------------------------- // Assert the files in the updated files list // ---------------------------------------------------------------------- Iterator files = new TreeSet( changedFiles ).iterator(); ScmFile file = (ScmFile) files.next(); assertPath( "/src/main/java/org/Foo.java", file.getPath() ); assertEquals( ScmFileStatus.ADDED, file.getStatus() ); file = (ScmFile) files.next(); assertPath( "/pom.xml", file.getPath() ); assertEquals( ScmFileStatus.MODIFIED, file.getStatus() ); assertFile( getUpdatingCopy(), "/readme.txt" ); assertFalse( "project.xml created incorrectly", new File( getUpdatingCopy(), "/project.xml" ).exists() ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/0000755000175000017500000000000011345536673027367 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/tag/TagCommandTckTest.ja0000644000175000017500000000654310604531451033211 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.tag; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.FileWriter; /** * This test tests the tag command. * * @author Brett Porter * @version $Id: TagCommandTckTest.java 525259 2007-04-03 20:03:53Z evenisse $ */ public abstract class TagCommandTckTest extends ScmTckTestCase { public void testTagCommandTest() throws Exception { String tag = "test-tag"; TagScmResult tagResult = getScmManager().getProviderByUrl( getScmUrl() ) .tag( getScmRepository(), new ScmFileSet( getWorkingCopy() ), tag ); assertResultIsSuccess( tagResult ); assertEquals( "check all 4 files tagged", 4, tagResult.getTaggedFiles().size() ); File readmeTxt = new File( getWorkingCopy(), "readme.txt" ); assertEquals( "check readme.txt contents", "/readme.txt", FileUtils.fileRead( readmeTxt ) ); changeReadmeTxt( readmeTxt ); CheckInScmResult checkinResult = getScmManager().checkIn( getScmRepository(), new ScmFileSet( getWorkingCopy() ), "commit message" ); assertResultIsSuccess( checkinResult ); CheckOutScmResult checkoutResult = getScmManager().checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ) ); assertResultIsSuccess( checkoutResult ); readmeTxt = new File( getAssertionCopy(), "readme.txt" ); assertEquals( "check readme.txt contents", "changed file", FileUtils.fileRead( readmeTxt ) ); FileUtils.deleteDirectory( getAssertionCopy() ); assertFalse( "check previous assertion copy deleted", getAssertionCopy().exists() ); checkoutResult = getScmManager().getProviderByUrl( getScmUrl() ) .checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ), new ScmTag( tag ) ); assertResultIsSuccess( checkoutResult ); assertEquals( "check readme.txt contents is from tagged version", "/readme.txt", FileUtils.fileRead( readmeTxt ) ); } private void changeReadmeTxt( File readmeTxt ) throws Exception { FileWriter output = new FileWriter( readmeTxt ); output.write( "changed file" ); output.close(); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/0000755000175000017500000000000011345536672030217 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/checkin/CheckInCommandTc0000644000175000017500000001720611203111063033212 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.checkin; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmFileStatus; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import java.util.List; import java.util.Map; /** * This test tests the check out command. * * @author Brett Porter * @version $Id: CheckInCommandTckTest.java 774941 2009-05-14 21:50:43Z olamy $ */ public abstract class CheckInCommandTckTest extends ScmTckTestCase { public void testCheckInCommandTest() throws Exception { // Make sure that the correct files was checked out File fooJava = new File( getWorkingCopy(), "src/main/java/Foo.java" ); File barJava = new File( getWorkingCopy(), "src/main/java/Bar.java" ); File readmeTxt = new File( getWorkingCopy(), "readme.txt" ); assertFalse( "check Foo.java doesn't yet exist", fooJava.canRead() ); assertFalse( "check Bar.java doesn't yet exist", barJava.canRead() ); assertTrue( "check can read readme.txt", readmeTxt.canRead() ); // Change the files createFooJava( fooJava ); createBarJava( barJava ); changeReadmeTxt( readmeTxt ); AddScmResult addResult = getScmManager().add( getScmRepository(), new ScmFileSet( getWorkingCopy(), "src/main/java/Foo.java", null ) ); assertResultIsSuccess( addResult ); CheckInScmResult result = getScmManager().checkIn( getScmRepository(), new ScmFileSet( getWorkingCopy() ), "Commit message" ); assertResultIsSuccess( result ); List files = result.getCheckedInFiles(); assertNotNull( files ); assertEquals( 2, files.size() ); Map fileMap = mapFilesByPath( files ); ScmFile file1 = (ScmFile) fileMap.get( "src/main/java/Foo.java" ); assertNotNull( file1 ); assertEquals( ScmFileStatus.CHECKED_IN, file1.getStatus() ); ScmFile file2 = (ScmFile) fileMap.get( "readme.txt" ); assertNotNull( file2 ); assertEquals( ScmFileStatus.CHECKED_IN, file2.getStatus() ); CheckOutScmResult checkoutResult = getScmManager().checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ) ); assertResultIsSuccess( checkoutResult ); fooJava = new File( getAssertionCopy(), "src/main/java/Foo.java" ); barJava = new File( getAssertionCopy(), "src/main/java/Bar.java" ); readmeTxt = new File( getAssertionCopy(), "readme.txt" ); assertTrue( "check can read Foo.java", fooJava.canRead() ); assertFalse( "check Bar.java doesn't exist", barJava.canRead() ); assertTrue( "check can read readme.txt", readmeTxt.canRead() ); assertEquals( "check readme.txt contents", "changed file", FileUtils.fileRead( readmeTxt ) ); } public void testCheckInCommandPartialFileset() throws Exception { // Make sure that the correct files was checked out File fooJava = new File( getWorkingCopy(), "src/main/java/Foo.java" ); File barJava = new File( getWorkingCopy(), "src/main/java/Bar.java" ); File readmeTxt = new File( getWorkingCopy(), "readme.txt" ); assertFalse( "check Foo.java doesn't yet exist", fooJava.canRead() ); assertFalse( "check Bar.java doesn't yet exist", barJava.canRead() ); assertTrue( "check can read readme.txt", readmeTxt.canRead() ); // Change the files createFooJava( fooJava ); createBarJava( barJava ); changeReadmeTxt( readmeTxt ); AddScmResult addResult = getScmManager().getProviderByUrl( getScmUrl() ) .add( getScmRepository(), new ScmFileSet( getWorkingCopy(), "src/main/java/Foo.java", null ) ); assertResultIsSuccess( addResult ); CheckInScmResult result = getScmManager().checkIn( getScmRepository(), new ScmFileSet( getWorkingCopy(), "**/Foo.java", null ), "Commit message" ); assertResultIsSuccess( result ); List files = result.getCheckedInFiles(); assertNotNull( files ); assertEquals( 1, files.size() ); ScmFile file1 = (ScmFile) files.get( 0 ); assertEquals( ScmFileStatus.CHECKED_IN, file1.getStatus() ); assertPath( "/test-repo/check-in/Foo.java", file1.getPath() ); CheckOutScmResult checkoutResult = getScmManager().checkOut( getScmRepository(), new ScmFileSet( getAssertionCopy() ) ); assertResultIsSuccess( checkoutResult ); fooJava = new File( getAssertionCopy(), "src/main/java/Foo.java" ); barJava = new File( getAssertionCopy(), "src/main/java/Bar.java" ); readmeTxt = new File( getAssertionCopy(), "readme.txt" ); assertTrue( "check can read Foo.java", fooJava.canRead() ); assertFalse( "check Bar.java doesn't exist", barJava.canRead() ); assertTrue( "check can read readme.txt", readmeTxt.canRead() ); assertEquals( "check readme.txt contents", "/readme.txt", FileUtils.fileRead( readmeTxt ) ); } private void createFooJava( File fooJava ) throws Exception { FileWriter output = new FileWriter( fooJava ); PrintWriter printer = new PrintWriter( output ); printer.println( "public class Foo" ); printer.println( "{" ); printer.println( " public void foo()" ); printer.println( " {" ); printer.println( " int i = 10;" ); printer.println( " }" ); printer.println( "}" ); printer.close(); output.close(); } private void createBarJava( File barJava ) throws Exception { FileWriter output = new FileWriter( barJava ); PrintWriter printer = new PrintWriter( output ); printer.println( "public class Bar" ); printer.println( "{" ); printer.println( " public int bar()" ); printer.println( " {" ); printer.println( " return 20;" ); printer.println( " }" ); printer.println( "}" ); printer.close(); output.close(); } private void changeReadmeTxt( File readmeTxt ) throws Exception { FileWriter output = new FileWriter( readmeTxt ); output.write( "changed file" ); output.close(); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/0000755000175000017500000000000011345536673027567 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/list/ListCommandTckTest.0000644000175000017500000000573411050652666033307 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.list; /* * 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. */ import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.provider.ScmProvider; import java.io.File; import java.util.List; /** * This test tests the list command. * * @author Carlos Sanchez * @version $Id: ListCommandTckTest.java 685686 2008-08-13 21:44:22Z olamy $ */ public abstract class ListCommandTckTest extends ScmTckTestCase { public void testListCommandTest() throws Exception { ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) ); List files = runList( fileSet, false ); assertEquals( "The result of the list command doesn't have all the files in SCM: " + files, 3, files.size() ); } public void testListCommandRecursiveTest() throws Exception { ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "." ) ); List files = runList( fileSet, true ); assertEquals( "The result of the list command doesn't have all the files in SCM: " + files, 10, files.size() ); } public void testListCommandUnexistantFileTest() throws Exception { ScmFileSet fileSet = new ScmFileSet( new File( "." ), new File( "/void" ) ); ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); ListScmResult result = provider.list( getScmRepository(), fileSet, false, (ScmVersion) null ); assertFalse( "Found file when shouldn't", result.isSuccess() ); } private List runList( ScmFileSet fileSet, boolean recursive ) throws Exception { ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); ListScmResult result = provider.list( getScmRepository(), fileSet, recursive, (ScmVersion) null ); assertTrue( "SCM command failed: " + result.getCommandLine() + " : " + result.getProviderMessage() + ( result.getCommandOutput() == null ? "" : ": " + result.getCommandOutput() ), result.isSuccess() ); return result.getFiles(); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/0000755000175000017500000000000011345536672027523 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/diff/DiffCommandTckTest.0000644000175000017500000001276110604260544033171 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.diff; /* * 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. */ import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import java.io.File; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeSet; /** * This test tests the diff command. * * @author Brett Porter * @version $Id: DiffCommandTckTest.java 524909 2007-04-02 20:02:44Z evenisse $ */ public abstract class DiffCommandTckTest extends ScmTckTestCase { public void testDiffCommand() throws Exception { ScmRepository repository = getScmRepository(); // ---------------------------------------------------------------------- // Change the files // ---------------------------------------------------------------------- // // readme.txt is changed (changed file in the root directory) // project.xml is added (added file in the root directory) // src/test/resources is untouched (a empty directory is left untouched) // src/test/java is untouched (a non empty directory is left untouched) // src/test/java/org (a empty directory is added) // src/main/java/org/Foo.java (a non empty directory is added) // // /readme.txt ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" ); // /project.xml ScmTestCase.makeFile( getWorkingCopy(), "/project.xml", "changed project.xml" ); addToWorkingTree( getWorkingCopy(), new File( "project.xml" ), repository ); // /src/test/java/org ScmTestCase.makeDirectory( getWorkingCopy(), "/src/test/java/org" ); addToWorkingTree( getWorkingCopy(), new File( "src/test/java/org" ), repository ); // /src/main/java/org/Foo.java ScmTestCase.makeFile( getWorkingCopy(), "/src/main/java/org/Foo.java" ); addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org" ), repository ); // src/main/java/org/Foo.java addToWorkingTree( getWorkingCopy(), new File( "src/main/java/org/Foo.java" ), repository ); // ---------------------------------------------------------------------- // Diff the project // ---------------------------------------------------------------------- ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() ); DiffScmResult result = provider.diff( repository, fileSet, null, (ScmVersion) null ); assertNotNull( "The command returned a null result.", result ); assertResultIsSuccess( result ); List changedFiles = result.getChangedFiles(); Map differences = result.getDifferences(); assertEquals( "Expected 3 files in the changed files list " + changedFiles, 3, changedFiles.size() ); assertEquals( "Expected 3 files in the differences list " + differences, 3, differences.size() ); // ---------------------------------------------------------------------- // Assert the files in the changed files list // ---------------------------------------------------------------------- Iterator files = new TreeSet( changedFiles ).iterator(); //Check Foo.java ScmFile file = (ScmFile) files.next(); assertPath( "/src/main/java/org/Foo.java", file.getPath() ); assertTrue( file.getStatus().isDiff() ); String postRangeStr = "+/src/main/java/org/Foo.java\n\\ No newline at end of file\n"; String actualStr = differences.get( file.getPath() ).toString(); assertTrue( actualStr.endsWith( postRangeStr ) ); //Check readme.txt file = (ScmFile) files.next(); assertPath( "/readme.txt", file.getPath() ); assertTrue( file.getStatus().isDiff() ); postRangeStr = "-/readme.txt\n\\ No newline at end of file\n+changed readme.txt\n\\ No newline at end of file\n"; actualStr = differences.get( file.getPath() ).toString(); assertTrue( actualStr.endsWith( postRangeStr ) ); //Check project.xml file = (ScmFile) files.next(); assertPath( "/project.xml", file.getPath() ); postRangeStr = "+changed project.xml\n\\ No newline at end of file\n"; actualStr = differences.get( file.getPath() ).toString(); assertTrue( actualStr.endsWith( postRangeStr ) ); assertTrue( file.getStatus().isDiff() ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/0000755000175000017500000000000011345536672030542 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogCommandTckTest.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/changelog/ChangeLogComma0000644000175000017500000000723511050652666033273 0ustar twernertwernerpackage org.apache.maven.scm.tck.command.changelog; /* * 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. */ import org.apache.maven.scm.ChangeSet; import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTckTestCase; import org.apache.maven.scm.ScmTestCase; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.provider.ScmProvider; import java.util.Date; /** * Test Changlog command.
* 1. Get initial log
* 2. Add one revision
* 3. Get the two logs
* 4. Get the last log based on date
* 5. Test last log for date and comment
* * @author Torbjørn Eikli Smørgrav */ public abstract class ChangeLogCommandTckTest extends ScmTckTestCase { private static final String COMMIT_MSG = "Second changelog"; public void testChangeLogCommand() throws Exception { Thread.sleep( 1000 ); ScmProvider provider = getScmManager().getProviderByRepository( getScmRepository() ); ScmFileSet fileSet = new ScmFileSet( getWorkingCopy() ); //We should have one log entry for the initial repository ChangeLogScmResult result = provider.changeLog( getScmRepository(), fileSet, null, null, 0, (ScmBranch) null, null ); assertTrue( result.isSuccess() ); assertEquals( 1, result.getChangeLog().getChangeSets().size() ); //Make a timestamp that we know are after initial revision but before the second Date timeBeforeSecond = new Date(); //Current time // pause a couple seconds... [SCM-244] Thread.sleep( 2000 ); //Make a change to the readme.txt and commit the change ScmTestCase.makeFile( getWorkingCopy(), "/readme.txt", "changed readme.txt" ); CheckInScmResult checkInResult = provider.checkIn( getScmRepository(), fileSet, COMMIT_MSG ); assertTrue( "Unable to checkin changes to the repository", checkInResult.isSuccess() ); result = provider.changeLog( getScmRepository(), fileSet, (ScmVersion) null, null ); assertTrue( result.isSuccess() ); assertEquals( 2, result.getChangeLog().getChangeSets().size() ); //Now only retrieve the changelog after timeBeforeSecondChangeLog Date currentTime = new Date(); result = provider .changeLog( getScmRepository(), fileSet, timeBeforeSecond, currentTime, 0, new ScmBranch( "" ) ); //Thorough assert of the last result assertTrue( result.isSuccess() ); assertEquals( 1, result.getChangeLog().getChangeSets().size() ); ChangeSet changeset = (ChangeSet) result.getChangeLog().getChangeSets().get( 0 ); assertTrue( changeset.getDate().after( timeBeforeSecond ) ); assertEquals( COMMIT_MSG, changeset.getComment() ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/repository/0000755000175000017500000000000011345536672026633 5ustar twernertwernermaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/repository/ScmRepositoryStub.java0000644000175000017500000000276110535556312033155 0ustar twernertwernerpackage org.apache.maven.scm.repository; /* * 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. */ import org.apache.maven.scm.provider.ScmProviderRepositoryStub; /** * Stub for ScmRepository for unit testing purposes. * More information about Stubs on Martin Fowler's TestDouble * * @author Carlos Sanchez * @version $Id: ScmRepositoryStub.java 483105 2006-12-06 15:07:54Z evenisse $ */ public class ScmRepositoryStub extends ScmRepository { /** * Creates a new stub with a new ScmProviderRepositoryStub as scmProviderRepository */ public ScmRepositoryStub() { super( "stub-provider", new ScmProviderRepositoryStub() ); } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java0000644000175000017500000001445111203111063030054 0ustar twernertwernerpackage org.apache.maven.scm; /* * 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. */ import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.provider.ScmProvider; import org.apache.maven.scm.repository.ScmRepository; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; /** *

* Base class for all TcK tests. *

*

* Basically all it does is to setup a default test enviroment * common for all tck tests. The default setup includes: *

    *
  1. Delete all default locations (working copy, updating copy etc)
  2. *
  3. Initialize the repository
  4. *
  5. Check out the repository to the working copy
  6. *
*

* * @author Torbj�rn Eikli Sm�rgrav * @version $Id: ScmTckTestCase.java 774941 2009-05-14 21:50:43Z olamy $ */ public abstract class ScmTckTestCase extends ScmTestCase { private ScmRepository scmRepository; private List scmFileNames; /** * @return A provider spesific and valid url for the repository * @throws Exception if any */ public abstract String getScmUrl() throws Exception; /** *

* Get the list of file names that is supposed to be in the test repo. *

*
    *
  • /pom.xml
  • *
  • /readme.txt
  • *
  • /src/main/java/Application.java
  • *
  • /src/test/java/Test.java
  • *
* * @return {@link List} of {@link String} objects */ protected List getScmFileNames() { return scmFileNames; } /** *

* Initialize repository at the {@link #getScmUrl()} location with the files in {@link #getScmFileNames()} *

*

* The setup is also asserting on the existence of these files.
* This should only be used by this class (thus do not call this method from derived classes) *

* Note: 'svnadmin' should be a system command. * * @throws Exception if any */ public abstract void initRepo() throws Exception; /** {@inheritDoc} */ protected void setUp() throws Exception { super.setUp(); scmRepository = null; initRepo(); checkOut( getWorkingCopy(), getScmRepository() ); scmFileNames = new ArrayList( 4 ); scmFileNames.add( "/pom.xml" ); scmFileNames.add( "/readme.txt" ); scmFileNames.add( "/src/main/java/Application.java" ); scmFileNames.add( "/src/test/java/Test.java" ); Iterator it = getScmFileNames().iterator(); while ( it.hasNext() ) { assertFile( getWorkingCopy(), (String) it.next() ); } } /** * Convenience method to get the ScmRepository for this provider */ protected ScmRepository getScmRepository() throws Exception { if ( scmRepository == null ) { scmRepository = getScmManager().makeScmRepository( getScmUrl() ); } return scmRepository; } /** * Convenience method to checkout files from the repository */ protected CheckOutScmResult checkOut( File workingDirectory, ScmRepository repository ) throws Exception { CheckOutScmResult result = getScmManager().getProviderByUrl( getScmUrl() ) .checkOut( repository, new ScmFileSet( workingDirectory ), (ScmVersion) null ); assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() ); return result; } /** * Convenience method to add a file to the working tree at the working directory */ protected void addToWorkingTree( File workingDirectory, File file, ScmRepository repository ) throws Exception { ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() ); AddScmResult result = provider.add( repository, new ScmFileSet( workingDirectory, file ) ); assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() ); List addedFiles = result.getAddedFiles(); if ( new File( workingDirectory, file.getPath() ).isFile() ) { // Don't check directory add because some SCM tools ignore it assertEquals( "Expected 1 file in the added files list " + addedFiles, 1, addedFiles.size() ); } } /** * take the files of the given list, add them to a TreeMap and * use the pathName String as key for the Map. * This function is useful for every TCK which has to check for the * existence of more than 1 file of the returned ScmResult, regardless * of their order in the list. * All backslashes in the path will be replaced by forward slashes * for Windows compatibility. * * @param files List with {@code ScmFile}s * @return Map key=pathName, value=ScmFile */ protected Map/**/ mapFilesByPath( List/**/ files ) { if ( files == null ) { return null; } Map mappedFiles = new TreeMap(); Iterator it = files.iterator(); while ( it.hasNext() ) { ScmFile scmFile = (ScmFile) it.next(); String path = StringUtils.replace( scmFile.getPath(), "\\", "/" ); mappedFiles.put( path, scmFile ); } return mappedFiles; } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/provider/0000755000175000017500000000000011345536673026247 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootmaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderRepositoryStub.javamaven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderRepositoryStub.j0000644000175000017500000000331411050561524033600 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ /** * Stub for ScmProviderRepository for unit testing purposes. * More information about Stubs on Martin Fowler's TestDouble * * @author Carlos Sanchez * @version $Id: ScmProviderRepositoryStub.java 685549 2008-08-13 13:36:20Z vsiveton $ */ public class ScmProviderRepositoryStub extends ScmProviderRepository { private boolean persistCheckout = false; /** * Creates a ScmProviderRepositoryStub with null user and password, and persistCheckout false */ public ScmProviderRepositoryStub() { } /** {@inheritDoc} */ public boolean isPersistCheckout() { return persistCheckout; } /** {@inheritDoc} */ public void setPersistCheckout( boolean persistCheckout ) { this.persistCheckout = persistCheckout; } } maven-scm-1.3/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java0000644000175000017500000005075011313217053032173 0ustar twernertwernerpackage org.apache.maven.scm.provider; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmBranchParameters; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmTagParameters; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.add.AddScmResult; import org.apache.maven.scm.command.branch.BranchScmResult; import org.apache.maven.scm.command.changelog.ChangeLogScmResult; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.diff.DiffScmResult; import org.apache.maven.scm.command.edit.EditScmResult; import org.apache.maven.scm.command.export.ExportScmResult; import org.apache.maven.scm.command.list.ListScmResult; import org.apache.maven.scm.command.remove.RemoveScmResult; import org.apache.maven.scm.command.status.StatusScmResult; import org.apache.maven.scm.command.tag.TagScmResult; import org.apache.maven.scm.command.unedit.UnEditScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.log.ScmLogger; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.apache.maven.scm.repository.UnknownRepositoryStructure; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; /** * Stub implementation of ScmProvider for unit testing purposes. * It allows setting the expected results that the different methods will return. * More information about Stubs on Martin Fowler's TestDouble * * @author Carlos Sanchez * @version $Id: ScmProviderStub.java 892494 2009-12-19 18:40:43Z olamy $ */ public class ScmProviderStub implements ScmProvider { private String scmType, scmSpecificFilename; private List loggers = new ArrayList(); private boolean requiresEditmode; private ScmProviderRepository scmProviderRepository = new ScmProviderRepositoryStub(); private List errors = new ArrayList(); private AddScmResult addScmResult; private BranchScmResult branchScmResult; private CheckInScmResult checkInScmResult; private CheckOutScmResult checkOutScmResult; private ChangeLogScmResult changeLogScmResult; private DiffScmResult diffScmResult; private RemoveScmResult removeScmResult; private StatusScmResult statusScmResult; private TagScmResult tagScmResult; private UpdateScmResult updateScmResult; private EditScmResult editScmResult; private UnEditScmResult unEditScmResult; private ListScmResult listScmResult; private ExportScmResult exportScmResult; /** * Create a new ScmProviderStub with bogus (not null) attributes */ public ScmProviderStub() { setScmSpecificFilename( "" ); setAddScmResult( new AddScmResult( "", Collections.EMPTY_LIST ) ); setBranchScmResult( new BranchScmResult( "", Collections.EMPTY_LIST ) ); setChangeLogScmResult( new ChangeLogScmResult( "", "", "", true ) ); setCheckInScmResult( new CheckInScmResult( "", "", "", true ) ); setCheckOutScmResult( new CheckOutScmResult( "", "", "", true ) ); setDiffScmResult( new DiffScmResult( "", "", "", true ) ); setEditScmResult( new EditScmResult( "", "", "", true ) ); setExportScmResult( new ExportScmResult( "", "", "", true ) ); setRemoveScmResult( new RemoveScmResult( "", "", "", true ) ); setStatusScmResult( new StatusScmResult( "", "", "", true ) ); setTagScmResult( new TagScmResult( "", "", "", true ) ); setUnEditScmResult( new UnEditScmResult( "", "", "", true ) ); setUpdateScmResult( new UpdateScmResult( "", "", "", true ) ); } /** {@inheritDoc} */ public String sanitizeTagName( String tag ) { return tag; } /** {@inheritDoc} */ public boolean validateTagName( String tag ) { return true; } /** {@inheritDoc} */ public String getScmType() { return scmType; } public void setScmSpecificFilename( String scmSpecificFilename ) { this.scmSpecificFilename = scmSpecificFilename; } /** {@inheritDoc} */ public void addListener( ScmLogger logger ) { loggers.add( logger ); } public boolean requiresEditMode() { return requiresEditmode; } public void setAddScmResult( AddScmResult addScmResult ) { this.addScmResult = addScmResult; } public AddScmResult getAddScmResult() { return addScmResult; } public void setBranchScmResult( BranchScmResult branchScmResult ) { this.branchScmResult = branchScmResult; } public BranchScmResult getBranchScmResult() { return branchScmResult; } public void setCheckInScmResult( CheckInScmResult checkInScmResult ) { this.checkInScmResult = checkInScmResult; } public CheckInScmResult getCheckInScmResult() { return checkInScmResult; } public void setCheckOutScmResult( CheckOutScmResult checkOutScmResult ) { this.checkOutScmResult = checkOutScmResult; } public CheckOutScmResult getCheckOutScmResult() { return checkOutScmResult; } public void setChangeLogScmResult( ChangeLogScmResult changeLogScmResult ) { this.changeLogScmResult = changeLogScmResult; } public ChangeLogScmResult getChangeLogScmResult() { return changeLogScmResult; } public void setDiffScmResult( DiffScmResult diffScmResult ) { this.diffScmResult = diffScmResult; } public DiffScmResult getDiffScmResult() { return diffScmResult; } public ExportScmResult getExportScmResult() { return exportScmResult; } public void setExportScmResult( ExportScmResult exportScmResult ) { this.exportScmResult = exportScmResult; } public void setTagScmResult( TagScmResult tagScmResult ) { this.tagScmResult = tagScmResult; } public TagScmResult getTagScmResult() { return tagScmResult; } public void setRemoveScmResult( RemoveScmResult removeScmResult ) { this.removeScmResult = removeScmResult; } public RemoveScmResult getRemoveScmResult() { return removeScmResult; } public void setStatusScmResult( StatusScmResult statusScmResult ) { this.statusScmResult = statusScmResult; } public StatusScmResult getStatusScmResult() { return statusScmResult; } public void setUpdateScmResult( UpdateScmResult updateScmResult ) { this.updateScmResult = updateScmResult; } public UpdateScmResult getUpdateScmResult() { return updateScmResult; } public void setEditScmResult( EditScmResult editScmResult ) { this.editScmResult = editScmResult; } public EditScmResult getEditScmResult() { return editScmResult; } public void setUnEditScmResult( UnEditScmResult unEditScmResult ) { this.unEditScmResult = unEditScmResult; } public UnEditScmResult getUnEditScmResult() { return unEditScmResult; } public void setListScmResult( ListScmResult listScmResult ) { this.listScmResult = listScmResult; } public ListScmResult getListScmResult() { return listScmResult; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) throws ScmRepositoryException { return scmProviderRepository; } /** {@inheritDoc} */ public ScmProviderRepository makeProviderScmRepository( File path ) throws ScmRepositoryException, UnknownRepositoryStructure { return scmProviderRepository; } /** {@inheritDoc} */ public List validateScmUrl( String scmSpecificUrl, char delimiter ) { return errors; } /** {@inheritDoc} */ public String getScmSpecificFilename() { return scmSpecificFilename; } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getAddScmResult(); } /** {@inheritDoc} */ public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return getAddScmResult(); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName ) throws ScmException { return getBranchScmResult(); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message ) throws ScmException { return getBranchScmResult(); } /** {@inheritDoc} */ public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, ScmBranchParameters scmBranchParameters ) throws ScmException { return getBranchScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, String branch, String datePattern ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag, String datePattern ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, int numDays, ScmBranch branch, String datePattern ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision, ScmVersion endRevision, String datePattern ) throws ScmException { return getChangeLogScmResult(); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String tag, String message ) throws ScmException { return getCheckInScmResult(); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return getCheckInScmResult(); } /** {@inheritDoc} */ public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message ) throws ScmException { return getCheckInScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, String tag, boolean recursive ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, boolean recursive ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public CheckOutScmResult checkOut( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion version, boolean recursive ) throws ScmException { return getCheckOutScmResult(); } /** {@inheritDoc} */ public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, String startRevision, String endRevision ) throws ScmException { return getDiffScmResult(); } /** {@inheritDoc} */ public DiffScmResult diff( ScmRepository scmRepository, ScmFileSet scmFileSet, ScmVersion startVersion, ScmVersion endVersion ) throws ScmException { return getDiffScmResult(); } /** * @return getUpdateScmResult() always */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, String datePattern, boolean runChangelog ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getEditScmResult(); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return getExportScmResult(); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String tag, String outputDirectory ) throws ScmException { return getExportScmResult(); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getExportScmResult(); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return getExportScmResult(); } /** {@inheritDoc} */ public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String outputDirectory ) throws ScmException { return getExportScmResult(); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, String tag ) throws ScmException { return getListScmResult(); } /** {@inheritDoc} */ public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version ) throws ScmException { return getListScmResult(); } /** {@inheritDoc} */ public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message ) throws ScmException { return getRemoveScmResult(); } /** {@inheritDoc} */ public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getStatusScmResult(); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return getTagScmResult(); } /** {@inheritDoc} */ public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tag, String message ) throws ScmException { return getTagScmResult(); } public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, ScmTagParameters scmTagParameters ) throws ScmException { return getTagScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, boolean runChangelog ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, String datePattern ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String tag, Date lastUpdate, String datePattern ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, boolean runChangelog ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, String datePattern ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate, String datePattern ) throws ScmException { return getUpdateScmResult(); } /** {@inheritDoc} */ public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet ) throws ScmException { return getUnEditScmResult(); } } maven-scm-1.3/maven-scm-test/pom.xml0000644000175000017500000000326011322611461017357 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm 1.3 maven-scm-test Maven SCM Test Tests library to test all SCM Provider implementations. org.apache.maven.scm maven-scm-api org.apache.maven.scm maven-scm-manager-plexus maven-scm-1.3/maven-scm-client/0000755000175000017500000000000011345536672016357 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/0000755000175000017500000000000011345536672017146 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/site/0000755000175000017500000000000011345536672020112 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/site/site.xml0000644000175000017500000000211511051127665021567 0ustar twernertwerner maven-scm-1.3/maven-scm-client/src/site/apt/0000755000175000017500000000000011345536672020676 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/site/apt/index.apt0000644000175000017500000000416311051142056022476 0ustar twernertwerner ------ Introduction ------ Vincent Siveton ------ 2008-08-14 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven SCM Client The Maven SCM client is a simple SCM command line tool. * Usage +-----+ # java -jar target\maven-scm-client-1.1-jar-with-dependencies.jar Usage: maven-scm-client [ []] scmVersion is a branch name/tag name/revision number. scmVersionType can be 'branch', 'tag', 'revision'. The default value is 'revision'. +-----+ * Example +-----+ # java -jar target\maven-scm-client-1.1-jar-with-dependencies.jar checkout c:\temp\maven-scm-client scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-client [INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout http://svn.apache.org/repos/asf/maven/scm/trunk/maven-scm-client maven-scm-client" [INFO] Working directory: c:\temp Checked out these files: maven-scm-client\src\main\java\org\apache\maven\scm\client\cli\MavenScmCli.java maven-scm-client\src\main\resources\META-INF\plexus\components.xml maven-scm-client\src\main\bash\maven-scm-update maven-scm-client\src\main\bash\maven-scm-checkin maven-scm-client\src\main\bash\maven-scm-checkout maven-scm-client\src\site\site.xml maven-scm-client\pom.xml +-----+ maven-scm-1.3/maven-scm-client/src/main/0000755000175000017500000000000011345536672020072 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/resources/0000755000175000017500000000000011345536672022104 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/resources/META-INF/0000755000175000017500000000000011345536672023244 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/resources/META-INF/plexus/0000755000175000017500000000000011345536672024564 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/resources/META-INF/plexus/components.xml0000644000175000017500000001051511050570123027453 0ustar twernertwerner org.apache.maven.scm.manager.ScmManager org.apache.maven.scm.manager.plexus.DefaultScmManager org.apache.maven.scm.provider.ScmProvider scmProviders org.apache.maven.scm.provider.ScmProvider accurev org.apache.maven.scm.provider.accurev.AccuRevScmProvider Implementation of Accurev integration with Maven SCM org.apache.maven.scm.provider.ScmProvider bazaar org.apache.maven.scm.provider.bazaar.BazaarScmProvider Bazaar NG http://bazaar-vcs. org.apache.maven.scm.provider.ScmProvider clearcase org.apache.maven.scm.provider.clearcase.ClearCaseScmProvider org.apache.maven.scm.provider.ScmProvider hg org.apache.maven.scm.provider.hg.HgScmProvider Mercurial (HG) is a decentralized revision control system. org.apache.maven.scm.provider.ScmProvider local org.apache.maven.scm.provider.local.LocalScmProvider org.apache.maven.scm.provider.ScmProvider perforce org.apache.maven.scm.provider.perforce.PerforceScmProvider org.apache.maven.scm.provider.ScmProvider cvs_native org.apache.maven.scm.provider.cvslib.cvsexe.CvsExeScmProvider org.apache.maven.scm.provider.ScmProvider cvs org.apache.maven.scm.provider.cvslib.cvsjava.CvsJavaScmProvider org.apache.maven.scm.provider.ScmProvider git org.apache.maven.scm.provider.git.gitexe.GitExeScmProvider org.apache.maven.scm.provider.ScmProvider svn org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider org.apache.maven.scm.provider.ScmProvider starteam org.apache.maven.scm.provider.starteam.StarteamScmProvider org.apache.maven.scm.provider.ScmProvider synergy org.apache.maven.scm.provider.synergy.SynergyScmProvider org.apache.maven.scm.provider.ScmProvider vss org.apache.maven.scm.provider.vss.VssScmProvider maven-scm-1.3/maven-scm-client/src/main/java/0000755000175000017500000000000011345536672021013 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/0000755000175000017500000000000011345536672021602 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/0000755000175000017500000000000011345536672023023 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/maven/0000755000175000017500000000000011345536672024131 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/maven/scm/0000755000175000017500000000000011345536672024713 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/maven/scm/client/0000755000175000017500000000000011345536672026171 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/0000755000175000017500000000000011345536672026740 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java0000644000175000017500000002406011051142264031726 0ustar twernertwernerpackage org.apache.maven.scm.client.cli; /* * 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. */ import org.apache.maven.scm.ScmBranch; import org.apache.maven.scm.ScmException; import org.apache.maven.scm.ScmFile; import org.apache.maven.scm.ScmFileSet; import org.apache.maven.scm.ScmResult; import org.apache.maven.scm.ScmRevision; import org.apache.maven.scm.ScmTag; import org.apache.maven.scm.ScmVersion; import org.apache.maven.scm.command.checkin.CheckInScmResult; import org.apache.maven.scm.command.checkout.CheckOutScmResult; import org.apache.maven.scm.command.update.UpdateScmResult; import org.apache.maven.scm.manager.NoSuchScmProviderException; import org.apache.maven.scm.manager.ScmManager; import org.apache.maven.scm.repository.ScmRepository; import org.apache.maven.scm.repository.ScmRepositoryException; import org.codehaus.plexus.embed.Embedder; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.Iterator; import java.util.List; /** * @author Trygve Laugstøl * @author Emmanuel Venisse * @version $Id: MavenScmCli.java 686092 2008-08-14 23:50:12Z vsiveton $ */ public class MavenScmCli { private Embedder plexus; private ScmManager scmManager; // ---------------------------------------------------------------------- // Lifecycle // ---------------------------------------------------------------------- public MavenScmCli() throws Exception { plexus = new Embedder(); plexus.start(); scmManager = (ScmManager) plexus.lookup( ScmManager.ROLE ); } public void stop() { try { plexus.stop(); } catch ( Exception ex ) { // ignore } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public static void main( String[] args ) { MavenScmCli cli; try { cli = new MavenScmCli(); } catch ( Exception ex ) { System.err.println( "Error while starting Maven Scm." ); ex.printStackTrace( System.err ); return; } String scmUrl; String command; if ( args.length != 3 ) { System.err.println( "Usage: maven-scm-client [ []]" ); System.err.println( "scmVersion is a branch name/tag name/revision number." ); System.err.println( "scmVersionType can be 'branch', 'tag', 'revision'. " + "The default value is 'revision'." ); return; } command = args[0]; File workingDirectory = new File( args[1] ); scmUrl = args[2]; ScmVersion scmVersion = null; if ( args.length > 3 ) { String version = args[3]; if ( args.length > 4 ) { String type = args[4]; if ( "tag".equals( type ) ) { scmVersion = new ScmTag( version ); } else if ( "branch".equals( type ) ) { scmVersion = new ScmBranch( version ); } else if ( "revision".equals( type ) ) { scmVersion = new ScmRevision( version ); } else { throw new IllegalArgumentException( "'" + type + "' version type isn't known." ); } } else { scmVersion = new ScmRevision( args[3] ); } } cli.execute( scmUrl, command, workingDirectory, scmVersion ); cli.stop(); } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- public void execute( String scmUrl, String command, File workingDirectory, ScmVersion version ) { ScmRepository repository; try { repository = scmManager.makeScmRepository( scmUrl ); } catch ( NoSuchScmProviderException ex ) { System.err.println( "Could not find a provider." ); return; } catch ( ScmRepositoryException ex ) { System.err.println( "Error while connecting to the repository" ); ex.printStackTrace( System.err ); return; } try { if ( command.equals( "checkout" ) ) { checkOut( repository, workingDirectory, version ); } else if ( command.equals( "checkin" ) ) { checkIn( repository, workingDirectory, version ); } else if ( command.equals( "update" ) ) { update( repository, workingDirectory, version ); } else { System.err.println( "Unknown SCM command '" + command + "'." ); } } catch ( ScmException ex ) { System.err.println( "Error while executing the SCM command." ); ex.printStackTrace( System.err ); return; } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void checkOut( ScmRepository scmRepository, File workingDirectory, ScmVersion version ) throws ScmException { if ( workingDirectory.exists() ) { System.err.println( "The working directory already exist: '" + workingDirectory.getAbsolutePath() + "'." ); return; } if ( !workingDirectory.mkdirs() ) { System.err.println( "Error while making the working directory: '" + workingDirectory.getAbsolutePath() + "'." ); return; } CheckOutScmResult result = scmManager.checkOut( scmRepository, new ScmFileSet( workingDirectory ), version ); if ( !result.isSuccess() ) { showError( result ); return; } List checkedOutFiles = result.getCheckedOutFiles(); System.out.println( "Checked out these files: " ); for ( Iterator it = checkedOutFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); System.out.println( " " + file.getPath() ); } } private void checkIn( ScmRepository scmRepository, File workingDirectory, ScmVersion version ) throws ScmException { if ( !workingDirectory.exists() ) { System.err.println( "The working directory doesn't exist: '" + workingDirectory.getAbsolutePath() + "'." ); return; } String message = ""; CheckInScmResult result = scmManager.checkIn( scmRepository, new ScmFileSet( workingDirectory ), version, message ); if ( !result.isSuccess() ) { showError( result ); return; } List checkedInFiles = result.getCheckedInFiles(); System.out.println( "Checked in these files: " ); for ( Iterator it = checkedInFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); System.out.println( " " + file.getPath() ); } } private void update( ScmRepository scmRepository, File workingDirectory, ScmVersion version ) throws ScmException { if ( !workingDirectory.exists() ) { System.err.println( "The working directory doesn't exist: '" + workingDirectory.getAbsolutePath() + "'." ); return; } UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( workingDirectory ), version ); if ( !result.isSuccess() ) { showError( result ); return; } List updatedFiles = result.getUpdatedFiles(); System.out.println( "Updated these files: " ); for ( Iterator it = updatedFiles.iterator(); it.hasNext(); ) { ScmFile file = (ScmFile) it.next(); System.out.println( " " + file.getPath() ); } } // ---------------------------------------------------------------------- // // ---------------------------------------------------------------------- private void showError( ScmResult result ) { System.err.println( "There was a error while executing the SCM command." ); String providerMessage = result.getProviderMessage(); if ( !StringUtils.isEmpty( providerMessage ) ) { System.err.println( "Error message from the provider: " + providerMessage ); } else { System.err.println( "The provider didn't give a error message." ); } String output = result.getCommandOutput(); if ( !StringUtils.isEmpty( output ) ) { System.err.println( "Command output:" ); System.err.println( output ); } } } maven-scm-1.3/maven-scm-client/src/main/bash/0000755000175000017500000000000011345536672021007 5ustar twernertwernermaven-scm-1.3/maven-scm-client/src/main/bash/maven-scm-checkin0000755000175000017500000000140410171021766024211 0ustar twernertwerner#!/bin/bash command=checkin basedir=`dirname $0` CP= CP=$CP:~/.m2/repository/plexus/jars/plexus-container-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-container-default-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-utils-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/classworlds/jars/classworlds-1.1-alpha-2-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-client-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-cvs-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-svn-1.0-alpha-1-SNAPSHOT.jar java -classpath $CP org.apache.maven.scm.client.cli.MavenScmCli $command $@ maven-scm-1.3/maven-scm-client/src/main/bash/maven-scm-update0000755000175000017500000000140310171021766024066 0ustar twernertwerner#!/bin/bash command=update basedir=`dirname $0` CP= CP=$CP:~/.m2/repository/plexus/jars/plexus-container-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-container-default-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-utils-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/classworlds/jars/classworlds-1.1-alpha-2-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-client-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-cvs-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-svn-1.0-alpha-1-SNAPSHOT.jar java -classpath $CP org.apache.maven.scm.client.cli.MavenScmCli $command $@ maven-scm-1.3/maven-scm-client/src/main/bash/maven-scm-checkout0000755000175000017500000000140510171021766024413 0ustar twernertwerner#!/bin/bash command=checkout basedir=`dirname $0` CP= CP=$CP:~/.m2/repository/plexus/jars/plexus-container-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-container-default-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/plexus/jars/plexus-utils-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/classworlds/jars/classworlds-1.1-alpha-2-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-api-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-client-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-cvs-1.0-alpha-1-SNAPSHOT.jar CP=$CP:~/.m2/repository/maven/jars/maven-scm-providers-svn-1.0-alpha-1-SNAPSHOT.jar java -classpath $CP org.apache.maven.scm.client.cli.MavenScmCli $command $@ maven-scm-1.3/maven-scm-client/pom.xml0000644000175000017500000001147011322611461017660 0ustar twernertwerner 4.0.0 org.apache.maven.scm maven-scm 1.3 maven-scm-client Maven SCM Client SCM Client is a simple SCM command line tool. org.apache.maven.scm maven-scm-manager-plexus org.apache.maven.scm maven-scm-provider-accurev org.apache.maven.scm maven-scm-provider-bazaar org.apache.maven.scm maven-scm-provider-clearcase org.apache.maven.scm maven-scm-provider-cvsexe org.apache.maven.scm maven-scm-provider-cvsjava org.apache.maven.scm maven-scm-provider-gitexe org.apache.maven.scm maven-scm-provider-hg org.apache.maven.scm maven-scm-provider-local org.apache.maven.scm maven-scm-provider-perforce org.apache.maven.scm maven-scm-provider-starteam org.apache.maven.scm maven-scm-provider-svnexe org.apache.maven.scm maven-scm-provider-synergy org.apache.maven.scm maven-scm-provider-vss org.apache.maven.scm maven-scm-provider-tfs org.codehaus.plexus plexus-maven-plugin merge src/main/resources/META-INF/plexus/components.xml generate-resources merge-descriptors org.apache.maven.plugins maven-assembly-plugin jar-with-dependencies maven-scm-client-${project.version} org.apache.maven.scm.client.cli.MavenScmCli package single maven-scm-1.3/pom.xml0000644000175000017500000002726511322611461014527 0ustar twernertwerner 4.0.0 org.apache.maven maven-parent 15 ../pom/maven/pom.xml org.apache.maven.scm maven-scm 1.3 pom Maven SCM Maven SCM provides a common API for doing SCM operations. http://maven.apache.org/scm/ 2003 SCM Developer List scm-dev-subscribe@maven.apache.org scm-dev-unsubscribe@maven.apache.org scm-dev@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-scm-dev http://www.mail-archive.com/scm-dev@maven.apache.org http://maven.scm.dev.markmail.org/ SCM User List scm-users-subscribe@maven.apache.org scm-users-unsubscribe@maven.apache.org scm-users@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-scm-users http://www.mail-archive.com/scm-users@maven.apache.org http://maven.scm.users.markmail.org/ SCM Commits List scm-commits-subscribe@maven.apache.org scm-commits-unsubscribe@maven.apache.org http://mail-archives.apache.org/mod_mbox/maven-scm-commits http://www.mail-archive.com/scm-commits@maven.apache.org http://maven.scm.commits.markmail.org/ 2.0.6 maven-scm-api maven-scm-managers maven-scm-test maven-scm-providers maven-scm-client maven-scm-plugin scm:svn:http://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.3 scm:svn:https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.3 scm:svn:https://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.3 jira http://jira.codehaus.org/browse/SCM apache.website scp://people.apache.org/www/maven.apache.org/scm/ org.apache.maven.scm maven-scm-api 1.3 org.apache.maven.scm maven-scm-manager-plexus 1.3 org.apache.maven.scm maven-scm-provider-accurev 1.3 org.apache.maven.scm maven-scm-provider-bazaar 1.3 org.apache.maven.scm maven-scm-provider-clearcase 1.3 org.apache.maven.scm maven-scm-provider-cvs-commons 1.3 org.apache.maven.scm maven-scm-provider-cvsexe 1.3 org.apache.maven.scm maven-scm-provider-cvsjava 1.3 org.apache.maven.scm maven-scm-provider-git-commons 1.3 org.apache.maven.scm maven-scm-provider-gitexe 1.3 org.apache.maven.scm maven-scm-provider-hg 1.3 org.apache.maven.scm maven-scm-provider-local 1.3 org.apache.maven.scm maven-scm-provider-perforce 1.3 org.apache.maven.scm maven-scm-provider-starteam 1.3 org.apache.maven.scm maven-scm-provider-svn-commons 1.3 org.apache.maven.scm maven-scm-provider-svnexe 1.3 org.apache.maven.scm maven-scm-provider-synergy 1.3 org.apache.maven.scm maven-scm-provider-vss 1.3 org.apache.maven.scm maven-scm-provider-tfs 1.3 org.codehaus.plexus plexus-container-default 1.0-alpha-9 org.codehaus.plexus plexus-utils 1.5.6 junit junit 3.8.2 org.apache.maven.scm maven-scm-provider-svntest 1.3 org.apache.maven.scm maven-scm-test 1.3 org.apache.maven.scm maven-scm-provider-cvstest 1.3 org.apache.maven.scm maven-scm-provider-gittest 1.3 org.codehaus.plexus plexus-utils org.apache.maven.plugins maven-release-plugin https://svn.apache.org/repos/asf/maven/scm/tags org.codehaus.modello modello-maven-plugin 1.1 org.apache.maven.plugins maven-javadoc-plugin 2.5 reporting-aggregate org.apache.maven.plugins maven-jxr-plugin 2.1 true org.apache.maven.plugins maven-javadoc-plugin 2.5 http://java.sun.com/j2se/1.4.2/docs/api http://java.sun.com/j2ee/1.4/docs/api http://java.sun.com/j2se/1.5.0/docs/api http://commons.apache.org/collections/apidocs-COLLECTIONS_3_0/ http://commons.apache.org/dbcp/apidocs/ http://commons.apache.org/fileupload/apidocs/ http://commons.apache.org/httpclient/apidocs/ http://commons.apache.org/logging/apidocs/ http://commons.apache.org/pool/apidocs/ http://junit.sourceforge.net/javadoc/ http://logging.apache.org/log4j/1.2/apidocs/ http://jakarta.apache.org/regexp/apidocs/ http://velocity.apache.org/engine/releases/velocity-1.5/apidocs/ true