Skip to content
This repository was archived by the owner on Apr 4, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
.classpath
.project
.settings/
.factorypath
.springBeans
target/
_site/
.idea
*.iml
*.swp
*.log
.checkstyle
.DS_Store
.vscode/
.flattened-pom.xml
.sdkmanrc
242 changes: 187 additions & 55 deletions README.adoc

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: "3.9"
services:

#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcd --version"
#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcdctl version"
#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcdctl endpoint health"
#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcdctl put foo bar"
#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcdctl get foo"
#docker exec spring-cloud-etcd /bin/sh -c "/usr/local/bin/etcdutl version"

etcd-v3:
image: "gcr.io/etcd-development/etcd:v3.5.1"
container_name: "spring-cloud-etcd"
volumes:
- etcd-data:/etcd-data
command: [
"etcd",
"--name=s1",
"--data-dir=/etcd-data",
"--listen-client-urls=http://0.0.0.0:2379",
"--advertise-client-urls=http://0.0.0.0:2379",
"--listen-peer-urls=http://0.0.0.0:2380",
"--initial-advertise-peer-urls=http://0.0.0.0:2380",
"--initial-cluster=s1=http://0.0.0.0:2380",
"--initial-cluster-token=tkn",
"--initial-cluster-state=new",
"--log-level=info",
"--logger=zap",
"--log-outputs=stderr"
]
ports:
- "2379:2379"
- "2380:2380"

etcd-v2:
image: "quay.io/coreos/etcd:v2.3.3"
container_name: "spring-cloud-etcd-v2"
volumes:
- etcd-data:/etcd-data
ports:
- "2379:2379"
- "2380:2380"
command:
[
"--listen-client-urls=http://0.0.0.0:2379,http://0.0.0.0:4001",
"--advertise-client-urls=http://0.0.0.0:2379"
]

volumes:
etcd-data:
38 changes: 22 additions & 16 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,53 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-etcd</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-cloud-etcd-docs</artifactId>
<packaging>pom</packaging>
<packaging>jar</packaging>
<name>Spring Cloud Etcd Docs</name>
<description>Spring Cloud Docs</description>
<version>1.0.0.BUILD-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<properties>
<docs.main>spring-cloud-etcd</docs.main>
<main.basedir>${basedir}/..</main.basedir>
<upload-docs-zip.phase>deploy</upload-docs-zip.phase>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<sourceDirectory>src/main/asciidoc</sourceDirectory>
</build>
<profiles>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<inherited>false</inherited>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
39 changes: 29 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
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>org.springframework.cloud</groupId>
<artifactId>spring-cloud-etcd</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Cloud Etcd</name>
<description>Spring Cloud Etcd</description>

<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
Expand All @@ -36,14 +35,30 @@
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand All @@ -52,8 +67,8 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RELEASE</version>
<artifactId>spring-cloud-commons-dependencies</artifactId>
<version>${spring-cloud-commons.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -67,6 +82,10 @@
</dependencies>
</dependencyManagement>

<properties>
<spring-cloud-commons.version>3.1.0-SNAPSHOT</spring-cloud-commons.version>
</properties>

<profiles>
<profile>
<id>spring</id>
Expand Down
16 changes: 1 addition & 15 deletions spring-cloud-etcd-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-etcd</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand All @@ -24,20 +24,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.archaius</groupId>
<artifactId>archaius-core</artifactId>
</dependency>
<!-- archaius dep -->
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,10 +16,10 @@

package org.springframework.cloud.etcd.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.TimeUnit;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* @author Luca Burgazzoli
* @author Spencer Gibb
Expand Down Expand Up @@ -86,18 +86,30 @@ public void setTimeoutUnit(TimeUnit timeoutUnit) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

EtcdConfigProperties that = (EtcdConfigProperties) o;

if (enabled != that.enabled) return false;
if (timeout != that.timeout) return false;
if (prefix != null ? !prefix.equals(that.prefix) : that.prefix != null) return false;
if (defaultContext != null ? !defaultContext.equals(that.defaultContext) : that.defaultContext != null)
if (enabled != that.enabled) {
return false;
}
if (timeout != that.timeout) {
return false;
}
if (prefix != null ? !prefix.equals(that.prefix) : that.prefix != null) {
return false;
}
if (defaultContext != null ? !defaultContext.equals(that.defaultContext) : that.defaultContext != null) {
return false;
if (profileSeparator != null ? !profileSeparator.equals(that.profileSeparator) : that.profileSeparator != null)
}
if (profileSeparator != null ? !profileSeparator.equals(that.profileSeparator) : that.profileSeparator != null) {
return false;
}
return timeoutUnit == that.timeoutUnit;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
/*
* Copyright 2013-2015 the original author or authors.
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.cloud.etcd.config;

/**
* @author Luca Burgazzoli
*/
public class EtcdConstants {
// TODO: add clear comments for properties
final public class EtcdConstants {
/**
* Property source name.
*/
public static final String NAME = "etcd";
/**
* Separator for path.
*/
public static final String PATH_SEPARATOR = "/";
/**
* Separator for properties.
*/
public static final String PROPERTIES_SEPARATOR = ".";

private EtcdConstants() {
}

/**
* Property name for spring application name.
*/
public static final String PROPERTY_SPRING_APPLICATION_NAME = "spring.application.name";
}
Loading