前提・実現したいこと
現在、LINEのBotをJavaで開発しているんですけど、自分で書いた部分が出力されません
(外部ライブラリのみ出力される)
該当のソースコード
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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.〇〇.LINE_Bot</groupId> <artifactId>MyApp</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>VideoDownloader_LINEBot</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <start-class>com.github.〇〇.LINE_Bot.Main</start-class> </properties> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> </parent> <developers> <developer> <name>MyApp</name> </developer> </developers> <licenses> <license> <name>Apache v2</name> <url>https://www.apache.org/licenses/LICENSE-2.0</url> </license> </licenses> <repositories> <repository> <id>sonatype</id> <url>https://oss.sonatype.org/content/groups/public/</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.github.axet</groupId> <artifactId>vget</artifactId> <version>1.2.6</version> </dependency> <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-server --> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> <version>11.0.0-alpha0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-webapp --> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <version>11.0.0-alpha0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-core --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>5.2.7.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-autoconfigure-processor</artifactId> <version>2.3.1.RELEASE</version> <optional>true</optional> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.3.1.RELEASE</version> </dependency> <dependency> <groupId>com.linecorp.bot</groupId> <artifactId>line-bot-api-client</artifactId> <version>3.6.0</version> <scope>compile</scope> <exclusions> <exclusion> <artifactId>commons-logging</artifactId> <groupId>commons-logging</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.linecorp.bot</groupId> <artifactId>line-bot-model</artifactId> <version>3.6.0</version> <scope>compile</scope> <exclusions> <exclusion> <artifactId>commons-logging</artifactId> <groupId>commons-logging</groupId> </exclusion> </exclusions> </dependency> </dependencies> <build> <defaultGoal>clean package</defaultGoal> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <mainClass>${start-class}</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>3.3.0</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>com.github.〇〇.LINE_Bot.Main</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>assemble-all</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build> </project>
発生している問題・エラーメッセージ
java
1>java -jar test.jar 2エラー: メイン・クラスcom.github.〇〇.LINE_Bot.Mainを検出およびロードできませんでした 3原因: java.lang.ClassNotFoundException: com.github.〇〇.LINE_Bot.Main
補足情報(FW/ツールのバージョンなど)
Java:11
IDE:Intellij IDEA
LINE-sdk:3.6.0
回答1件
あなたの回答
tips
プレビュー