当前位置: 首页 > 知识库问答 >
问题:

Spring boot starter父级2.0.0未找到依赖项

松嘉运
2023-03-14
<?xml version="1.0" encoding="UTF-8"?>
<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.test.testapplication</groupId>
<artifactId>application</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.M1</version>
</parent>

<repositories>
    <repository>
        <id>repository.spring.milestone</id>
        <name>Spring Milestone Repository</name>
        <url>http://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.test.testplugin</groupId>
            <artifactId>plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.test.testutils</groupId>
            <artifactId>utils</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
[INFO] ------------------------------------------------------------------------
[INFO] Building application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.0.0.M1/spring-boot-maven-plugin-2.0.0.M1.pom
[WARNING] The POM for org.springframework.boot:spring-boot-maven-plugin:jar:2.0.0.M1 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.0.0.M1/spring-boot-maven-plugin-2.0.0.M1.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
.
.
.

[INFO] plugin ............................................. SUCCESS [  0.327 s]
[INFO] application ........................................ FAILURE [  0.881 s]
[INFO] webapp ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
.
.
.
.
.

[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.0.0.M1 or one of its dependencies could not be resolved: Could not find artifact org.springframework.boot:spring-boot-maven-plugin:jar:2.0.0.M1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

共有1个答案

杜茂
2023-03-14

将Spring Plugin Release Repo添加到plugin-repositories。以便它能够找到spring-boot-maven-plugin-2.0.0.m1.jar。我已经看到它包含在回购中

标记下添加以下行:

<project>
<!------ others lines -->
    <pluginRepositories>
        <pluginRepository>
            <id>repository.spring.release</id>
            <name>Spring GA Repository</name>
            <url>https://repo.spring.io/plugins-release/</url>
        </pluginRepository>
    </pluginRepositories>
</project>

编辑

<?xml version="1.0" encoding="UTF-8"?>
<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.test.testapplication</groupId>
    <artifactId>application</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.M1</version>
    </parent>

    <pluginRepositories>
        <pluginRepository>
            <id>repository.spring.release</id>
            <name>Spring GA Repository</name>
            <url>https://repo.spring.io/plugins-release/</url>
        </pluginRepository>
    </pluginRepositories>

    <repositories>
        <repository>
            <id>repository.spring.milestone</id>
            <name>Spring Milestone Repository</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>
 类似资料:
  • 尝试部署 Web 应用程序时,由于日志记录错误(如下所示),它将失败: Java . lang . nosuchmethoderror:org . SLF 4j . SPI . locationawarelogger . log(Lorg/SLF 4j/Marker;ljava/lang/String;il Java/lang/String;ljava/lang/Throwable;) 我已经谷歌

  • 我使用的是Maven 3.6.0,我有Spring Boot Maven项目,其pom文件如下: 出于某种原因,我在我的lib文件夹中发现了以下jarlog4j-1.2.14.jar.我想从我的最终战争中排除这个jar,所以我尝试了mvn依赖项:树,但我找不到父依赖项。 我还试图从Eclipse中打开依赖层次结构,但也找不到这个jar。我怎样才能排除这个罐子?

  • 我创建了一个sbt项目。在命令行调用sbt compile可以很好地工作: scalaVersion:=“2.9.2” project/plugins.sbt addSbtPlugin(“com.typesafe.sbteclipse”%“sbteclipse-plugin”%“2.1.0”) 我现在发现控制台上的“SBT测试”也不起作用。所以我认为这不是sbteclipse的问题,而是如何处理测

  • 我已经在gradle文件中添加了依赖项,但仍然无法识别jar文件的类。 我得到错误-不能解决类在这里 我已经提到了以下几点 Android Studio缺少外部依赖项 Android Studio坚持使用“Gradle:resolve Dependencies'_debugCompile'”或“detachedConfiguration1” 如何添加本地. jar文件依赖build.gradle文

  • 这是build.sbt文件: 更新:查看解析器 [play21-osm]$show resolvers[信息]列表(Typesafe Releases repository:http://repo.Typesafe.com/Typesafe/Releases/,Typesafe relepository:http://Typesafe.artifactoryonline.com/Typesafe,

  • 对于那些对整个pom.xml感兴趣的人来说: