Intellij idea indexed maven repositories error

If you encounter problems working with your Maven project you can check to see if the following solutions and workarounds can help you solve your issues.

If you encounter problems working with your Maven project you can check to see if the following solutions and workarounds can help you solve your issues.

How to fix compiler version problems in Maven projects

In some cases when you import a Maven project, it might have compiler settings that will not match the expected settings in IntelliJ IDEA and when you compile your code, you might encounter a problem.

For example, you can get the following error:

the compiler error

This error usually indicates a problem with the compiler version compatibility, and you can check few places to fix it.

For example, you can edit your POM and configure Maven compiler plugin to compile your Java code. You should set the compiler level explicitly, so it won’t revert to the default settings when you re-import your project.

Set the compiler level in POM

  1. Open your POM in the editor.

  2. Change the configuration for the Maven compiler plugin.

    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
    <source>1.8</source>
    <target>1.8</target>
    <encoding>UTF-8</encoding>
    </configuration>
    </plugin>
    </plugins>
    </build>

  3. Click the Refresh button to import your changes. Note that the configurations specified in your POM overrides any configurations specified in your project structure. So, now after this project is imported the language level should be picked up.

Check the Java compiler settings to see if the bytecode versions match.

Check the compiler settings

  1. In the Settings dialog (Ctrl+Alt+S), go to .

  2. On the page that opens, check if Project bytecode version and Target bytecode version match, or leave the Target bytecode version option blank so it can be determined from JDK.

    the Java compiler settings

If you have imported a multi-level project, you can check project structure settings for source language level configuration.

Check the language level in the project structure

  1. Open Project Structure dialog and select Project from the options on the left.

  2. Check the source language level for your project.

    the project structure: Project

  3. Check the source language level for each module (click the Sources tab).

    Project Structure dialog / Module page

How to fix problems with Maven projects that won’t start

To fix issues that are related to the Maven projects that won’t start or import, you can perform one of the following actions.

If you received the OutOfMemory error, try to increase the heap size for the Maven importer.

  1. In the Settings dialog (Ctrl+Alt+S), go to .

  2. On the Importing page, in the VM options for importer field, increase heap size for the Maven importer.

  3. Also, in the JDK for importer field, increase IDE heap size.

    the Maven settings: VM options and JDK for importer

    If you need to use more heap, switch to 64-bit Java and specify the same 64-bit JVM for Maven JDK for importer.

If you received the Operation timed out error or IDE connection failure to the Maven process, try to edit the hosts file.

Edit the hosts file

  • On some systems you need to edit the hosts file so that localhost resolves correctly. Try to have 127.0.0.1 localhost in the etc/hosts file. Also, make sure there are no other IP addresses mapped to localhost.

If the error indicates the Maven repository issue, such as the Failed to update Maven indices error, try to check if Maven repositories were indexed correctly.

IntelliJ IDEA works with repository indexes. The indexes are fetched remotely from remote repositories. Some repositories do not provide indexes, or do not keep an updated index, for example, repositories from Bintray, in this case you can ignore the error.

If you have an indexed repository, but still get a Maven repository error, check the following options:

Check the user settings file

  1. In the Settings dialog (Ctrl+Alt+S), go to .

  2. On the Maven page, in the User settings file field, check if you defined proper credentials for the server in settings.xml.

    the Maven settings: User setting file

You can try to restart IntelliJ IDEA and update Maven repositories.

Update Maven repositories

  1. In the Settings dialog (Ctrl+Alt+S), go to .

  2. Select Repositories from options on the left.

  3. On the Repositories page, click Update to update Maven repositories.

    Maven settings: Repositories

  4. After the update is finished, click OK.

Maven dependencies imported incorrectly

If the dependencies weren’t imported correctly (IntelliJ IDEA highlights them), try to perform the following actions:

  • You can check your local maven repository in the Maven | Repositories settings and try to update it.

  • You can check the jar file of the local .m2 repository to see if it was downloaded correctly.

  • You can check the effective POM to determine which Maven repository was used as an origin of the dependency.

  • You can select the Always update snapshots option in Maven settings. In this case, IntelliJ IDEA checks the latest version of the downloaded dependency and updates it accordingly.

    the Maven settings

Last modified: 17 March 2022

I’m having trouble understanding how to get repositories in the «Indexed Maven Repositories» list of the IntelliJ IDEA.

