-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch connector version correctly (#12)
- Loading branch information
1 parent
f04561e
commit 15c2eb0
Showing
5 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 | ||
http://maven.apache.org/xsd/assembly-1.1.2.xsd"> | ||
<!-- Assembles a packaged version targeting OS installation. --> | ||
<id>package</id> | ||
<formats> | ||
<format>dir</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<fileSets> | ||
<fileSet> | ||
<directory>${project.basedir}</directory> | ||
<outputDirectory>share/doc/kafka-connect-vespa/</outputDirectory> | ||
<includes> | ||
<include>README*</include> | ||
<include>LICENSE*</include> | ||
<include>NOTICE*</include> | ||
<include>licenses.html</include> | ||
<include>licenses/</include> | ||
<include>notices/</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet> | ||
<directory>${project.basedir}/config</directory> | ||
<outputDirectory>etc/kafka-connect-vespa</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>share/java/kafka-connect-vespa</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
<excludes> | ||
<!-- Exclude these jars during packaging.--> | ||
<exclude>org.apache.kafka:connect-api</exclude> | ||
<exclude>org.apache.kafka:connect-json</exclude> | ||
</excludes> | ||
</dependencySet> | ||
</dependencySets> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/vinted/kafka/connect/vespa/VespaSinkConnectorVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.vinted.kafka.connect.vespa; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
public class VespaSinkConnectorVersion { | ||
private static final Logger log = LoggerFactory.getLogger(VespaSinkConnectorVersion.class); | ||
private static String version = "unknown"; | ||
|
||
private static final String VERSION_FILE = "/kafka-connect-vespa-version.properties"; | ||
|
||
static { | ||
try { | ||
Properties props = new Properties(); | ||
try (InputStream versionFileStream = VespaSinkConnectorVersion.class.getResourceAsStream(VERSION_FILE)) { | ||
props.load(versionFileStream); | ||
version = props.getProperty("version", version).trim(); | ||
} | ||
} catch (Exception e) { | ||
log.warn("Error while loading version:", e); | ||
} | ||
} | ||
|
||
public static String getVersion() { | ||
return version; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## | ||
# | ||
# 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 | ||
# | ||
# 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. | ||
## | ||
version=${project.version} |