Я очень новичок в использовании Eclipse с Java / Maven, так что терпите меня, потому что я, вероятно, задам этот вопрос неправильно. Я пытаюсь выполнить Maven Install уже существующего проекта, который будет использоваться в проекте, который я создаю. Я использовал Git, чтобы получить самую последнюю версию этого проекта (кто-то еще создал), и я запускаю Maven -> Обновить проект, проверяя принудительное обновление снимков и выпусков. Работает. Выполнить Run As -> Maven Clean. Успех. Выполните Run As -> Maven Install, и это не удастся с сообщением ниже.
[INFO] Building DataSourceConfig 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from : https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.pom
[INFO] Downloading from : https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/7.2.2.jre8/mssql-jdbc-7.2.2.jre8.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.049 s
[INFO] Finished at: 2020-02-26T14:17:58-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project datasourceconfig: Could not resolve dependencies for project com.sherwin.shercolor:datasourceconfig:jar:1.0: Failed to collect dependencies at commons-beanutils:commons-beanutils:jar:1.9.4: Failed to read artifact descriptor for commons-beanutils:commons-beanutils:jar:1.9.4: Could not transfer artifact commons-beanutils:commons-beanutils:pom:1.9.4 from/to central (https://repo1.maven.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
Я добавил несколько сертификатов в хранилище сертификатов, что было первоначальной проблемой, но некоторые из них по-прежнему отказываются подключаться - если я правильно читаю, это похоже на проблему с сертификатом , Тем не менее, Eclipse загружает файлы jars / poms из https://repo1.maven.org/maven2 - и сертификат хранится в каскадах. В некоторых случаях я только что скачал необходимую банку и сохранил ее в своем репозитории самостоятельно, но мне не нужно этого делать - он должен получить для меня банку / помпоны. У других в моей группе нет этой проблемы, потому что они уже загрузили проект в течение некоторого времени, но я хочу, чтобы Maven Install работал так, как должен.
Вот мои настройки. xml (при необходимости)
<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
-->
<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://repo1.maven.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>
</settings>
и мой пом. xml из проекта (не знаю, нужно ли вам это тоже, но понял Я бы включил его - с именами, скрытыми для groupId и mainClass) -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sherwin.shercolor</groupId>
<artifactId>datasourceconfig</artifactId>
<version>1.0</version>
<name>DataSourceConfig</name>
<properties>
<slf4j-log4j12.version>1.7.5</slf4j-log4j12.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-log4j12.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-log4j12.version}</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j-log4j12.version}</version>
<scope>compile</scope>
</dependency>-->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.7.0</version>
</dependency> -->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2 -->
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.6</version>
</dependency>
-->
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.2.2.jre8</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.sherwin.shercolor.config.ExampleClass</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>