Idea maven repository error



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:\develop\Maven\apache-maven-3.5.3\conf\settings.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 ..\lib\security\cacerts -importcert -alias Company -file Company.cer

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

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

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

Источник

Читайте также:  Php error message перевод
pigsshop.ru