Java (Maven) 上的 Heroku Telegram bot 部署错误,包不存在
Heroku Telegram bot deploy error on Java (Maven), package doesn't exist
终端,在 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, 专家。 TelegramBots 库是从 Maven 的网站添加的:
<?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>
项目在我的机器上构建良好,但在 Heroku 上部署时失败。 TelegramBots 库已添加到 Maven。
很简单,只需要将此库更改为 https://github.com/rubenlagus/TelegramBots
终端,在 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, 专家。 TelegramBots 库是从 Maven 的网站添加的:
<?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>
项目在我的机器上构建良好,但在 Heroku 上部署时失败。 TelegramBots 库已添加到 Maven。
很简单,只需要将此库更改为 https://github.com/rubenlagus/TelegramBots