1. 程式人生 > >maven+ssm啟動Tomcat報錯 Could not publish to the server. java.lang.IndexOutOfBoundsException 解決辦法

maven+ssm啟動Tomcat報錯 Could not publish to the server. java.lang.IndexOutOfBoundsException 解決辦法

1找到你maven安裝目錄D:\studys\apache-maven-3.5.3-bin\apache-maven-3.5.3\conf找到settings.xml開啟


2,新增這段程式碼

<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
    <id>jcenter</id>
    <mirrorOf>central</mirrorOf>
    <name>jcenter.bintray.com</name>
    <url>http://jcenter.bintray.com/</url>
</mirror>


<mirror>
    <id>repo1</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
    <id>repo2</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://repo2.maven.org/maven2/</url>

</mirror>

3,在專案中pom.xml中新增


<repositories>
    <repository>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </repository>
    <repository>
        <id>jcenter</id>
        <name>jcenter Repository</name>
        <url>http://jcenter.bintray.com/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>

</repositories>

4,ctrl+s儲存  問題解決