In one my project I have two repos in this list: one local and one (main) remote (see attached screenshot below). And in other project (created using AppFuse template) I have only one (local) repo in list.

I’m tried to add the repos in pom.xml file and in settings.xml file, but the repos did not appear in this «magic» list.

And this means:

  1. I can’t see artifactId and versions of artifacts in dropdownlist (Ctrl+SPACE)
  2. IDEA can’t find the necessary artifacts (or his versions). It is looking only in my local repo

Version of IntelliJ IDEA: 11.0

Version of Maven: 2.2.1

snapshot of settings

Shawn Chin's user avatar

Shawn Chin

82.3k18 gold badges160 silver badges191 bronze badges

asked Nov 16, 2011 at 10:56

dnim's user avatar

1

This list is updated automatically from the repositories specified in your pom files (or inherited from parent project’s pom and settings.xml).

If you open a project that has some additional repositories specified, you’ll see them in this list and will be able to update the indices.

om-nom-nom's user avatar

om-nom-nom

62.1k13 gold badges181 silver badges226 bronze badges

answered Nov 16, 2011 at 13:16

Anton Makeev's user avatar

2

You can manage these settings by editing your settings.xml file of the project

  1. Open the Project file list (Ctrl-1)
  2. Find your main parent pom.xml file
  3. Right click on it Choose Maven -> Open ‘settings.xml’

As you can see it is a local copy of settings.xml file for your project.
There is you can add/remove active repositories of the project.
Look at the settings->repositories manual for details.

answered Apr 22, 2013 at 22:34

VIktor's user avatar

VIktorVIktor

2112 silver badges2 bronze badges

I had a related issue where I changed the repository in my settings.xml but the Indexed Maven Repositories list was still pointing to the old one. In order to get the maven build to look at the new one I had to run mvn idea:idea on the project

answered Oct 25, 2019 at 10:22

Martin Bamford's user avatar

1

Склад Maven’s, индекс

Центральный склад:В данный момент,http://repo1.maven.org/maven2/ это реальноMavenАдрес центрального склада, адрес построен -вMavenВ исходном коде другие адреса включают знаменитыеibiblio.org, Зеркало.

индекс: Центральный склад имеет файлы индексации, чтобы облегчить пользователям поиск. Полные индексные файлы будут около 1.11G 8 декабря 2015 года, а индекс обновляется раз в неделю.

Местный склад: На основании местных машинMavenСклад, местный склад — это буфер и подмножество центрального склада (или удаленного склада). Когда вы строитеMavenВ проекте сначала ищите ресурсы с местного склада. Если нет, тоMavenОн будет загружен с удаленного склада на ваш местный склад. Таким образом, вам не нужно загружать из удаленного управления, когда вы используете его в следующий раз. Если тебе надоJarВерсия сумки не находится на местном складе, и ее не существует на отдаленном складе.MavenОшибка будет сообщена во время строительства. Это может произойти с некоторымиJarНовая версия сумки не вMavenОбновление на складе вовремя. Местный склад по умолчанию Maven по умолчанию${user.home}/.m2/repositoryСущность Другими словами, пользователь будет соответствовать локальному складу. Конечно, вы можете изменить${user.home}/.m2/settings.xmlНастройте этот адрес:

<settings>
  ···
  <localRepository> D:/java/repository</localRepository>
  ...
</settings>

Отправленный контент: До тех пор, пока ваш проект является открытым исходным кодом, и вы можете предоставить полноеPOMВы можете отправить проектные документы на центральный склад, который может пройтиSonatypeкоторый предоставилСлужба хостинга склада с открытым исходным кодомвыполнить.

Intellij Idea использует индексы для достижения автоматического завершения

Как мы все знаем, из -за великой китайской пожарной стены при использовании идеи для загрузки индекса склада Maven, она либо не может получить доступ, либо скорость очень медленная, что доставляет большие неудобства для разработчиков, поэтому общие компании используют Nexus для Создайте компанию с Nexus для создания внутреннего частного сервера компании. В то же время использование частного сервера более способствует управлению версией пакета JAR, основанной на внутренних разработчиках компании.

Может быть, вы спросите, у центрального склада есть индексы, зачем местные идеи также должны загружать индексы? Затем посмотрите на картинку ниже, и вы понимаете. Если нет индекса загрузки локально, вpom.xmlЗависимости, добавленные в файле, не могут получить какие -либо подсказки.

Maven Plug -In Configururation в IntelliJ ID

