Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search mavenrepo #251

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c33dfe3
Upgrade of dependencies and java version to java 11 (#1)
martin-greyscaleai Oct 26, 2022
c3895e7
change download package
martin-greyscaleai Feb 27, 2023
90b38a3
change download package
martin-greyscaleai Feb 27, 2023
c898ea9
change download package
martin-greyscaleai Feb 27, 2023
91cdfe9
change download package
martin-greyscaleai Feb 27, 2023
1448bfe
change download package
martin-greyscaleai Feb 27, 2023
9097561
change download package
martin-greyscaleai Feb 27, 2023
34af903
change download package
martin-greyscaleai Feb 27, 2023
01a8ad4
change download package
martin-greyscaleai Feb 27, 2023
ca27d2c
change download package
martin-greyscaleai Feb 27, 2023
a64a96e
fix dependencies
martin-greyscaleai Mar 1, 2023
3439a92
update the prefix
martin-greyscaleai Mar 1, 2023
8a70144
increase aws sdk version
martin-greyscaleai Mar 1, 2023
f29e5b4
increase aws sdk version
martin-greyscaleai Mar 1, 2023
4e48a4f
increase aws sdk version
martin-greyscaleai Mar 1, 2023
2aedc6f
bump maven version
martin-greyscaleai Apr 2, 2023
02a0b36
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
c975cf1
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
15df053
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
b16091e
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
98f3595
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
cff2e65
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
8b56143
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
86cd0f0
add kinesis agent dependencies install from s3
martin-greyscaleai Jun 9, 2023
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
13 changes: 10 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@
<condition property="current.java.version">
<or>
<equals arg1="${ant.java.version}" arg2="1.8"/>
<equals arg1="${ant.java.version}" arg2="11"/>
<equals arg1="${ant.java.version}" arg2="12"/>
<equals arg1="${ant.java.version}" arg2="13"/>
<equals arg1="${ant.java.version}" arg2="14"/>
<equals arg1="${ant.java.version}" arg2="15"/>
<equals arg1="${ant.java.version}" arg2="16"/>
<equals arg1="${ant.java.version}" arg2="17"/>
</or>
</condition>
</target>
<target name="check-java-version" depends="get-java-version" unless="current.java.version">
<fail message="Unsupported Java version: ${ant.java.version}. Make sure that the Java version is 1.8 or greater."/>
<fail message="Unsupported Java version: ${ant.java.version}. Make sure that the Java version is 11 or greater."/>
</target>

<target name="init">
Expand All @@ -35,8 +42,8 @@

<target name="compile" depends="check-java-version, init">
<mkdir dir="${build.private}" />
<property name="build.compiler" value="javac1.7" />
<javac source="1.8" target="1.8" includeantruntime="false" classpathref="classpath" srcdir="${src.dir}" destdir="${build.private}" debug="true" />
<property name="build.compiler" value="javac10+" />
<javac source="11" target="11" includeantruntime="false" classpathref="classpath" srcdir="${src.dir}" destdir="${build.private}" debug="true" />
<property name="src.agent.path" value="com/amazon/kinesis/streaming/agent" />
<copy todir="${build.private}/${src.agent.path}" failonerror="true">
<fileset dir="${src.dir}/${src.agent.path}" excludes="**/*.java" />
Expand Down
52 changes: 26 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>amazon-kinesis-agent</artifactId>
<packaging>jar</packaging>
<name>Amazon Kinesis Agent</name>
<version>2.0.6</version>
<version>2.0.7</version>
<description>Amazon Kinesis Agent runs on customer hosts and continuously monitors a set of log files and sends new data to the Amazon Kinesis Stream and Amazon Kinesis Firehose services in near-real-time.</description>
<url>https://aws.amazon.com/kinesis</url>

Expand All @@ -23,19 +23,19 @@
</licenses>

<properties>
<aws-java-sdk.version>1.11.700</aws-java-sdk.version>
<aws-java-sdk.version>1.12.416</aws-java-sdk.version>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<version>7.6.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<version>4.6.1</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
Expand Down Expand Up @@ -65,37 +65,37 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.3</version>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.3</version>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>[2.10.5.1,)</version>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.10.3</version>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.10.3</version>
<version>2.14.0-rc2</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<version>31.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -105,37 +105,37 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.5.1</version>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.1</version>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.3</version>
<version>4.4.15</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-ab</artifactId>
<version>4.4.3</version>
<version>4.4.15</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
<version>4.4.3</version>
<version>4.4.15</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
<version>1.15</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Expand All @@ -150,7 +150,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand All @@ -171,7 +171,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.1</version>
<version>2.17.2</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
Expand All @@ -182,22 +182,22 @@
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.48</version>
<version>1.82</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.20.1</version>
<version>3.36.0.3</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.8.2</version>
<version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
<version>1.18.24</version>
</dependency>
</dependencies>

Expand All @@ -223,7 +223,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.10.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
Expand All @@ -237,7 +237,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
78 changes: 56 additions & 22 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,31 @@ fail() {
exit 1
}

download_jar_s3() {
group_id=$1
artifact_id=$2
version=$3
s3_bucket=$4
s3_prefix="repo1.maven.org/maven2"
path=${group_id//.//}
jar_name=$artifact_id-$version.jar
tmp_dest=$(mktemp -u)
jar_dest=$dependencies_dir/$jar_name
s3_url=${s3_bucket}/${s3_prefix}/${path}/${artifact_id}/${version}/${jar_name}

# file exists? then don't download it!
[[ -f ${jar_dest} ]] && return

# download the file to a temp location, then if move it here if successful
echo "Downloading $jar_name ($s3_url) to ${dependencies_dir}..."
aws s3 cp ${s3_url} ${dependencies_dir}/
}

download_jar() {
group_id=$1
artifact_id=$2
version=$3
prefix="http://search.maven.org/remotecontent?filepath="
prefix="https://repo1.maven.org/maven2/"
path=${group_id//.//}
jar_name=$artifact_id-$version.jar
tmp_dest=$(mktemp -u)
Expand All @@ -94,48 +114,57 @@ download_jar() {
download_dependencies() {
which ant > /dev/null || $install_package ant
which wget > /dev/null || $install_package wget
s3_bucket="s3://gsai-s3-common-all-install-binaries/maven"
M2_VERSION="3.9.2"
#wget https://dlcdn.apache.org/maven/maven-3/${M2_VERSION}/binaries/apache-maven-${M2_VERSION}-bin.tar.gz
aws s3 cp ${s3_bucket}/dlcdn.apache.org/maven/maven-3/${M2_VERSION}/binaries/apache-maven-${M2_VERSION}-bin.tar.gz .
tar -zxvf apache-maven-${M2_VERSION}-bin.tar.gz
mv apache-maven-${M2_VERSION} /opt/maven
M2_HOME=/opt/maven

install -d ${dependencies_dir}

echo "Downloading dependencies ..."
aws_java_sdk_version="1.11.700"
aws_java_sdk_version="1.12.416"

remote_mvn_pkg="com.amazonaws:aws-java-sdk-core:${aws_java_sdk_version} \
com.amazonaws:aws-java-sdk-kinesis:${aws_java_sdk_version} \
com.amazonaws:aws-java-sdk-cloudwatch:${aws_java_sdk_version} \
com.amazonaws:aws-java-sdk-sts:${aws_java_sdk_version} \
com.amazonaws:aws-java-sdk-ec2:${aws_java_sdk_version} \
com.fasterxml.jackson.core:jackson-annotations:2.10.3\
com.fasterxml.jackson.core:jackson-core:2.10.3 \
com.fasterxml.jackson.core:jackson-databind:2.10.5.1 \
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.10.3 \
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.3 \
com.google.code.findbugs:jsr305:3.0.1 \
com.google.guava:guava:29.0-jre \
com.fasterxml.jackson.core:jackson-annotations:2.14.0-rc2 \
com.fasterxml.jackson.core:jackson-core:2.14.0-rc2 \
com.fasterxml.jackson.core:jackson-databind:2.14.0-rc2 \
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.14.0-rc2 \
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.14.0-rc2 \
com.google.code.findbugs:jsr305:3.0.2 \
com.google.guava:guava:31.1-jre \
org.apache.httpcomponents:httpclient:4.5.13 \
org.apache.httpcomponents:httpclient-cache:4.5.1 \
org.apache.httpcomponents:httpmime:4.5.1 \
org.apache.httpcomponents:httpcore:4.4.3 \
org.apache.httpcomponents:httpcore-ab:4.4.3 \
org.apache.httpcomponents:httpcore-nio:4.4.3 \
commons-cli:commons-cli:1.2 \
commons-codec:commons-codec:1.6 \
org.apache.httpcomponents:httpclient-cache:4.5.13 \
org.apache.httpcomponents:httpmime:4.5.13 \
org.apache.httpcomponents:httpcore:4.4.15 \
org.apache.httpcomponents:httpcore-ab:4.4.15 \
org.apache.httpcomponents:httpcore-nio:4.4.15 \
commons-cli:commons-cli:1.5.0 \
commons-codec:commons-codec:1.15 \
commons-logging:commons-logging:1.2 \
commons-logging:commons-logging-adapters:1.1 \
commons-logging:commons-logging-api:1.1 \
org.apache.commons:commons-lang3:3.4 \
org.apache.commons:commons-lang3:3.12.0 \
org.apache.logging.log4j:log4j-1.2-api:2.17.1 \
org.apache.logging.log4j:log4j-api:2.17.1 \
org.apache.logging.log4j:log4j-core:2.17.1 \
org.apache.logging.log4j:log4j-slf4j-impl:2.17.1 \
org.slf4j:slf4j-api:1.7.12 \
com.beust:jcommander:1.48 \
org.xerial:sqlite-jdbc:3.20.1 \
joda-time:joda-time:2.8.2 \
org.projectlombok:lombok:1.16.6"
com.beust:jcommander:1.82 \
org.xerial:sqlite-jdbc:3.36.0.3 \
joda-time:joda-time:2.11.2 \
org.projectlombok:lombok:1.18.24"

for package in ${remote_mvn_pkg}
do
download_jar $(echo $package | tr : " ")
#${M2_HOME}/bin/mvn dependency:get -Dartifact=$package:jar-with-dependencies
download_jar_s3 $(echo $package | tr : " ") "${s3_bucket}"
done
}

Expand Down Expand Up @@ -179,6 +208,11 @@ do_uninstall () {
do_build () {
download_dependencies

echo "Java version:"
java --version
echo "Ant version:"
ant -version

ant || fail "Failed to build the Java project"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class AddMetadataConverter implements IDataConverter {

public AddMetadataConverter(Configuration config) {
metadata = config.getConfigMap().get("metadata");
timestamp = new Boolean((String) config.getConfigMap().get("timestamp"));
timestamp = Boolean.parseBoolean(config.getConfigMap().get("timestamp").toString());
jsonProducer = ProcessingUtilsFactory.getPrinter(config);
}

Expand Down