0

I am trying to deploy a spring boot app on Heroku. Here's my heroku error log:

remote:        [ERROR] COMPILATION ERROR : 
remote:        [INFO] -------------------------------------------------------------
remote:        [ERROR] /tmp/build_ffefd73b56c7017473a0b98cce9d815d/src/test/java/com/ticketbooking/ticketbooking/TicketbookingApplicationTests.java:[3,29] package org.junit.jupiter.api does not exist
remote:        [ERROR] /tmp/build_ffefd73b56c7017473a0b98cce9d815d/src/test/java/com/ticketbooking/ticketbooking/TicketbookingApplicationTests.java:[4,45] package org.springframework.boot.test.context does not exist
remote:        [ERROR] /tmp/build_ffefd73b56c7017473a0b98cce9d815d/src/test/java/com/ticketbooking/ticketbooking/TicketbookingApplicationTests.java:[6,2] cannot find symbol
remote:          symbol: class SpringBootTest
remote:        [ERROR] /tmp/build_ffefd73b56c7017473a0b98cce9d815d/src/test/java/com/ticketbooking/ticketbooking/TicketbookingApplicationTests.java:[9,6] cannot find symbol
remote:          symbol:   class Test
remote:          location: class com.ticketbooking.ticketbooking.TicketbookingApplicationTests
remote:        [INFO] 4 errors 
remote:        [INFO] -------------------------------------------------------------
remote:        [INFO] ------------------------------------------------------------------------
remote:        [INFO] BUILD FAILURE

I am confused, because I do not have any test classes, I don't know where it's getting the TicketbookingApplicationTests class.

Here's my pom.xml:

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jdbc</artifactId>
    </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>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.2.10</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.11.2</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
        <version>2.10.2</version>
    </dependency>

    <!-- API, java.xml.bind module -->
    <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>2.3.2</version>
    </dependency>

    <!-- Runtime, com.sun.xml.bind module -->
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.2</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.2.11.Final</version>
    </dependency>

    <dependency>
        <groupId>com.google.zxing</groupId>
        <artifactId>javase</artifactId>
        <version>3.3.0</version>
    </dependency>

    <dependency>
        <groupId>org.mindrot</groupId>
        <artifactId>jbcrypt</artifactId>
        <version>0.3m</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.5</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
        <version>2.2.2.RELEASE</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
    <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt</artifactId>
        <version>0.2</version>
    </dependency>

</dependencies>

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

    </plugins>
</build>
halfer
  • 19,824
  • 17
  • 99
  • 186
Fasil
  • 1
  • 3

3 Answers3

0

if you dont find that classes, try to build skipping the test step:

mvn install -DskipTests
  • I think heroku uses the --DskipTests option when u try to deploy with: "git push heroku master" , it runs "./mvnw -DskipTests clean dependency:list install" – Fasil Feb 27 '20 at 18:32
0

i solved the problem with : How can I reconcile detached HEAD with master/origin?

my git was in a detached HEAD state from the origin/master, which contained some junit tests.

Fasil
  • 1
  • 3
0

Heroku has to know which JDK version is used in your project (My system's JDK version is 11). Add below line to the system.properties file. If the file does not exist, create it under project root directory. Replace 11 with yours.

java.runtime.version=11
burak isik
  • 395
  • 5
  • 6