我有另一个项目的依赖关系,它包含在pom.xml中。 IntelliJ IDEA可以运行此项目,但不能将其打包在jar文件中。我收到以下错误。
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/MyStompSessionHandler.java:[9,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/MyStompSessionHandler.java:[10,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/MyStompSessionHandler.java:[11,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/MyStompSessionHandler.java:[12,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/GameForm.java:[5,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/GameForm.java:[6,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
[ERROR] /C:/Users/mrpin/IdeaProjects/TanksOnline/Client/src/main/java/ru/urfu/Client/GameForm.java:[7,42] package ru.urfu.Server.GameLogic.GameBoard does not exist
这是我的pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.urfu</groupId>
<artifactId>Server</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
这就是我项目的结构 Server Project Client Project
tl; dr客户端具有某些Server项目的依赖关系。 Maven可以打包Server,但不能打包Client(尽管可以运行)。