IntelliJ создал поддержку Maven Plug -In. Конечно, вы также можете настроить свой Maven, вам нужно только ввестиSettings->Maven->Maven home directory|User settings file|Local repositoryПросто настройте. Обратите внимание, что если вы используете свой собственный Maven, вы должны проверитьOverrideВ противном случае конфигурация не вступит в силу.

IntelliJ14.1 Причины неспособности индекса

При использовании версии IntelliJ 14.1.1.Indexed Maven Repositories — type remore — Error — Idea 14.1.5Согласно причине в ссылке, это ошибка в версии IntelliJ14.1.x, и она будет отремонтирована в следующей версии релиза. Рекомендуется обновить IntelliJ до версии 15.

Используйте зеркало домашнего склада Maven

Ввиду великого брандмауэра рекомендуется использовать внутренние зеркальные ресурсы в качестве центрального склада Maven. Рекомендуемое использованиеБИБЛИОТЕКА БИБЛИОТЕКА ИСПОЛЬЗОВАНИЯ БИБЛИОТЕКА ВАШИКонфигурация очень проста, поэтому я не описываю ее подробно. Есть два способа.settings.xmlФайл, присоединиться

<mirrors>
    <mirror>
        <id>nexus-osc</id>
                 <mirrorof>*</mirrorof> <!
        <name>Nexus osc</name>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
</mirrors>

Конечно, есть второй способ заблокировать указанный центральный склад, и вы также можете присоединитьсяOSChinaТретий партийный зеркальный склад или несколько складов, конфигурация заключается в следующем

<mirrors>
    <mirror>
        <id>nexus-osc</id>
                 <Mirrorof> Central </mirrorof> <!-Здесь указывается, что только центральный склад экранирован->
        <name>Nexus osc</name>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
    <mirror>
        <id>nexus-osc-thirdparty</id>
        <mirrorOf>thirdparty</mirrorOf>
        <name>Nexus osc thirdparty</name>
        <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    </mirror>
</mirrors>

Наконец, в исполненииMavenВо время команды,MavenВам также необходимо установить некоторые сумки с заглушкой, адрес загрузки этих сумков -в сумке также указывает на негоOSChinaизMavenадрес. Модификация показана ниже

<profile>
     <id>jdk-1.8</id>
     <activation>
         <jdk> 1.8 </jdk> <!-Укажите автоматическую активацию, когда версия JDK-1.8->
     </activation>
     <repositories>
         <repository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <releases>
              <enabled>true</enabled>
            </releases>
            <snapshots>
              <enabled>false</enabled>
            </snapshots>
         </repository>
     </repositories>
     <pluginRepositories>
         <pluginRepository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <releases>
              <enabled>true</enabled>
            </releases>
            <snapshots>
              <enabled>false</enabled>
            </snapshots>
         </pluginRepository>
     </pluginRepositories>
</profile>

Загрузите индекс склада Maven. Кроме того, вы также можете загрузить официальную чистую версию, предоставленную в Китае с открытым исходным кодомsettings.xmlдокумент.

После завершения конфигурации вы можете загрузить индекс склада. Обратите внимание, что это очень время, требующий времени. Рекомендуется использовать его ночью или выйти на обед. После процесса загрузки и загрузки статус показан на рисунке ниже. Общее время загрузки составляет около часа.

Кроме того, я думаю, что с тех пор, как загрузка так неприятна, что такое загруженный индекс? Могу ли я снова скопировать его на другие машины? Итак, после некоторого поиска я нашел положение хранения индекса и скопировал его в то же место других машин, но я не знал, не было ли оно тестировано. Я не знаю, можно ли его использовать. Если некоторые Пользователи пользователей протестировали это, вы можете сказать мне и спасибо.

Используйте локальный Tomcat в качестве сервера загрузки индекса

  • Сначала загрузите следующие два файла:
    http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
    http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
  • Запустите сервер Apache Tomcat и создайте его в корневом каталоге/maven2/.indexВиртуальный каталог (примечание. Если вы используете систему Windows, вы не сможете установить.indexПакет, вы должны использовать команду DOS:mkdir .index), Скопируйте два приведенных выше файла в виртуальную каталог
  • редактироватьC:/WINDOWS/system32/drivers/etc/hostsФайл, добавьте в файл:
    127.0.0.1 repo1.maven.org
    Уведомление:127.0.0.1Шаг 2Apache TomcatIP-адрес сервера.
  • Обновите индекс в плагине Idea Maven
  • Содержание, добавленное в файл хостов на шаге 3 удаления.

