You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matthew McCullough (JIRA)" <ji...@codehaus.org> on 2010/03/02 17:18:56 UTC

[jira] Created: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

"String index out of range" during eclipse:eclipse for a project that works with 2.7
------------------------------------------------------------------------------------

                 Key: MECLIPSE-642
                 URL: http://jira.codehaus.org/browse/MECLIPSE-642
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : Workspace settings
    Affects Versions: 2.8
         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
            Reporter: Matthew McCullough
         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt

We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.

When running eclipse:eclipse on our projects, we get an occasional
"String index out of range: -6"

The stack trace indicates this is on line 111 of:
http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup

I see that those lines are:

109    {
110          Resource resource = (Resource) it.next();
111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
113    }


I've attached a snippet of the -X output (about the last 50 lines)...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Work started: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on MECLIPSE-642 started by Barrie Treloar.

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281261#comment-281261 ] 

Barrie Treloar edited comment on MECLIPSE-642 at 10/13/11 11:40 PM:
--------------------------------------------------------------------

Can I get an example project that exhibits the problem.

My quick integration test project does not throw this exception.
(I still need to work on the expected file details in order to pass the tests)

{noformat}
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>../shared-resources</directory>
      </resource>
    </resources>
{noformat}

sample log output:

{noformat}
[DEBUG] Processing classpath for: source src/main/java: output=null, include=[**/*.java], exclude=[], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource src/main/resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource D:/ide/maven/maven-eclipse-plugin/target/test-classes/projects/project-65-MECLIPSE-642/shared-resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
{noformat}

      was (Author: baerrach):
    Can I get an example project that exhibits the problem.

My quick integration test project does not through this exception.
(I still need to work on the expected file details in order to pass the tests)

{noformat}
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>../shared-resources</directory>
      </resource>
    </resources>
{noformat}

sample log output:

{noformat}
[DEBUG] Processing classpath for: source src/main/java: output=null, include=[**/*.java], exclude=[], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource src/main/resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource D:/ide/maven/maven-eclipse-plugin/target/test-classes/projects/project-65-MECLIPSE-642/shared-resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
{noformat}
  
> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Yi Xiao (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281409#comment-281409 ] 

Yi Xiao commented on MECLIPSE-642:
----------------------------------

Thanks Barrie for your quick answer!
Of course, the project's url is: http://svn.apache.org/repos/asf/geronimo/devtools/eclipse-plugin/branches/2.1/plugins/org.apache.geronimo.jee.v21.jaxbmodel/
You can try it.
The example you show above, I think the '../shared-resources' is longer than '../projectName', so it does not throw the exception, if you just use '..', the exception will reproduce.
 

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281414#comment-281414 ] 

Barrie Treloar commented on MECLIPSE-642:
-----------------------------------------

Added integration test project-65-MECLIPSE-642
Replaced all uses of .replace( '\\', '/' ) with IdeUtils.fixSeparator()
Replaced all uses of someString.substring( baseDir.length() ) with IdeUtils.toRelativeAndFixSeparator()

Can someone please pull down and build this snapshot and confirm that it works with your projects?

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barrie Treloar updated MECLIPSE-642:
------------------------------------

    Fix Version/s: 2.9

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>             Fix For: 2.9
>
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Holger Hoffstätte (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253848#action_253848 ] 

Holger Hoffstätte commented on MECLIPSE-642:
--------------------------------------------

Apache Avro is getting bitten by this too. As much as I agree with the notion of standalone modules, this is simply not how many projects work for very good reasons. In Avro's case the Java build is merely one of many (C, PHP etc.) and all projects share generic resources from the toplevel parent - exactly like Robin's case.
It seems not completely unreasonable for these cases to include the referenced directory via a relative path outside of $basedir. Can anyone point out any severe downsides if this were the case?


> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281261#comment-281261 ] 

Barrie Treloar commented on MECLIPSE-642:
-----------------------------------------

Can I get an example project that exhibits the problem.

My quick integration test project does not through this exception.
(I still need to work on the expected file details in order to pass the tests)

{noformat}
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>../shared-resources</directory>
      </resource>
    </resources>
{noformat}

sample log output:

{noformat}
[DEBUG] Processing classpath for: source src/main/java: output=null, include=[**/*.java], exclude=[], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource src/main/resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: resource D:/ide/maven/maven-eclipse-plugin/target/test-classes/projects/project-65-MECLIPSE-642/shared-resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false; default output=target/classes
{noformat}

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barrie Treloar closed MECLIPSE-642.
-----------------------------------

    Resolution: Fixed

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>            Assignee: Barrie Treloar
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Wendy Smoak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241965#action_241965 ] 

Wendy Smoak commented on MECLIPSE-642:
--------------------------------------

The plugin should handle this better, but generally maven modules are intended to be standalone.  If you want to share files, do it through the repository, (package them in a jar from one module, pull them back out in the other,) not with relative paths outside the module.

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-642) "String index out of range" during eclipse:eclipse for a project that works with 2.7

Posted by "Robin Cohen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=241962#action_241962 ] 

Robin Cohen commented on MECLIPSE-642:
--------------------------------------

I'm getting this exception also.  I tracked the issue down in the debugger to a resource in my pom that is not in a subdirectory of the current project.  

In my case the resource that fails has the directory "../../globalResources/resources" since I want to copy/filter some shared resource files into my ear archive.  Clearly the code "resource.getDirectory().substring( basedir.length()" will not work if basedir is not the prefix of resource.getDirectory().

I can't think of a work around for this short of reverting to an earlier version of the plugin.  Please let me know if there is another way to do what I am trying to do.

> "String index out of range" during eclipse:eclipse for a project that works with 2.7
> ------------------------------------------------------------------------------------
>
>                 Key: MECLIPSE-642
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-642
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : Workspace settings
>    Affects Versions: 2.8
>         Environment: Windows XP, Maven 2.2.1, Maven 2.x Eclipse Plugin v2.8
>            Reporter: Matthew McCullough
>         Attachments: Eclipse Plugin 2.8 Out Of Bounds Error.txt
>
>
> We tried to upgrade to using v2.8 of the plugin, but a regression stops us dead in our tracks.  Reverting to 2.7 allows us to continue for now.
> When running eclipse:eclipse on our projects, we get an occasional
> "String index out of range: -6"
> The stack trace indicates this is on line 111 of:
> http://svn.apache.org/viewvc/maven/plugins/tags/maven-eclipse-plugin-2.8/src/main/java/org/apache/maven/plugin/eclipse/writers/EclipseSettingsWriter.java?view=markup
> I see that those lines are:
> 109    {
> 110          Resource resource = (Resource) it.next();
> 111          String relativePath = resource.getDirectory().substring( basedir.length() ).replace( '\\', '/' );
> 112          coreSettings.put( PROP_JDT_CORE_COMPILER_ENCODING + relativePath, encoding );
> 113    }
> I've attached a snippet of the -X output (about the last 50 lines)...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira