Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.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
Spring 错误:Maven2RepositoryLayoutFactory:不支持的旧存储库布局_Spring_Maven_Log4j - Fatal编程技术网

Spring 错误:Maven2RepositoryLayoutFactory:不支持的旧存储库布局

Spring 错误:Maven2RepositoryLayoutFactory:不支持的旧存储库布局,spring,maven,log4j,Spring,Maven,Log4j,我从maven处收到以下错误消息: [ERROR] Failed to execute goal on project battleships: Could not resolve dependencies for project com.miteff.travelex:battleships:wa r:2.0.0-BUILD-SNAPSHOT: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.s

我从maven处收到以下错误消息:

[ERROR] Failed to execute goal on project battleships: Could not resolve dependencies for project com.miteff.travelex:battleships:wa
r:2.0.0-BUILD-SNAPSHOT: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.sun.jdmk:jmxtools:jar:1.2.1, com.s
un.jmx:jmxri:jar:1.2.1: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/no
nav/repository): Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available connector
 factories: BasicRepositoryConnectorFactory: Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy u
sing the available layout factories: Maven2RepositoryLayoutFactory: Unsupported repository layout legacy -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
我有一个几乎空白的带有log4j的Spring项目。Log4j是这样注册的

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.15</version>
</dependency>

log4j
log4j
1.2.15

我知道有两种解决方案:

  • 将log4j版本更新为1.2.17解决了该问题
  • 继续使用log4j版本1.2.15,但通过以下方式向其添加范围运行时:

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <scope>runtime</scope>
    </dependency>
    
    
    log4j
    log4j
    1.2.15
    运行时
    

  • 我发现解决这个问题的唯一方法是使用简单的maven 2端项目,将失败的依赖项放入其中。然后我在这个项目上运行maven 2,依赖项下载良好,然后maven 3找到它们


    我尝试使用“始终”更新策略,但并不总是有效。

    在pom.xml中显示您的存储库配置pom.xml中没有添加其他存储库。谢谢@joro您刚刚为我节省了一些时间!;)