Примечание: Фактически, общая идея этого решения состоит в том, чтобы сначала загрузить файл индекса в целом, а затем использовать локальный Tomcat в качестве сервера, а затем обновить индекс от Tomcat.

Наконец, если вы хотите настроить частный сервер самостоятельно, вы можете обратиться к немуMaven Warehouse Management Nexus。

Проблема существования китайского зеркала с открытым исходным кодом

  • Китайское зеркало с открытым исходным кодом не очень стабильное, иногда загрузка завершается, а иногда и вResolving dependencies of ...Статус и невозможно загрузить
  • После настройки третьего партийного зеркального изображения в Китае с открытым исходным кодом, была обнаружена проблема, что содержание библиотеки не было обновлено во времени, а версия Bar Bag во многих третьих сторонних библиотеках было очень старым.
  • В Центральном складе с открытым исходным кодом Китая и в Библиотеке третьей стороны, то есть в Центральном складе, в центральном складе содержится контент в третьей стороне, и при загрузке файла JAR по умолчанию будет загружаться непосредственно с Центрального склада Центрального склада в Китае с открытым исходным кодом. Вместо того, чтобы загружать третье партийное изображение склада с открытым исходным кодом Китая.
  • Предложения, которые я даю, заключаются в том, что если это не нужно, удалите третий сторонний зеркальный адрес в Китае с открытым исходным кодом, содержание удаления следующим образом

<mirror>
      <id>nexus-osc-thirdparty</id>
      <mirrorOf>thirdparty</mirrorOf>
      <name>Nexus osc thirdparty</name>
      <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</mirror>
  • Для вышеуказанных проблем, иногда вам все еще нужно скачать со склада Maven of Maven, этот метод должен лишь изменитьsettings.xmlФайл является официальной версией по умолчанию. Maven по умолчаниюsettings.xmlПочта
<?xml version="1.0" encoding="UTF-8"?>
<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>D:/apache-maven-3.3.1/repository</localRepository>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
  </profiles>
</settings>

Was seeing errors when trying to update Maven repositories in IntelliJ 14 CE

Preferences / Build, Execution, Deployment > Build Tools > Maven > Repositories

All of the Remote Repositories where showing ‘Error’.

Hitting Update worked occasionally (like maybe 1/20 times)

Saw this in the Event Log

10:14:25 AM Unindexed remote maven repositories found. Disable…
            The following repositories used in your gradle projects were not indexed yet:
            http://download.java.net/maven/2
            http://maven.springframework.org/milestone
            http://maven.springframework.org/release
            If you want to use dependency completion for these repositories artifacts,
            Open Repositories List, select required repositories and press «Update» button (show balloon)

Also saw Exceptions in idea.log (Help / Show Log in Finder)

Tried alternative WI-FI and Ethernet connections, including the hotspot on my phone.  No change.

On ths advice of these Threads:
https://youtrack.jetbrains.com/issue/IDEA-102693
https://youtrack.jetbrains.com/issue/IDEA-138029

I removed the -Xmx512m Setting under Preferences / Build, Execution, Deployment > Build Tools > Maven > Importing > VM options for Importer

Intially, this seemed to work … but alas I think it was a coincidence.  It worked fine on the first attempt to update repo1.maven.org, but failed on the others…and ultimately failed when retrying repo1.maven.org.

Then Tried changing the Maven Importing JRE:

Build, Execution, Deployment > Build Tools > Maven > Importing > JDK for Importer

from the Default (Use Internal JRE (1.6) ) to the JDK 1.8 I had installed.

Again, this seemed to work initially….but failed on second attempt.

Then I tried killing the RemoteMavenServer (java process found using ps aux | grep maven).  This also made the first download attempt work, but subsequent downloads failed.  I suspect changing the -Xmx and JRE in the above attempts was restarting Java ….. and triggering the same effect as killing the maven process.  The problem seems to be in the interaction between IDEA and the external maven process.

For now, my solution is to kill any existing RemoteMavenServer process before clicking the ‘Update’ button.  An easy way to do this it to make some trivial change in VM Options for Importer …. which causes IDEA to restart the external maven process.

This problem is well characterized here:
https://youtrack.jetbrains.com/issue/IDEA-138029

