org.apache.Maven.reactor.Mavenexecutionexception: Failed to validate POM for project

Asked

Viewed 39 times

-2

I’m having a little problem with my pom giving the following message:

Validation Messages:

[0]  'dependencies.dependency.version' is missing for com.fasterxml.jackson:jackson-bom:pom

Reason: Failed to validate POM for project com.projecto.api:api at /root/my-project/pom.xml

[INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.Maven.reactor.Mavenexecutionexception: Failed to validate POM for project com.projecto.api:api at /root/my-project/pom.xml at org.apache.Maven.DefaultMaven.getProjects(Defaultmaven.java:404) at org.apache.Maven.DefaultMaven.doExecute(Defaultmaven.java:272) at org.apache.Maven.DefaultMaven.execute(Defaultmaven.java:138) at org.apache.Maven.cli.Mavencli.main(Mavencli.java:362) at org.apache.Maven.cli.compat.CompatibleMain.main(Compatiblemain.java:60) at sun.reflect.Nativemethodaccessorimpl.invoke0(Native Method) at sun.reflect..Nativemethodaccessorimpl.invoke(Nativemethodaccessorimpl.java:62) at sun.reflect.Delegatingmethodaccessorimpl.invoke(Delegatingmethodaccessorimpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.Launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.Maven.project.Invalidprojectmodelexception: Failed to validate POM for project com.projecto.api:api at /root/my-project/pom.xml at org.apache.Maven.project.Defaultmavenprojectbuilder.processProjectLogic(Defaultmavenprojectbuilder.java:1077) at org.apache.Maven.project.Defaultmavenprojectbuilder.buildInternal(Defaultmavenprojectbuilder.java:880) at org.apache.Maven.project.Defaultmavenprojectbuilder.buildFromSourceFileInternal(Defaultmavenprojectbuilder.java:508) at org.apache.Maven.project.Defaultmavenprojectbuilder.build(Defaultmavenprojectbuilder.java:200) at org.apache.Maven.DefaultMaven.getProject(Defaultmaven.java:604) at org.apache.Maven.DefaultMaven.collectProjects(Defaultmaven.java:487) at org.apache.Maven.DefaultMaven.getProjects(Defaultmaven.java:391)

follow my pom.xml

<?xml version="1.0" encoding="UTF-8"?>

https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-Starter-Parent 2.2.7.RELEASE with design. api 0.0.1-SNAPSHOT api Demo project for Spring Boot

<properties>
    <java.version>1.8</java.version>
</properties>

<pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <name>Central Repository</name>
        <url>https://repo.maven.apache.org/maven2</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
</pluginRepositories>

<dependencies>

    <dependency>
        <groupId>org.modelmapper</groupId>
        <artifactId>modelmapper</artifactId>
        <version>2.3.5</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!--             security                 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.security.oauth.boot</groupId>
        <artifactId>spring-security-oauth2-autoconfigure</artifactId>
        <version>2.1.5.RELEASE</version>
    </dependency>
    <!--             end security            -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson/jackson-bom -->
    <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <type>pom</type>
    </dependency>


    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.8</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-hateoas</artifactId>
    </dependency>

    <dependency>
        <groupId>br.com.moip</groupId>
        <artifactId>sdk-java</artifactId>
        <version>1.1.0</version>
    </dependency>

    <dependency>
        <groupId>com.github.slugify</groupId>
        <artifactId>slugify</artifactId>
        <version>2.4</version>
    </dependency>

</dependencies>

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

enter the code here

1 answer

1

Missing you set the dependency version with.fasterxml.Jackson

 <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>2.11.0</version>
        <type>pom</type>
    </dependency>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.