Issue
Terminal, deploy on Heroku:
remote: [ERROR] COMPILATION ERROR :
remote: [INFO] -------------------------------------------------------------
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[5,38] package org.telegram.telegrambots.bots does not exist
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[6,50] package org.telegram.telegrambots.meta.api.methods does not exist
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[7,55] package org.telegram.telegrambots.meta.api.methods.send does not exist
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[8,50] package org.telegram.telegrambots.meta.api.objects does not exist
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[9,50] package org.telegram.telegrambots.meta.api.objects does not exist
remote: [ERROR] /tmp/build_51434ea5/src/main/java/com/deputatBot/DeputatBot.java:[10,49] package org.telegram.telegrambots.meta.exceptions does not exist
pom.xml, Maven. TelegramBots library was added from Maven's website:
<?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.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com</groupId>
<artifactId>deputatBot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>deputatBot</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
// here were spring dependencies
<dependency>
<groupId>org.telegram</groupId>
<artifactId>Bots</artifactId>
<version>5.6.0</version>
<type>pom</type>
</dependency>
</dependencies>
//here were spring plugins
</project>
Project builds fine on my machine, but fails when deploying on Heroku. TelegramBots library is added to Maven.
Solution
Pretty simple, just needed to change this library to a https://github.com/rubenlagus/TelegramBots
Answered By - Emma
Answer Checked By - Marie Seifert (JavaFixing Admin)