1

I'm new to Spring Boot. I just created a project (using https://start.spring.io ). I've tried to run the application by using Maven (./mvnw install) and I got this error:

Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:2.2.2.RELEASE:generateStubs (default-generateStubs) on project api: Stubs could not be found: [D:\springBootWorkspace\mbe.ebiz.test.api\target\stubs]

Here my pom.xml:

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.6.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>mbe.ebiz.dotapro</groupId>
<artifactId>api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api</name>
<description>********</description>

<properties>
    <java.version>1.8</java.version>
    <spring-cloud.version>Hoxton.SR3</spring-cloud.version>
    <javax.inject.version>1</javax.inject.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>${javax.inject.version}</version>
    </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.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-contract-verifier</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-contract-maven-plugin</artifactId>
            <version>2.2.2.RELEASE</version>
            <extensions>true</extensions>
            <configuration>
                <testFramework>JUNIT5</testFramework>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

I did not manage to find a solution in the old posts or on other websites.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Alexis
  • 11
  • 1
  • Forget to say hello ! ^^" – Alexis Apr 27 '20 at 10:14
  • You sure have a lot of dependencies for someone who is just starting to learn Spring Boot. Sure you need all of those? For example stubs are related to spring cloud contract verification, so do you need cloud contract verification? What are you trying to achieve with your sample project? A simple one node webapp? Somethinh more complex? – Tarmo Apr 27 '20 at 13:22
  • I found the problem ! 1 folder was missing -> resources/contracts in src/main/test . Git ignored the empty folder during my commit/pull. To answer your question, I'm doing services for a webapp but I am not the only one working on the project. With the current circumstances, I was alone and needed to advance fast – Alexis Apr 28 '20 at 15:09

0 Answers0