idea maven 依赖文件索引报错 update error

o.j.i.maven - Sent token to maven server

2022-05-14 16:35:30,780 [2332878]   INFO - #c.i.c.ComponentStoreImpl - Saving appDebuggerSettings took 14 ms

2022-05-14 16:43:11,004 [2793102]   WARN - #o.j.i.maven - Failed to update Maven indices for: [huaweicloud] https://repo.huaweicloud.com/repository/maven

org.jetbrains.idea.maven.server.MavenServerIndexerException: Cannot invoke "String.length()" because "s" is null

at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:173)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)

at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)

at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)

at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)

at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

at java.base/java.lang.Thread.run(Thread.java:833)

at java.rmi/sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:303)

at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:279)

at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)

at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:217)

at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:162)

at com.sun.proxy.$Proxy219.updateIndex(Unknown Source)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:150)

at com.intellij.execution.rmi.RemoteUtil.access$400(RemoteUtil.java:21)

at com.intellij.execution.rmi.RemoteUtil$1.lambda$invoke$0(RemoteUtil.java:134)

at com.intellij.openapi.util.ClassLoaderUtil.computeWithClassLoader(ClassLoaderUtil.java:31)

at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:202)

at com.intellij.execution.rmi.RemoteUtil$1.invoke(RemoteUtil.java:134)

at com.sun.proxy.$Proxy219.updateIndex(Unknown Source)

at org.jetbrains.idea.maven.server.MavenIndexerWrapper.lambda$updateIndex$1(MavenIndexerWrapper.java:66)

at org.jetbrains.idea.maven.server.RemoteObjectWrapper.performCancelable(RemoteObjectWrapper.java:90)

at org.jetbrains.idea.maven.server.MavenIndexerWrapper.updateIndex(MavenIndexerWrapper.java:63)

at org.jetbrains.idea.maven.indices.MavenIndex.updateNexusContext(MavenIndex.java:299)

at org.jetbrains.idea.maven.indices.MavenIndex.updateOrRepair(MavenIndex.java:242)

at org.jetbrains.idea.maven.indices.MavenIndices.updateOrRepair(MavenIndices.java:194)

at org.jetbrains.idea.maven.indices.MavenIndexUpdateManager.doUpdateIndicesContent(MavenIndexUpdateManager.java:134)

at org.jetbrains.idea.maven.indices.MavenIndexUpdateManager$1.run(MavenIndexUpdateManager.java:94)

at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)

at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)

at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)

at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)

at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)

at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)

at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)

at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)

at java.base/java.security.AccessController.doPrivileged(Native Method)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)

at java.base/java.lang.Thread.run(Thread.java:829)

Caused by: java.lang.NullPointerException

at org.apache.lucene.store.IndexOutput.writeString(IndexOutput.java:102)

at org.apache.lucene.index.SegmentInfo.write(SegmentInfo.java:504)

at org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:307)

at org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:761)

at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4636)

at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3369)

at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1654)

at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1602)

at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1578)

at org.sonatype.nexus.index.context.NexusIndexWriter.close(NexusIndexWriter.java:44)

at org.sonatype.nexus.index.context.IndexUtils.close(IndexUtils.java:370)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater.unpackIndexData(DefaultIndexUpdater.java:561)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:243)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:65)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:806)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:986)

at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:150)

at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl$2.run(Maven3ServerIndexerImpl.java:152)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedder$2.run(Maven3ServerEmbedder.java:372)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedder.executeWithSessionScope(Maven3ServerEmbedder.java:447)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedder.executeWithMavenSession(Maven3ServerEmbedder.java:380)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedder.executeWithMavenSession(Maven3ServerEmbedder.java:369)

at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:142)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)

at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)

at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)

at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)

at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)

at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)

at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

at java.base/java.lang.Thread.run(Thread.java:833)

.j.i.maven - Failed to update Maven indices for: [huaweicloud] https://repo.huaweicloud.com/repository/maven

org.jetbrains.idea.maven.server.CannotStartServerException: Cannot connect to the Maven process. Try again later. If the problem persists, check the Maven Importing JDK settings and restart IntelliJ IDEA

at org.jetbrains.idea.maven.server.RemoteObjectWrapper.performCancelable(RemoteObjectWrapper.java:99)

at org.jetbrains.idea.maven.server.MavenIndexerWrapper.updateIndex(MavenIndexerWrapper.java:63)

at org.jetbrains.idea.maven.indices.MavenIndex.updateNexusContext(MavenIndex.java:299)

at org.jetbrains.idea.maven.indices.MavenIndex.updateOrRepair(MavenIndex.java:242)

at org.jetbrains.idea.maven.indices.MavenIndices.updateOrRepair(MavenIndices.java:194)

at org.jetbrains.idea.maven.indices.MavenIndexUpdateManager.doUpdateIndicesContent(MavenIndexUpdateManager.java:134)

at org.jetbrains.idea.maven.indices.MavenIndexUpdateManager$1.run(MavenIndexUpdateManager.java:94)

at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)

at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)

at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)

at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)

at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)

at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)

at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)

at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)

at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)

at java.base/java.security.AccessController.doPrivileged(Native Method)

at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)

at java.base/java.lang.Thread.run(Thread.java:829)

Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: 

java.net.SocketException: Connection reset

at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:254)

at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)

at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:217)

at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:162)

at com.sun.proxy.$Proxy219.updateIndex(Unknown Source)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:150)

at com.intellij.execution.rmi.RemoteUtil.access$400(RemoteUtil.java:21)

at com.intellij.execution.rmi.RemoteUtil$1.lambda$invoke$0(RemoteUtil.java:134)

at com.intellij.openapi.util.ClassLoaderUtil.computeWithClassLoader(ClassLoaderUtil.java:31)

at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:202)

at com.intellij.execution.rmi.RemoteUtil$1.invoke(RemoteUtil.java:134)

at com.sun.proxy.$Proxy219.updateIndex(Unknown Source)

at org.jetbrains.idea.maven.server.MavenIndexerWrapper.lambda$updateIndex$1(MavenIndexerWrapper.java:66)

at org.jetbrains.idea.maven.server.RemoteObjectWrapper.performCancelable(RemoteObjectWrapper.java:90)

... 26 more

Caused by: java.net.SocketException: Connection reset

at java.base/java.net.SocketInputStream.read(SocketInputStream.java:186)

at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)

at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)

at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)

at java.base/java.io.DataInputStream.readByte(DataInputStream.java:270)

at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:240)

... 43 more

idea日志一堆报错

搞了3天,终于今天解决了

原因:刚开始不知道maven 仓库和镜像什么作用,不知道的去搜索看,它们之间的关系把。

然后用idea 打开settings.xml 文件

因为idea 能检车setting.xml 文件是否格式错误,可以避免因为文件问题各种bug 无解。

好了,如果以上问题都没有,注意看一下你的磁盘空间是否满? 因为满了的话。索引文件是不会成功的啊

如果以上问题没有

因为官方maven 中央仓库在国外,国内网速垃圾。各种限制,阿里云maven 又不支持索引文件下载。mamamiya

我目前只知道华为的maven 镜像 可以支持索引。于是我们在setting.xml 文件设置镜像。

以下是我的setting.xml 整个文件的信息,已经有华为maven镜像了的

<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT 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 is the configuration file for Maven. It can be specified at two levels:
 |
 |  1. User Level. This settings.xml file provides configuration for a single user,
 |                 and is normally provided in ${user.home}/.m2/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -s /path/to/user/settings.xml
 |
 |  2. Global Level. This settings.xml file provides configuration for all Maven
 |                 users on a machine (assuming they're all using the same Maven
 |                 installation). It's normally provided in
 |                 ${maven.home}/conf/settings.xml.
 |
 |                 NOTE: This location can be overridden with the CLI option:
 |
 |                 -gs /path/to/global/settings.xml
 |
 | The sections in this sample file are intended to give you a running start at
 | getting the most out of your Maven installation. Where appropriate, the default
 | values (values used when the setting is not specified) are provided.
 |
 |-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ~/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->

  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->

  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
  </pluginGroups>

  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
  </proxies>

  <!-- servers
   | This is a list of authentication profiles, keyed by the server-id used within the system.
   | Authentication profiles can be used whenever maven must make a connection to a remote server.
   |-->
  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

  <!-- mirrors
   | This is a list of mirrors to be used in downloading artifacts from remote repositories.
   |
   | It works like this: a POM may declare a repository to use in resolving certain artifacts.
   | However, this repository may have problems with heavy traffic at times, so people have mirrored
   | it to several places.
   |
   | That repository definition will have a unique id, so we can create a mirror reference for that
   | repository, to be used as an alternate download site. The mirror site will be the preferred
   | server for that repository.
   |-->
  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
   <mirror>
    <id>huaweicloud</id>
    <name>hwcloud</name>
    <mirrorOf>*</mirrorOf>
    <url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>

     
  </mirrors>

  <!-- profiles
   | This is a list of profiles which can be activated in a variety of ways, and which can modify
   | the build process. Profiles provided in the settings.xml are intended to provide local machine-
   | specific paths and repository locations which allow the build to work in the local environment.
   |
   | For example, if you have an integration testing plugin - like cactus - that needs to know where
   | your Tomcat instance is installed, you can provide a variable here such that the variable is
   | dereferenced during the build process to configure the cactus plugin.
   |
   | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
   | section of this document (settings.xml) - will be discussed later. Another way essentially
   | relies on the detection of a system property, either matching a particular value for the property,
   | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
   | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
   | Finally, the list of active profiles can be specified directly from the command line.
   |
   | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
   |       repositories, plugin repositories, and free-form properties to be used as configuration
   |       variables for plugins in the POM.
   |
   |-->
  <profiles>
    <!-- profile
     | Specifies a set of introductions to the build process, to be activated using one or more of the
     | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
     | or the command line, profiles have to have an ID that is unique.
     |
     | An encouraged best practice for profile identification is to use a consistent naming convention
     | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
     | This will make it more intuitive to understand what the set of introduced profiles is attempting
     | to accomplish, particularly when you only have a list of profile id's for debug.
     |
     | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
      <id>jdk-1.4</id>

      <activation>
        <jdk>1.4</jdk>
      </activation>

      <repositories>
        <repository>
          <id>jdk14</id>
          <name>Repository for JDK 1.4 builds</name>
          <url>http://www.myhost.com/maven/jdk14</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
    -->

    <!--
     | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
     | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
     | might hypothetically look like:
     |
     | ...
     | <plugin>
     |   <groupId>org.myco.myplugins</groupId>
     |   <artifactId>myplugin</artifactId>
     |
     |   <configuration>
     |     <tomcatLocation>${tomcatPath}</tomcatLocation>
     |   </configuration>
     | </plugin>
     | ...
     |
     | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
     |       anything, you could just leave off the <value/> inside the activation-property.
     |
    <profile>
      <id>env-dev</id>

      <activation>
        <property>
          <name>target-env</name>
          <value>dev</value>
        </property>
      </activation>

      <properties>
        <tomcatPath>/path/to/tomcat/instance</tomcatPath>
      </properties>
    </profile>
    -->
  </profiles>

  <!-- activeProfiles
   | List of profiles that are active for all builds.
   |
  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
  -->
