Проблемы с переходом к основному классу с помощью Heroku / Procfile - PullRequest
1 голос
/ 14 июля 2020

Я пытаюсь перейти к своему основному файлу класса, чтобы разместить его через Heroku, но не могу перейти к нему через свой Procfile.

   2020-07-14T00:26:21.819970+00:00 heroku[web.1]: Starting process with command `java -cp target/classes/com/marcuzzo/JDABot Bot.class`
    2020-07-14T00:26:22.000000+00:00 app[api]: Build succeeded
    2020-07-14T00:26:23.780252+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
    2020-07-14T00:26:23.783762+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
    2020-07-14T00:26:23.872167+00:00 app[web.1]: Error: Could not find or load main class Bot.class
    2020-07-14T00:26:23.928585+00:00 heroku[web.1]: Process exited with status 1
    2020-07-14T00:26:23.978108+00:00 heroku[web.1]: State changed from starting to crashed
    2020-07-14T00:26:23.982448+00:00 heroku[web.1]: State changed from crashed to starting
    2020-07-14T00:26:26.759237+00:00 heroku[web.1]: Starting process with command `java -cp target/classes/com/marcuzzo/JDABot Bot.class`
    2020-07-14T00:26:29.372233+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
    2020-07-14T00:26:29.378057+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
    2020-07-14T00:26:29.489053+00:00 app[web.1]: Error: Could not find or load main class Bot.class
    2020-07-14T00:26:29.564012+00:00 heroku[web.1]: Process exited with status 1
    2020-07-14T00:26:29.609043+00:00 heroku[web.1]: State changed from starting to crashed

Procfile: web: java -cp target/classes/com/marcuzzo/JDABot Bot.class

Файл POM:

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.marcuzzo</groupId>
  <artifactId>JDABot</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>JDABot</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.dv8tion</groupId>
        <artifactId>JDA</artifactId>
        <version>4.2.0_178</version>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>
  </repositories>
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.marcuzzo.JDABot</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Несмотря на то, что мой основной путь к классам - target / classes / com / marcuzzo / JDABot / Bot.class, он, похоже, не может его найти. Может ли кто-нибудь сказать мне, почему это так?

EDIT: Directory = C:\Users\mattm\Desktop\Projects\JDABot Путь к Bot.class: C:\Users\mattm\Desktop\Projects\JDABot\target\classes\com\marcuzzo\JDABot

EDIT: Heroku Logs

     2020-07-14T01:15:55.000000+00:00 app[api]: Build started by user mattmarcuzzo@gmail.com
2020-07-14T01:16:11.013386+00:00 app[api]: Deploy 3b17fa92 by user mattmarcuzzo@gmail.com
2020-07-14T01:16:11.013386+00:00 app[api]: Release v43 created by user mattmarcuzzo@gmail.com
2020-07-14T01:16:11.546025+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-14T01:16:13.000000+00:00 app[api]: Build succeeded
2020-07-14T01:16:14.216417+00:00 heroku[web.1]: Starting process with command `sh -c "java -cp target/classes/ com.marcuzzo.JDABot"`
2020-07-14T01:16:16.606060+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-07-14T01:16:16.619387+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-07-14T01:16:16.757017+00:00 app[web.1]: Error: Could not find or load main class com.marcuzzo.JDABot
2020-07-14T01:16:16.820083+00:00 heroku[web.1]: Process exited with status 1
2020-07-14T01:16:16.859983+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-14T01:16:16.862873+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-14T01:16:20.017311+00:00 heroku[web.1]: Starting process with command `sh -c "java -cp target/classes/ com.marcuzzo.JDABot"`

EDIT:

C:\Users\mattm\Desktop\Projects\JDABot\target\classes\com\marcuzzo\JDABot

07/13/2020  07:17 PM    <DIR>          .
07/13/2020  07:17 PM    <DIR>          ..
07/13/2020  07:10 PM               782 Bot.class
               1 File(s)            782 bytes
               2 Dir(s)  39,904,493,568 bytes free`
...