Hope JetBrains fixes this one soon.

Troubleshooting common Maven issues

If you encounter problems working with your Maven project you can check to see if the following solutions and workarounds can help you solve your issues.

How to fix compiler version problems in Maven projects

In some cases when you import a Maven project, it might have compiler settings that will not match the expected settings in IntelliJ IDEA and when you compile your code, you might encounter a problem.

For example, you can get the following error:

This error usually indicates a problem with the compiler version compatibility, and you can check few places to fix it.

For example, you can edit your POM and configure Maven compiler plugin to compile your Java code. You should set the compiler level explicitly, so it won’t revert to the default settings when you re-import your project.

Set the compiler level in POM

Open your POM in the editor.

Change the configuration for the Maven compiler plugin.

Click to import your changes. Note that the configurations specified in your POM overrides any configurations specified in your project structure. So, now after this project is imported the language level should be picked up.

Check the Java compiler settings to see if the bytecode versions match.

Check the compiler settings

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Compiler | Java Compiler .

On the page that opens, check if Project bytecode version and Target bytecode version match, or leave the Target bytecode version option blank so it can be determined from JDK.

If you have imported a multi-level project, you can check project structure settings for source language level configuration.

Check the language level in the project structure

Open Project Structure dialog and select Project from the options on the left.

Check the source language level for your project.

Check the source language level for each module (click the Sources tab).

How to fix problems with Maven projects that won’t start

To fix issues that are related to the Maven projects that won’t start or import, you can perform one of the following actions.

If you received the OutOfMemory error, try to increase the heap size for the Maven importer.

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Build Tools | Maven | Importing .

You can click the icon in the Maven tool window to open the Maven settings.

On the Importing page, in the VM options for importer field, increase heap size for the Maven importer.

Also, in the JDK for importer field, increase IDE heap size.

If you need to use more heap, switch to 64-bit Java and specify the same 64-bit JVM for Maven JDK for importer .

If you received the Operation timed out error or IDE connection failure to the Maven process, try to edit the hosts file.

Edit the hosts file

On some systems you need to edit the hosts file so that localhost resolves correctly. Try to have 127.0.0.1 localhost in the etc/hosts file. Also, make sure there are no other IP addresses mapped to localhost .

If the error indicates the Maven repository issue, such as the Failed to update Maven indices error, try to check if Maven repositories were indexed correctly.

IntelliJ IDEA works with repository indexes. The indexes are fetched remotely from remote repositories. Some repositories do not provide indexes, or do not keep an updated index, for example, repositories from Bintray, in this case you can ignore the error.

If you have an indexed repository, but still get a Maven repository error, check the following options:

Check the user settings file

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Build Tools | Maven .

You can click the icon in the Maven tool window to open the Maven settings.

On the Maven page, in the User settings file field, check if you defined proper credentials for the server in settings.xml .

You can try to restart IntelliJ IDEA and update Maven repositories.

Update Maven repositories

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Build Tools | Maven | Repositories .

You can click the icon in the Maven tool window to open the Maven settings.

Select Repositories from options on the left.

On the Repositories page, click Update to update Maven repositories.

After the update is finished, click OK .

Maven dependencies imported incorrectly

If the dependencies weren’t imported correctly (IntelliJ IDEA highlights them), try to perform the following actions:

You can check your local maven repository in the Maven | Repositories settings and try to update it.

You can check the jar file of the local .m2 repository to see if it was downloaded correctly.

You can check the effective POM to determine which Maven repository was used as an origin of the dependency.

You can select the Always update snapshots option in Maven settings. In this case, IntelliJ IDEA checks the latest version of the downloaded dependency and updates it accordingly.

Источник

Русские Блоги

Решение проблемы загрузки зависимостей Maven в IDEA

При использовании IDEA для разработки проекта Maven время от времени вы будете сталкиваться с ошибкой в ​​pom.xml. Большая вероятность состоит в том, что загрузка пакета jar, от которого зависит Maven, завершается неудачно и не обнаруживается. Вот решение проблемы загрузки зависимости Maven в IDEA, для вашей справки, фактическое измерение полезно.

Справочник статей

Сначала проверьте, есть ли проблемы с сетью, убедитесь, что нет проблем с сетью, см. Следующий шаг

Нажмите кнопку, чтобы повторно импортировать зависимости Maven несколько раз.


