-1

Доброго вечера. Вопрос следующий. Создал бота для телеграма на Java. Добавил Procfile в корень проекта, где следующий текст:

worker: java -jar target/recollect-bot-1.0-SNAPSHOT.jar com.recollect.RecollectBot

Создал приложение в Heroku: heroku create. Деплой произошел успешно

'C:\Users\Vladik\IdeaProjects\RecollectBot>git push heroku master

Counting objects: 3, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (3/3), 323 bytes | 0 bytes/s, done.

Total 3 (delta 1), reused 0 (delta 0)

remote: Compressing source files... done.

remote: Building source:

remote:

remote: -----> Java app detected

remote: -----> Installing JDK 1.8... done

remote: -----> Installing Maven 3.3.9... done

remote: -----> Executing: mvn -DskipTests clean dependency:list install

remote: [INFO] Scanning for projects...

remote: [WARNING]

remote: [WARNING] Some problems were encountered while building the effective model for com.recollect.bot:recollect-bot:jar:1.0-SNAPSHOT

remote: [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 12, column 21

remote: [WARNING]

remote: [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

remote: [WARNING]

remote: [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

remote: [WARNING]

remote: [INFO]

remote: [INFO] ------------------------------------------------------------------------

remote: [INFO] Building recollect-bot 1.0-SNAPSHOT

remote: [INFO] ------------------------------------------------------------------------

remote: [INFO]

remote: [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ recollect-bot ---

remote: [INFO]

remote: [INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ recollect-bot ---

remote: [INFO]

remote: [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ recollect-bot ---

remote: [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

remote: [INFO] Copying 1 resource

remote: [INFO]

remote: [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ recollect-bot ---

remote: [INFO] Changes detected - recompiling the module!

remote: [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

remote: [INFO] Compiling 13 source files to /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/target/classes

remote: [WARNING] /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/src/main/java/com/recollect/dao/NoteDAO.java: /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/src/main/java/com/recol lect/dao/NoteDAO.java uses unchecked or unsafe operations.

remote: [WARNING] /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/src/main/java/com/recollect/dao/NoteDAO.java: Recompile with -Xlint:unchecked for details.

remote: [INFO]

remote: [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ recollect-bot ---

remote: [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

remote: [INFO] skip non existing resourceDirectory /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/src/test/resources

remote: [INFO]

remote: [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ recollect-bot ---

remote: [INFO] No sources to compile

remote: [INFO]

remote: [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ recollect-bot ---

remote: [INFO] Tests are skipped.

remote: [INFO]

remote: [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ recollect-bot ---

remote: [INFO] Building jar: /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/target/recollect-bot-1.0-SNAPSHOT.jar

remote: [INFO]

remote: [INFO] --- maven-install-plugin:2.4:install (default-install) @ recollect-bot ---

remote: [INFO] Installing /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/target/recollect-bot-1.0-SNAPSHOT.jar to /app/tmp/cache/.m2/repository/com/recollect/bot/recollect-bot/1. 0-SNAPSHOT/recollect-bot-1.0-SNAPSHOT.jar

remote: [INFO] Installing /tmp/build_87fbbb7218afef1cc2eb4359f0de714c/pom.xml to /app/tmp/cache/.m2/repository/com/recollect/bot/recollect-bot/1.0-SNAPSHOT/recollect-bot-1.0-S NAPSHOT.pom

remote: [INFO] ------------------------------------------------------------------------

remote: [INFO] BUILD SUCCESS

remote: [INFO] ------------------------------------------------------------------------

remote: [INFO] Total time: 4.966 s

remote: [INFO] Finished at: 2018-02-08T17:12:23+00:00

remote: [INFO] Final Memory: 26M/232M

remote: [INFO] ------------------------------------------------------------------------

remote: -----> Discovering process types

remote: Procfile declares types -> worker

remote:

remote: -----> Compressing...

remote: Done: 50.4M

remote: -----> Launching...

remote: Released v4

remote: https://pure-journey-23015.herokuapp.com/ deployed to Heroku

remote:

remote: Verifying deploy... done. To https://git.heroku.com/pure-journey-23015.git 664a66b..b899138 master -> master

Dashboard в Heroku виглядит:

введите сюда описание изображения

Структура проекта виглядит:

введите сюда описание изображения

Мой вопрос о том, что деплой произошел успешно, но бот все же молчит и не работает.

1 ответ 1

1

Process type для telegram бота(Heroku Procfile, Java) Вместо

<mainClass>com.home.server.TelegramBot</mainClass>

надо писать свой класс.

1
  • Разобрался, обновил ответ
    – piller97
    8 фев 2018 в 21:22

Ваш ответ

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

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