Intellij и Eclipse не разрешают зависимости для плагинов (maven-clean-plugin
, maven-install-plugin
, ...) и для Kafka (org.apache.kafka:kafka-clients
).
Я пробовал много решений:
попробуйте установить его локально, используя эту команду:
mvn install:install-file -Dfile=D:\kafka_jar\kafka-clients.jar \
-DgroupId=org.apache-kafka -DartifactId=kafka-clients -Dversion=2.1.1 -Dpackaging=jar
но у меня отображаются другие ошибки:
![in this picture](https://i.stack.imgur.com/DHD9X.png)
Поскольку я работаю в компании, мне пришлось использовать прокси, чтобы позволить Maven доступ в Интернет.в Intellij, я думаю, я настроил прокси, но я не уверен, что Maven использует его для загрузки (но рынок работает, и я могу загружать плагины).или вы думаете, что именно брандмауэр останавливает Maven?
Я несколько раз изменял settings.xml
, добавляя настройки прокси-сервера, и Maven Central, но у меня возникает та же проблема, это settings.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the
Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<proxies>
<!-- Proxy for HTTP -->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>myUsername</username>
<password>myPassword</password>
<host>host</host>
<port>80</port>
<nonProxyHosts>nonProxyHosts</nonProxyHosts>
</proxy>
<!-- Proxy for HTTPS -->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<username>myUsername</username>
<password>myPassword</password>
<host>host</host>
<port>80</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
</settings>
Я также пытался переключаться между Maven 2 и Maven 3. Когда я использую Maven 2, зависимости от плагинов исчезают, но не Кафка.