Skip to content

Commit

Permalink
Merge pull request #157 from splunk/DVPL-9534
Browse files Browse the repository at this point in the history
Ant to Maven Migration
As discussed, merging this PR based on one Approval
  • Loading branch information
ashah-splunk authored Jun 16, 2021
2 parents 4163332 + 3edaad4 commit 123693b
Show file tree
Hide file tree
Showing 413 changed files with 2,697 additions and 154 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
build
dist
out
target/

# Test & Coverage
TEST-com.splunk.*.xml

# IntelliJ
.idea/workspace.xml
.idea/misc.xml
.idea/

# Unknown
*.swp
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ init:
.PHONY: test
test:
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
@ant test
# @ant test
@mvn test

.PHONY: test_specific
test_specific:
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.6'

services:
splunk:
image: "splunk/splunk:${SPLUNK_VERSION}"
image: "splunk/splunk:8.0"
container_name: splunk
environment:
- SPLUNK_START_ARGS=--accept-license
Expand All @@ -13,6 +13,8 @@ services:
- 8000:8000
- 8088:8088
- 8089:8089
- 10667:10667
- 10668:10668/udp
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8000']
interval: 5s
Expand Down
118 changes: 118 additions & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>

<artifactId>examples</artifactId>
<parent>
<artifactId>splunk-sdk-java</artifactId>
<groupId>com.splunk</groupId>
<version>1.0.0</version>
</parent>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.splunk</groupId>
<artifactId>splunk</artifactId>
<version>1.6.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-explorer</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-execution</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-modules</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-text</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-options</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-loaders</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-io</artifactId>
<version>RELEASE124</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-actions</artifactId>
<version>RELEASE124</version>
</dependency>
</dependencies>

</project>
Binary file removed lib/commons-cli-1.2.jar
Binary file not shown.
Binary file removed lib/gson-2.2.4.jar
Binary file not shown.
Binary file removed lib/jacocoant.jar
Binary file not shown.
Binary file removed lib/junit-4.11.jar
Binary file not shown.
Binary file removed lib/opencsv-2.3.jar
Binary file not shown.
Binary file removed lib/org-openide-actions.jar
Binary file not shown.
Binary file removed lib/org-openide-awt.jar
Binary file not shown.
Binary file removed lib/org-openide-compat.jar
Binary file not shown.
Binary file removed lib/org-openide-dialogs.jar
Binary file not shown.
Binary file removed lib/org-openide-execution.jar
Binary file not shown.
Binary file removed lib/org-openide-explorer.jar
Binary file not shown.
Binary file removed lib/org-openide-filesystems.jar
Binary file not shown.
Binary file removed lib/org-openide-io.jar
Binary file not shown.
Binary file removed lib/org-openide-loaders.jar
Binary file not shown.
Binary file removed lib/org-openide-modules.jar
Binary file not shown.
Binary file removed lib/org-openide-nodes.jar
Binary file not shown.
Binary file removed lib/org-openide-options.jar
Binary file not shown.
Binary file removed lib/org-openide-text.jar
Binary file not shown.
Binary file removed lib/org-openide-util-enumerations.jar
Binary file not shown.
Binary file removed lib/org-openide-util-lookup.jar
Binary file not shown.
Binary file removed lib/org-openide-util.jar
Binary file not shown.
Binary file removed lib/org-openide-windows.jar
Binary file not shown.
101 changes: 101 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>

<properties>
<version.number>1.6.4</version.number>
<maven.resources.overwrite>true</maven.resources.overwrite>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<groupId>com.splunk</groupId>
<artifactId>splunk-sdk-java</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>Splunk SDK for Java</name>
<url>https://dev.splunk.com/enterprise/docs/devtools/java/sdk-java</url>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
<modules>
<module>splunk</module>
<module>examples</module>
</modules>

<build>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<altDeploymentRepository>
<!-- local::file:./target/local-deploy-->
localRepository::default::file:./target/local-deploy
</altDeploymentRepository>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>splunk-artifactory</id>
<name>Splunk Releases</name>
<url>https://splunk.jfrog.io/splunk/ext-releases-local</url>
</repository>
</repositories>

<!-- Distribution Management is commented for now as we are focusing on local deployment only. -->
<!-- <distributionManagement>
<repository>
<id>splunk-artifactory</id>
<name>Splunk Releases</name>
<url>https://splunk.jfrog.io/splunk/ext-releases-local</url>
</repository>
</distributionManagement>-->

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<organization>
<name>Splunk, Inc.</name>
<url>http://dev.splunk.com</url>
</organization>
</project>
2 changes: 1 addition & 1 deletion scripts/test_specific.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
echo "To run a specific test:"
echo " ant test -Dtestcase=[testclass]"
echo " mvn test -Dtest=[testclass]"
107 changes: 107 additions & 0 deletions splunk/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>

<artifactId>splunk</artifactId>
<version>1.6.5</version>
<parent>
<artifactId>splunk-sdk-java</artifactId>
<groupId>com.splunk</groupId>
<version>1.0.0</version>
</parent>
<properties>
<!-- <jvm.arg.https.protocol>-Dhttps.protocols=TLSv1.1,TLSv1.2</jvm.arg.https.protocol> -->
<https.protocols>TLSv1.2</https.protocols>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<skipTests>${skipTests}</skipTests>
<runOrder>alphabetical</runOrder>
<!-- <argLine>${jvm.arg.https.protocol}</argLine> -->
<systemProperties>
<https.protocols>${https.protocols}</https.protocols>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>target/test-report</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AtomFeedTest {
private static Map<String, Object> expectedData = reader.fromJson(
SDKTestCase.streamToString(
SDKTestCase.openResource(
"data/atom_test_data.json")),
"/data/atom_test_data.json")),
Map.class);

private Map<String, Object> expectedFeed;
Expand All @@ -48,7 +48,7 @@ public class AtomFeedTest {
public AtomFeedTest(String testName) {
this.testName = testName;
this.expectedFeed = (Map<String, Object>)expectedData.get(testName);
this.xmlStream = SDKTestCase.openResource("data/atom/" + testName + ".xml");
this.xmlStream = SDKTestCase.openResource("/data/atom/" + testName + ".xml");
}

@Test
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 123693b

Please sign in to comment.