Существует два способа повторного импорта зависимостей Maven, как показано выше. Если вы неоднократно нажимаете кнопку повторного импорта зависимости и по-прежнему сообщаете об ошибке, см. Следующий шаг.

Настройка автоматического импорта зависимостей Maven

Настройки-> Сборка, Выполнение, Развертывание-> Инструменты сборки-> Maven-> Импорт, как показано ниже

После этого параметра, если существует зависимость от репозитория Maven, IDEA автоматически импортирует его в проект. Если это не полезно, см. Следующий шаг

Найдите адрес файла конфигурации Maven в IDEA, а затем проверьте, есть ли проблемы с настроенным удаленным хранилищем или зеркалом.


Как показано выше, моя конфигурация находится в C:developMavenapache-maven-3.5.3confsettings.xml

Я настроил хранилище Alibaba Cloud, проблем нет, если вы настраиваете частный Nexus Maven, вам нужно проверить путь конфигурации и сеть частного сервера.

Если описанные выше шаги не решают проблему, вы можете использовать следующий скрипт для удаления файла lastUpdated в Mvaen

Если ваш компьютер является системой Windows, создайте новый файл cleanLastUpdated.bat

Примечание. Не забудьте изменить путь к хранилищу файла сценария cleanLastUpdated.bat на путь к вашему собственному хранилищу Maven.

Сохраните, затем дважды щелкните, чтобы выполнить скрипт для удаления файла lastUpdated, и затем нажмите кнопку, чтобы повторно импортировать зависимости Maven.

Зависимости хранилища Maven по-прежнему сообщают об ошибках


Моя проблема с зависимостями не была решена до этого шага, так устала, но проблема была окончательно решена!

Есть два решения:

Сначала удалите соответствующую зависимость в pom.xml, затем обновите правую сторону, затем вставьте зависимость в pom.xml и обновите правую сторону снова просто отлично

Удалите соответствующий пакет с локального склада, а затем снова загрузите maven.

Источник

kdevo / IntelliJ + Maven — Unresolved Plugin.md

IntelliJ IDEA and Maven — «Unresolved Plugin» Solutions

⚠️ Probably outdated (from 2016).

  1. After adding a plugin or a dependency to pom.xml and auto-importing changes or importing changes manually, the plugin or dependency is still not resolved/downloaded
  • Check via CTRL+SHIFT+A -> Enter «Maven Projects» (you would a red underlined plugin or dependency)
  1. «Cannot reconnect» to remote Maven central repository
  • Check via CTRL+SHIFT+A -> Enter «Maven Settings» >Repositories (you would see a red entry)

Causes (only assumptions)

  • Corrupted download: background process has been interrupted/aborted.
    1. due to a network problem
    2. (un)intentionally by the user
  • After downloading the archive, while extracting the archive, IntelliJ aborts the process because of too low disk space
  • Simultaneous downloads from the Maven repository (?)

Solutions — tested on Linux

Before you try any of these solutions, save your work, clear IntelliJ’s cache via File > «Invalidate Cache / Restart» and check if the problem persists.

Please also try if a simple «Reimport All Maven Projects» (type as action using CTRL+SHIFT+A ) changes anything.

1. Solution — «Unresolved plugin»

If you have multiple unresolved plugins, it’s maybe less work for you to follow the second solution instead to redownload all plugins at once.

Let’s assume the plugin’s full name which causes the problem is: org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (replace with your plugin’s name)

  • Close IntelliJ
  • Get the path of your plugin. The path of the example plugin would be org/apache/maven/plugins/maven-shade-plugin (substitute ‘.’ and ‘:’ with ‘/’)
  • Navigate to the affected plugin directory and delete it:
  • Start IntelliJ again
  • CTRL+SHIFT+A -> Enter «Reimport All Maven Projects»
  • If the problem still persists, try the second solution below

2. Solution — «Cannot reconnect» to Maven repository

Источник

Проблема с репозиторием IntelliJ / Maven

Я действительно забираюсь сквозь стены с этой проблемой, я уже второй день пытаюсь ее исправить. Я перепробовал все источники, доступные в сети (на востоке, что я смог найти)

Я работаю с Spring MVC и пытаюсь запустить новый проект Maven. Происходит то, что проект построен на основе шаблонов, и я получаю сообщение об ошибке.

Когда я создаю новый проект без использования архетипов, maven просто не работает — и выдает следующие ошибки:

