Maven错误 - 在多模块项目

时间:2017-05-03 22:34:31

标签: java maven pom.xml multi-module

我从exoplatform这个链接下载了日历:https://github.com/exoplatform/calendar我试图通过命令mvn compile war:war来产生战争。如果我运行mvn package或mvn install它运行正常,但是当我添加war:war时,编译失败。

以下是错误:

[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[48,38] package org.exoplatform.calendar.model does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[49,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[50,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[51,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[52,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[53,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[54,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[55,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[56,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[57,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[58,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[59,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[115,18] cannot find symbol
[ERROR]   symbol:   class CalendarService
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[116,11] cannot find symbol
[ERROR]   symbol:   class ExtendedCalendarService
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[120,17] cannot find symbol
[ERROR]   symbol:   class CalendarService
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[134,29] cannot find symbol
[ERROR]   symbol:   class ExtendedCalendarService
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[330,49] cannot find symbol
[ERROR]   symbol:   class CalendarEvent
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[330,72] cannot find symbol
[ERROR]   symbol:   class FeedData
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[630,39] cannot find symbol
[ERROR]   symbol:   class CalendarSetting
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/webservice/cs/calendar/CalendarWebservice.java:[630,67] cannot find symbol
[ERROR]   symbol:   class CalendarEvent
[ERROR]   location: class org.exoplatform.webservice.cs.calendar.CalendarWebservice
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/CalendarRestApi.java:[31,1] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/CalendarRestApi.java:[32,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/CalendarRestApi.java:[33,49] package org.exoplatform.calendar.service.Calendar does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/CalendarRestApi.java:[34,45] package org.exoplatform.calendar.service.impl does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/bean/CategoryResource.java:[22,40] package org.exoplatform.calendar.service does not exist
[ERROR] .../calendar-develop/calendar-webservice/src/main/java/org/exoplatform/calendar/ws/bean/CategoryResource.java:[33,33] cannot find symbol
[ERROR]   symbol:   class EventCategory
[ERROR]   location: class org.exoplatform.calendar.ws.bean.CategoryResource

主要的火球:https://drive.google.com/file/d/0BwWIlGx_c4cXM3puSVY2YTlDWE0/view?usp=sharing

返回的那个总是返回错误:https://drive.google.com/file/d/0BwWIlGx_c4cXWlptTkp0VF95YlU/view?usp=sharing

由于堆栈溢出字符限制,我将它们放在谷歌驱动器中。

我已经尝试过堆栈溢出的解决方案,比如检查执行mvn clean install的依赖项,但每当我添加war:war它会返回那些错误。

任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

是。调用战争目标的正确方法是:

mvn compile war:war

现在,当您仍然看到错误时,似乎可能存在一个项目与另一个项目的依赖关系。并且,由于无法在本地存储库中找到依赖项(因为您尚未在本地存储库中安装该依赖项),因此无法在类路径中添加依赖项,从而导致错误。