安装
apt install cloc
使用方法
cloc .
cloc --help
//排除目录
cloc --exclude-dir=libs,cache .
//排除扩展名
cloc --exclude-ext=css,js .
// 多目录示例
apt install cloc
cloc .
cloc --help
//排除目录
cloc --exclude-dir=libs,cache .
//排除扩展名
cloc --exclude-ext=css,js .
// 多目录示例
pom.xml
,添加以下内容:<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-netflix-sidecar -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-sidecar</artifactId>
<version>RELEASE</version>
</dependency>
application.properties
文件,添加以下内容:eureka.client.service-url.defaultZone=http://eureka-server:80/eureka
server.port=5678
spring.application.name=non-java-sidecar
sidecar.port=3000
sidecar.health-uri=http://localhost:${sidecar.port}/health.json
注意:
eureka.client.service-url.defaultZone
是 eureka 注册中心地址sidecar.health-uri
是 non-java 服务,确保能正常访问,并返回{"status":"UP"}
@SpringBootApplication
下添加 @EnableSidecar
。sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer