Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Eclipse Maven安装错误-证书错误_Java_Eclipse_Maven - Fatal编程技术网

Java Eclipse Maven安装错误-证书错误

Java Eclipse Maven安装错误-证书错误,java,eclipse,maven,Java,Eclipse,Maven,我对在Java/Maven中使用Eclipse非常陌生,所以请耐心听我说,因为我可能会错误地问这个问题。我正在尝试对一个已经存在的项目进行Maven安装,该项目将在我正在创建的项目中使用。我使用Git获取这个项目的最新版本(其他人创建的),并运行一个Maven->Update项目,检查快照和发布的强制更新。作品以->Maven Clean的方式运行。成功。执行runas->Maven安装,它将失败,并显示以下消息 [INFO] Building DataSourceConfig 1.0 [INF

我对在Java/Maven中使用Eclipse非常陌生,所以请耐心听我说,因为我可能会错误地问这个问题。我正在尝试对一个已经存在的项目进行Maven安装,该项目将在我正在创建的项目中使用。我使用Git获取这个项目的最新版本(其他人创建的),并运行一个Maven->Update项目,检查快照和发布的强制更新。作品以->Maven Clean的方式运行。成功。执行runas->Maven安装,它将失败,并显示以下消息

[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正在从下载JAR/POM,证书存储在cacerts中。在某些情况下,我只是下载了所需的jar并自己存储在我的存储库中,但我不应该这样做——它应该为我获得jar/POM。我小组中的其他人没有这个问题,因为他们已经下载了一段时间的项目,但是我想让Maven安装按它应该的方式工作

这是my settings.xml(如果需要)


安全中心
安全中心
中心的
https://repo1.maven.org/maven2
真的
中心的
https://repo.maven.apache.org/maven2
真的
还有我从项目中得到的pom.xml(不知道您是否也需要它,但我想我应该包括它——groupId和mainClass的名称为“hidden”)-


4.0.0
com.sherwin.shercolor
数据源配置
1
数据源配置
1.7.5
朱尼特
朱尼特
测试
4.12
org.apache.logging.log4j
log4j型芯
2.8.2
org.apache.logging.log4j
log4jcl
2.8.2
org.slf4j
slf4j api
${slf4j-log4j12.version}
org.slf4j
slf4j-log4j12
${slf4j-log4j12.version}
编译
公地小海狸
公地小海狸
1.9.4
mysql
mysql连接器java
8.0.15
朱尼特
朱尼特
4.12
com.microsoft.sqlserver
mssql jdbc
7.2.2.jre8
com.oracle
ojdbc6
11.2.0
maven编译器插件
3.5.1
1.8
1.8
maven源插件
附加来源
罐子
org.apache.maven.plugins
maven javadoc插件
2.7
org.apache.maven.plugins
maven阴影插件
3.1.1
包裹
阴凉处
com.sherwin.shercolor.config.ExampleClass

PKIX..异常表示您的cacerts文件中不存在所需的证书。如果您有多个java安装,请确保maven使用的安装具有所需的证书。只有在eclipse中运行maven时才会发生这种情况吗?从命令行调用
mvn
时,它是否正常工作?顺便说一下,您可以使用ssl poke实用程序检查是否存在所有必需的证书。在示例中,请尝试
java SSLPoke www.google.com 443
和/或
java SSLPoke repo1.maven.org 443
(代码>@Daniele我将尝试ssl戳。其他人建议删除证书存储中与Maven相关的证书,并从两个站点获取最新的证书,然后再次添加。让SSLPoke工作@Daniele,这让我知道我的证书无效,因此我需要添加正确的证书。谢谢!
<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>
   <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>