1: Когда я проверяю репозитории Maven, я вижу ошибку с repo.aven.apache.org/maven2 с: java.lang.RuntimeException: java.io.IOException: Не удалось выполнить перенос для nexus-maven-repository-index.properties.

2: Когда я проверяю детали проекта Maven, плагины и зависимости выделяются красным подчеркиванием.

Вот результат mvn —debug:

Похоже на проблему с сетью

Не могли бы вы предоставить журнал, запустив maven с -X или -e

Больше похоже на проблему с сертификатом: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Я подумал, что это может быть ошибка сертификата, и да, некоторые подсказки заставили меня подумать, что это может быть ограничение сети (компания), однако я могу получить доступ и загрузить файлы jar вручную из репозиториев Maven

Я действительно могу успешно создать проект, используя командную строку

Скорее всего, у вас есть прокси, который перехватывает ваш трафик в целях безопасности компании. Найдите сертификат своей сети: в браузере перейдите к «google.com», щелкните значок замка слева от адресной строки и следуйте инструкциям по интерфейсу пользователя, чтобы получить информацию о пути сертификации. В Chrome это можно увидеть на вкладке «Путь сертификации» диалогового окна, которое открывается после нажатия «Сертификат» во всплывающем пользовательском интерфейсе. Можете ли вы подтвердить, что высшая сертификация в иерархии — это нечто иное, чем «Google Trust Services — GlobalSign . «?

да. верхний сертификат — это название моей компании, а затем google.com

Как лучше всего это пропустить?

Основываясь на ответах, представленных в комментариях к исходному сообщению, я пришел к выводу, что ваша компания использует прокси-сервер для перехвата сетевого трафика. По сути, он динамически добавляет сертификат компании в начало пути сертификации всех HTTPS-сайтов, к которым вы обращаетесь.

Чтобы доверять сертификату вашей компании в приложении Java, вы должны добавить его в хранилище ключей Java, используемое этим приложением. В случае Intellij IDEA, который поставляется с собственной JRE, шаги следующие:

В вашем браузере перейдите на https://www.google.com или любой другой https-сайт. Щелкните значок замка слева от адресной строки и следуйте пользовательскому интерфейсу, чтобы получить информацию о пути сертификации. В Chrome вы можете просмотреть это на вкладке «Путь сертификации» диалогового окна, которое открывается, когда вы нажимаете «Сертификат» после щелчка по значку замка.

Щелкните сертификат самый верхний в иерархии (тот, который содержит название вашей компании) и щелкните Просмотр сертификата. Щелкните вкладку сведений, а затем «Копировать в файл». Следуйте инструкциям маленького мастера, чтобы экспортировать файл с кодировкой .cer Base64; назовем его Компания. Обратите внимание, что это инструкции для Chrome, но есть аналогичные шаги для других браузеров.

Перейдите в папку установки Intellij IDEA, подпапку / jre64 / bin (или / jre32 / bin) и скопируйте туда Company.cer.

Откройте cmd или PowerShell в папке bin, куда вы скопировали сертификат (вы можете щелкнуть правой кнопкой мыши пустое место в проводнике, и контекстное меню Windows предоставит вам вариант для этого). Выполните следующую команду:

keytool.exe -keystore ..libsecuritycacerts -importcert -alias Company -file Company.cer

При запросе пароля используйте Измени это, который является паролем хранилища ключей по умолчанию. Также введите да, когда будет предложено подтвердить добавление сертификата компании.

Перезапустите Intellij IDEA и повторите действие, которое вызывало первоначальную ошибку.

Большое спасибо, Андрей, я следовал твоим указаниям — очень ценю усилия — это отличный урок. Я сделал все, как описано, но все еще получаю ту же ошибку, и репозитории не обновляются. Возможно ли, что моя компания certifacte не поддерживает прокси-сервер maven? Для меня это не имеет особого смысла, потому что я снова могу напрямую перейти к maven2 и загрузить файлы оттуда. Возможно, что-то не так с моими настройками INtelliJ Maven. Параметры виртуальной машины для импортера: -Xmx768m, на вкладке бегуна я вижу JRE: использовать Project JDK (путь: C: Program Files / Java / JDK)

Источник

Понравилась статья? Поделить с друзьями:
  • Integer overflow victoria ошибка как исправить
  • Intel как изменить звук
  • Integer overflow txd workshop ошибка как исправить
  • Intel wireless bluetooth ошибка драйвера
  • Integer expression expected ошибка bash