</settings>


maven 可以显示的啊

关键问题不在这里,我知道你们进来应该是关于 远程仓库 update 时候 

要么error 要么,索引文件下载好了 结果一点反应都没有,继续update 反复下载。

如果你不是,这边帖子也帮不了你

经过我发现,这里update 时候需要下载两个文件 

nexus-maven-repository-index.gz
nexus-maven-repository-index.properties

就是这两个文件,但是华为的镜像没有第二个文件,就离谱

所以解决方案:如果是error 那么应该是 setting.xml 文件设置有错误,idea 打开它,看看有没有红色,把红色解决掉的好了

如果是 update 后 下载所以文件了没反应 没有效果。

需要下载这个文件https://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties

 

然后把这个文件 复制到 idea 下载的索引文件的位置上去 

我不知道你电脑的索引文件在哪?

 

然后我们再去 maven 重新update  一下

我想如果还不行,清理垃圾 ,请重启电脑,重新进idea  去update  一下。

我想应该就好了

我就是这样的,虽然不知道为什么,我只知道我搞了3 天终于可以了

如果你还不行,我也没用办法,我也不知道

为什么我之前 一直update 后 索引文件有 却没用反应。现在我可能知道原因了

因为maven 需要两个文件

而华为maven 只下载了一个文件

另外一个文件我们需要自己去下载

还有,我电脑c盘空间不足。导致解压maven 索引文件,失败。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
添加maven依赖报错可能有多种原因,以下是一些常见的解决方案: 1. 检查maven仓库配置是否正确。确保maven的配置路径和本地仓库的配置正确,包括settings.xml和仓库地址等配置项。\[1\] 2. 清理maven缓存。使用clean命令清理maven缓存,并在刷新后重新执行操作。同时,清理IDEA的缓存并重启项目也可能有帮助。\[2\] 3. 解决jar包冲突问题。可以使用插件来查看是否存在重复的依赖,并根据需要下载正确的依赖。如果下载的依赖有问题,可以尝试删除本地仓库的缓存文件并重新下载。\[2\] 4. 检查依赖的版本兼容性。有时候,依赖的版本可能与使用的JDK版本或项目的maven版本不兼容。尝试切换依赖的版本或确保maven版本与项目版本相同。\[2\] 如果以上方法都没有解决问题,可以尝试以下操作: 1. 检查pom文件中的报错。如果pom文件中有报错,可以尝试执行第3步操作。\[3\] 2. 检查idea右侧的MavenProject插件报错。如果插件报错,同样可以尝试执行第3步操作。\[3\] 3. 找到对应的pom文件,将其剪切并重新导入maven,然后再将剪切的内容粘贴回原位置。这样可以重新导入依赖并解决问题。\[3\] 希望以上解决方案能够帮助您解决添加maven依赖报错的问题。 #### 引用[.reference_title] - *1* *3* [IDEA-maven报错问题的解决方案(四步解决-详细版本)](https://blog.csdn.net/weixin_45536587/article/details/103968145)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [IDEAmaven依赖报错解决方案](https://blog.csdn.net/qq_42074921/article/details/85322513)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值