[ 
https://issues.apache.org/jira/browse/SCM-466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17961653#comment-17961653
 ] 

ASF GitHub Bot commented on SCM-466:
------------------------------------

jira-importer opened a new issue, #680:
URL: https://github.com/apache/maven-scm/issues/680

   
**[Adrien](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=adrien1977)**
 opened 
**[SCM-466](https://issues.apache.org/jira/browse/SCM-466?redirect=false)** and 
commented
   
   Hi
   We've been struggling for a while with the release prepare in the linux env.
   For some kind of reason, it was not executing the release prepare properly.
   The error that we were getting was
   [INFO] Checking out file: 
/view/agracia_ETS_FEST_COMMON1.0_int/cc/ETS_FEST/FEST_COMMON/pom.xml
   [INFO] 
------------------------------------------------------------------------
   [ERROR] BUILD FAILURE
   [INFO] 
------------------------------------------------------------------------
   [INFO] Unable to enable editing on the POM
   Provider message:
   The cleartool command failed.
   Command output:
   
   Surprisingly, all this was working in windows. Even though we use linux for 
our build we had to use windows for the release prepare plugin.
   
   We investigated for a while but gave up.
   We decided to give it another chance and we finally found the issue.
   during the edit process., the ClearCaseEditConsumer class was throwing a 
IndexOutOfBound exception which was the source of the problem
   We are still wondering why this was working in windows and not linux. The 
only guess is the state of either the thread or the output stream is being 
handled differently in both env.
   
   Now the bug:
   in the consumeLine method you do
   int beginIndex = line.indexOf( '"' );
   then you try to extract the file name
   
   But sometimes there is no filename
   String fileName = line.substring( beginIndex + 1, line.indexOf( '"', 
beginIndex + 1 ) );
   
   This cause the IOOE
   The line that was causing the issue for us was
   
   Attached activity:
   java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1938)
   at 
org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditConsumer.consumeLine(ClearCaseEditConsumer.java:64)
   at 
org.codehaus.plexus.util.cli.StreamPumper.consumeLine(StreamPumper.java:195)
   at org.codehaus.plexus.util.cli.StreamPumper.run(StreamPumper.java:144)
   activity:release_prepare.3648@\ETS_CCM_PROJECT  "release prepare"
   
   We fixed it by adding
   
   if(beginIndex != -1){
   String fileName = line.substring( beginIndex + 1, line.indexOf( '"', 
beginIndex + 1 ) );
   editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) );
   }
   instead of
   String fileName = line.substring( beginIndex + 1, line.indexOf( '"', 
beginIndex + 1 ) );
   editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) );
   
   The other consumers have potentially the same issue so we fixed those as well
   
   I hope that you will be able to fix this in the next release.
   
   In the meantime we are using our own version of the module.
   
   thanks
   
   Adrien
   
   
   ---
   
   **Affects:** 1.2
   
   **Attachments:**
   - 
[scm_patch.txt](https://issues.apache.org/jira/secure/attachment/12718892/scm_patch.txt)
 (_7.20 kB_)
   




> Release prepare causing exit Code 141 in linux with clearcase
> -------------------------------------------------------------
>
>                 Key: SCM-466
>                 URL: https://issues.apache.org/jira/browse/SCM-466
>             Project: Maven SCM (Moved to GitHub Issues)
>          Issue Type: Bug
>          Components: maven-scm-provider-clearcase
>    Affects Versions: 1.2
>         Environment: Linux
>            Reporter: Adrien
>            Assignee: Olivier Lamy
>            Priority: Major
>             Fix For: 1.3
>
>         Attachments: scm_patch.txt
>
>
> Hi
> We've been struggling for a while with the release prepare in the linux env.
> For some kind of reason, it was not executing the release prepare properly.
> The error that we were getting was
> [INFO] Checking out file: 
> /view/agracia_ETS_FEST_COMMON1.0_int/cc/ETS_FEST/FEST_COMMON/pom.xml
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Unable to enable editing on the POM
> Provider message:
> The cleartool command failed.
> Command output:
> Surprisingly, all this was working in windows. Even though we use linux for 
> our build we had to use windows for the release prepare plugin.
> We investigated for a while but gave up.
> We decided to give it another chance and we finally found the issue.
> during the edit process., the ClearCaseEditConsumer class was throwing a 
> IndexOutOfBound exception which was the source of the problem
> We are still wondering why this was working in windows and not linux. The 
> only guess is the state of either the thread or the output stream is being 
> handled differently in both env.
> Now the bug:
> in the consumeLine method you do
>  int beginIndex = line.indexOf( '"' );
> then you try to extract the file name
> But sometimes there is no filename 
> String fileName = line.substring( beginIndex + 1, line.indexOf( '"', 
> beginIndex + 1 ) );
> This cause the IOOE
> The line that was causing the issue for us was
> Attached activity:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>         at java.lang.String.substring(String.java:1938)
>         at 
> org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditConsumer.consumeLine(ClearCaseEditConsumer.java:64)
>         at 
> org.codehaus.plexus.util.cli.StreamPumper.consumeLine(StreamPumper.java:195)
>         at 
> org.codehaus.plexus.util.cli.StreamPumper.run(StreamPumper.java:144)
>   activity:release_prepare.3648@\ETS_CCM_PROJECT  "release prepare"
> We fixed it by adding
> if(beginIndex != -1){
>               String fileName = line.substring( beginIndex + 1, line.indexOf( 
> '"', beginIndex + 1 ) );
>               editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) );
> }
> instead of 
>               String fileName = line.substring( beginIndex + 1, line.indexOf( 
> '"', beginIndex + 1 ) );
>               editFiles.add( new ScmFile( fileName, ScmFileStatus.UNKNOWN ) );
> The other consumers have potentially the same issue so we fixed those as well
> I hope that you will be able to fix this in the next release.
> In the meantime we are using our own version of the module.
> thanks 
> Adrien



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to