第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

無法在單個(gè)單元測試中使用來自 maven 的 spring-boot-starter-test

無法在單個(gè)單元測試中使用來自 maven 的 spring-boot-starter-test

一只萌萌小番薯 2021-11-03 16:19:52
我是Spring Boot的初學(xué)者,我正在嘗試運(yùn)行單元測試,我使用maven進(jìn)行包管理,但它無法導(dǎo)入相應(yīng)的包,從而導(dǎo)致一些錯(cuò)誤,例如無法使用來自org.springframework的注釋。開機(jī)測試。誰能告訴我如何解決這些問題?謝謝!spring-boot-starter-test 的顏色為灰色。下面是我的 pom.xml<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.mastering.spring</groupId>  <artifactId>springboot-example</artifactId>  <version>0.0.1-SNAPSHOT</version>  <packaging>war</packaging>  <parent>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId>    <version>2.0.0.M1</version> </parent> <properties>    <java.version>1.8</java.version> </properties> <repositories>    <repository>        <id>spring-milestones</id>        <name>Spring Milestones</name>        <url>https://repo.spring.io/milestone</url>        <snapshots>        <enabled>false</enabled>        </snapshots>    </repository> </repositories> <pluginRepositories>    <pluginRepository>        <id>spring-milestones</id>        <name>Spring Milestones</name>        <url>https://repo.spring.io/milestone</url>        <snapshots>        <enabled>false</enabled>        </snapshots>    </pluginRepository> </pluginRepositories> <build>    <plugins>        <plugin>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-maven-plugin</artifactId>        </plugin>    </plugins> </build> <dependencies>    <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>
查看完整描述

2 回答

?
猛跑小豬

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊

如果您使用 Eclipse 開發(fā)帶有 Maven 項(xiàng)目的 Spring Boot 應(yīng)用程序。運(yùn)行單元測試時(shí),應(yīng)在 src/test/java 中創(chuàng)建測試文件 

http://img1.sycdn.imooc.com//618246850001589f11531138.jpg


查看完整回答
反對 回復(fù) 2021-11-03
?
慕村9548890

TA貢獻(xiàn)1884條經(jīng)驗(yàn) 獲得超4個(gè)贊

您可以嘗試清除本地 maven 存儲庫并在此之后運(yùn)行 maven 命令。


查看完整回答
反對 回復(fù) 2021-11-03
  • 2 回答
  • 0 關(guān)注
  • 408 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號