0

Сап, есть бот для тг, пишу на джаве, ясное дело со спрингом и мавеном, деплой делаю на хероку, выдает следующую ошибку:

2021-06-01T17:19:40.564913+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-01T17:19:49.713843+00:00 heroku[web.1]: Starting process with command `java - Dserver.port=25099 $JAVA_OPTS -jar target/ArtToolsBot-0.0.1-SNAPSHOT-jar-with-dependencies.jar`
2021-06-01T17:19:53.055857+00:00 app[web.1]: Create a Procfile to customize the command used to run this process: https://devcenter.heroku.com/articles/procfile
2021-06-01T17:19:53.118150+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2021-06-01T17:19:53.123660+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
2021-06-01T17:19:53.308934+00:00 app[web.1]: Error: Could not find or load main class ua.sillmarry.ArtToolsBot.ArtToolsBotApplication
2021-06-01T17:19:53.419459+00:00 heroku[web.1]: Process exited with status 1
2021-06-01T17:19:53.603756+00:00 heroku[web.1]: State changed from starting to crashed

Вот мой 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>

<groupId>ua.sillmarry</groupId>
<artifactId>ArtToolsBot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ArtToolsBot</name>
<description>Project for ArtTools Telegram Bot</description>

<properties>

    <java.version>16</java.version>
    <telegrambots.version>5.2.0</telegrambots.version>

</properties>

<dependencies>

    <!-- Spring Group -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.4.5</version>
    </dependency>

    <!-- SQL Group -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.23</version>
    </dependency>

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

    <!-- Lombok -->
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.20</version>
    </dependency>

    <!-- Telegram Bot API -->
    <dependency>
        <groupId>org.telegram</groupId>
        <artifactId>telegrambots</artifactId>
        <version>${telegrambots.version}</version>
    </dependency>

</dependencies>

<build>

    <plugins>

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork>
                <mainClass>ua.sillmarry.ArtToolsBot.ArtToolsBotApplication</mainClass>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>ua.sillmarry.ArtToolsBot.ArtToolsBotApplication</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>

</build>

1 ответ 1

0

Необходимо было вставить в build следующие плагины:

<build>

    <plugins>

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

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>${start-class}</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

    </plugins>

</build>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.