m17030611985 阅读(29) 评论(0)
pom

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<shiro.version>1.7.1</shiro.version><!--  -->
		<spring-cloud.version>2020.0.3</spring-cloud.version>
		<spring-cloud-Alibaba.version>2021.1</spring-cloud-Alibaba.version>
		<maven-jar-plugin.version>3.0.0</maven-jar-plugin.version>
	</properties>


	<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>
			<dependency>
	            <groupId>com.alibaba.cloud</groupId>
	            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
	            <version>${spring-cloud-Alibaba.version}</version>
	            <type>pom</type>
	            <scope>import</scope>
	        </dependency>		
		</dependencies>
	</dependencyManagement>


<dependencies>
 		<!-- nacos注册中心 -->
		<dependency>
        	<groupId>com.alibaba.cloud</groupId><!--  -->
        	<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    	</dependency>
</dependencies>
application.properties

#nacos指向注册中心 
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
#nacos访问地址的用户名
spring.cloud.nacos.discovery.username=nacos
#nacos访问地址的密码
spring.cloud.nacos.discovery.password=nacos