首页 > 其他分享 >pom.xml常用配置(六)

pom.xml常用配置(六)

时间:2023-10-19 19:32:30浏览次数:28  
标签:xml 常用 application spring eureka instance pom server cloud

Spring Cloud

Spring Cloud Dependencies

<properties>
    <spring-cloud.version>Hoxton.SR3</spring-cloud.version>
</properties>

<dependencyManagement>
    <dependencies>
        <!-- 添加spring cloud 家族依赖 -->
        <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>

Eureka Server

<!-- pom.xml -->
<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>
</dependencies>

application.properties

# Eureka 服务的默认端口号
server.port=8761

# Eureka 不自己注册到自己
eureka.client.register-with-eureka=false
# 不抓取注册表
eureka.client.fetch-registry=false

Eureka Client

<!-- pom.xml -->
<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
</dependencies>

application.properties

spring.application.name=xxx

eureka.instance.prefer-ip-address=false
eureka.instance.hostname=localhost
eureka.instance.ip-address=127.0.0.1
eureka.instance.instance-id=${spring.application.name}:${eureka.instance.hostname}:${server.port}

标签:xml,常用,application,spring,eureka,instance,pom,server,cloud
From: https://blog.51cto.com/u_16302118/7941916

相关文章

  • iptables常用命令
    iptables是用于配置Linux系统中的防火墙规则的命令行工具。其命令格式和常用参数的意思如下:iptables[选项]<链名><规则规范>常用选项:-A:添加规则到指定链的末尾。-D:从指定链中删除规则。-I:插入规则到指定链的开头。-L:列出指定链的规则。-F:清除指定链中的所有规则。-P:......
  • xStream完美转换XML、JSON
    xStream框架xStream可以轻易的将Java对象和xml文档相互转换,而且可以修改某个特定的属性和节点名称,而且也支持json的转换;前面有介绍过json-lib这个框架,在线博文:以及Jackson这个框架,在线博文:它们都完美支持JSON,但是对xml的支持还不是很好。一定程度上限制了对Java对象的描述,不能让xml......
  • 记录最近学习到的一些windows常用命令
    1、ping命令可以用来测试网络是否联通,使用步骤如下:1.1、在电脑上面同时按住win+R,输入cmd,回车 1.2、在窗口里面输入一行格式为“ping+空格+IP地址(或者网站地址)”的命令,如“pingwww.baidu.com” 如上图可见,本台计算机可以与百度通信2、cd命令cd命令可以更改命令提......
  • Eclipse plugin.xml简写command
    <?xmlversion="1.0"encoding="UTF-8"?><?eclipseversion="3.4"?><plugin><extensionpoint="org.eclipse.ui.commands"><commandname="车间质量问责分析处理报告"id="com.xpm.plm.h......
  • [spring-mvc.xml] cannot be opened because it does not exist
    IOExceptionparsingXMLdocumentfromclasspathresource[spring-mvc.xml];nestedexceptionisjava.io.FileNotFoundException:classpathresource[spring-mvc.xml]cannotbeopenedbecauseitdoesnotexist检查pom.xml文件:<packaging>war</packagin......
  • Node.js中常用的设计模式有哪些?
    本文由葡萄城技术团队首发。转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具、解决方案和服务,赋能开发者。设计模式简介设计模式是由经验丰富的程序员在日积月累中抽象出的用以解决通用问题的可复用解决方案,它提供了标准化的代码设计方案提升开发体验。Node.js作......
  • 23.10.18(常用Java异常处理情况整合)
    在JAVA项目中,异常处理是一项非常重要的任务。合理处理异常能够提高程序的稳定性和可靠性,保证程序的正常运行。下面是关于JAVA项目中常用的异常处理情况的总结:1.空指针异常(NullPointerException):在使用一个空对象的成员变量或方法时会抛出该异常。可以通过判断对象是否为空来避免......
  • pom.xml配置文件(五)
    SPRINGBOOT相关JUnitstarter<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope><exclusions><exclusion>......
  • C语言-常用函数
    C语言-常用函数strcat_s函数功能:strcat_s函数与strcat函数一样,主要用于字符串拼接。依赖:头文件string.h主要语法:errno_tstrcat_s(char*strDestination,size_tnumberOfElements,constchar*strSource);描述:用于对字符串进行拼接,将两个字符串连接再一起参数:strDe......
  • 常用JS加密/解密类型以及案例
    简介这里给大家汇总常用不常用的JS加密案例,免得大家用的时候到处去找例子。正题对称加密:替代字符表示法:使用Base64或类似的编码对数据进行简单的转换,不过这并不是真正的加密,而只是一种表示形式的转换。<!DOCTYPEhtml><html><body><h2>Base64编码示例</h2><p>原始文本:Hello......