У меня есть архитектура микросервисов для проекта, над которым я работаю, в последнее время я использовал Eclipse STS, и всякий раз, когда я запускал один из своих микросервисов приложения, Я использую приложение run as spring boot из контекстного меню
Вчера я хотел поэкспериментировать с кодом Visual Studio, чтобы запустить свое приложение, и попытался использовать терминал powershell, используя .\mvnw
или mvn spring-boot:run
, но, к сожалению, на одном из моих сервисов это работает неправильно, и яm со следующим исключением
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at demo.ClientApplication.main(ClientApplication.java:70)
желаемый проект имеет следующее 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>mds.group</groupId>
<artifactId>MDS-Facture-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MDS-Facture-client</name>
<description>Client Web de la facturation</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Dalston.SR2</spring-cloud.version>
<thymeleaf.version>3.0.6.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.1</thymeleaf-layout-dialect.version>
</properties>
<dependencies>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.4.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mds</groupId>
<artifactId>data-shema</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Что мне нужно сделать, чтобы запустить из vs-code команду maven, чтобы это исправить?(иначе, как воспроизвести сгенерированную команду maven, которую STS использует для успешного запуска моего приложения)
После комментария ugur я попытался выполнить mvn clean compile У меня следующая ошибка компиляции
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[10,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[11,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[19,17] cannot find symbol
symbol: class NotifFeignClient
location: class demo.notification.NotificationRestMediator
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[22,14] cannot find symbol
symbol: class NotificationDTO
location: class demo.notification.NotificationRestMediator
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[15,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[16,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[25,17] cannot find symbol
symbol: class ProductFeignClient
location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[34,43] cannot find symbol
symbol: class ProduitEditDTO
location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[42,14] cannot find symbol
symbol: class ProduitEditDTO
location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[48,41] cannot find symbol
symbol: class ProduitEditDTO
location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[17,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[18,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[19,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[20,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[21,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[35,17] cannot find symbol
symbol: class AppClientFeign
location: class demo.LandingController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[38,17] cannot find symbol
symbol: class UserClientFeign
location: class demo.LandingController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[12,25] package com.mds.shema.dto does
not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[20,80] cannot find symbol
symbol: class CompanySettingQuickFormDTO
location: class demo.company.CompanyController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[28,42] cannot find symbol
symbol: class CompanySettingQuickFormDTO
location: class demo.company.CompanyController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[16,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[17,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[33,17] cannot find symbol
symbol: class RefClientFeign
location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[36,60] cannot find symbol
symbol: class AddClientDTO
location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[56,61] cannot find symbol
symbol: class AddClientDTO
location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/printer/PrintController.java:[20,26] package com.mds.shema.json does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/printer/PrintController.java:[74,64] cannot find symbol
symbol: class ClientJsonDto
location: class demo.printer.PrintController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[21,21] package com.mds.shema does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[12,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[13,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[22,17] cannot find symbol
symbol: class RefClientFeign
location: class demo.refclient.RefClientMediatorRestController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[25,29] cannot find symbol
symbol: class ClientDTO
location: class demo.refclient.RefClientMediatorRestController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[54,44] cannot find symbol
symbol: class DemoApplication
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[56,64] cannot find symbol
symbol: class DemoApplication
[INFO] 34 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.912 s
[INFO] Finished at: 2019-01-29T16:56:37+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project MDS-Facture-client: Compilation failure: Compilation failure:
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[10,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[11,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[19,17] cannot find symbol
[ERROR] symbol: class NotifFeignClient
[ERROR] location: class demo.notification.NotificationRestMediator
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/notification/NotificationRestMediator.java:[22,14] cannot find symbol
[ERROR] symbol: class NotificationDTO
[ERROR] location: class demo.notification.NotificationRestMediator
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[15,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[16,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[25,17] cannot find symbol
[ERROR] symbol: class ProductFeignClient
[ERROR] location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[34,43] cannot find symbol
[ERROR] symbol: class ProduitEditDTO
[ERROR] location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[42,14] cannot find symbol
[ERROR] symbol: class ProduitEditDTO
[ERROR] location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/produit/ProduitRestMediatorController.java:[48,41] cannot find symbol
[ERROR] symbol: class ProduitEditDTO
[ERROR] location: class demo.produit.ProduitRestMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[17,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[18,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[19,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[20,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[21,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[35,17] cannot find symbol
[ERROR] symbol: class AppClientFeign
[ERROR] location: class demo.LandingController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/LandingController.java:[38,17] cannot find symbol
[ERROR] symbol: class UserClientFeign
[ERROR] location: class demo.LandingController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[12,25] package com.mds.shema.dto does
not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[20,80] cannot find symbol
[ERROR] symbol: class CompanySettingQuickFormDTO
[ERROR] location: class demo.company.CompanyController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/company/CompanyController.java:[28,42] cannot find symbol
[ERROR] symbol: class CompanySettingQuickFormDTO
[ERROR] location: class demo.company.CompanyController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[16,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[17,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[33,17] cannot find symbol
[ERROR] symbol: class RefClientFeign
[ERROR] location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[36,60] cannot find symbol
[ERROR] symbol: class AddClientDTO
[ERROR] location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorController.java:[56,61] cannot find symbol
[ERROR] symbol: class AddClientDTO
[ERROR] location: class demo.refclient.RefClientMediatorController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/printer/PrintController.java:[20,26] package com.mds.shema.json does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/printer/PrintController.java:[74,64] cannot find symbol
[ERROR] symbol: class ClientJsonDto
[ERROR] location: class demo.printer.PrintController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[21,21] package com.mds.shema does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[12,27] package com.mds.shema.Feign does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[13,25] package com.mds.shema.dto does not exist
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[22,17] cannot find symbol
[ERROR] symbol: class RefClientFeign
[ERROR] location: class demo.refclient.RefClientMediatorRestController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/refclient/RefClientMediatorRestController.java:[25,29] cannot find symbol
[ERROR] symbol: class ClientDTO
[ERROR] location: class demo.refclient.RefClientMediatorRestController
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[54,44] cannot find symbol
[ERROR] symbol: class DemoApplication
[ERROR] /C:/Users/win 10/Documents/Google Drive/cloud server oauth2/clientFactureMS/src/main/java/demo/ClientApplication.java:[56,64] cannot find symbol
[ERROR] symbol: class DemoApplication
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Кажется, что компилятор не распознает мою добавленную data-shema
зависимость, поэтому я закрываю этот поток и открываю другой, если я не разрешаю это