http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-dist/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-dist/pom.xml b/flume-ng-dist/pom.xml index e963bda..da5fa8a 100644 --- a/flume-ng-dist/pom.xml +++ b/flume-ng-dist/pom.xml @@ -54,12 +54,6 @@ </execution> </executions> </plugin> - - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> </build>
http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-dist/src/main/assembly/src.xml ---------------------------------------------------------------------- diff --git a/flume-ng-dist/src/main/assembly/src.xml b/flume-ng-dist/src/main/assembly/src.xml index a79bed5..8c4e90e 100644 --- a/flume-ng-dist/src/main/assembly/src.xml +++ b/flume-ng-dist/src/main/assembly/src.xml @@ -44,6 +44,7 @@ <exclude>**/.settings/**</exclude> <exclude>lib/**</exclude> <exclude>**/.DS_Store</exclude> + <exclude>./mvn/wrapper/maven-wrapper.jar</exclude> </excludes> </fileSet> </fileSets> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-doc/site.xml ---------------------------------------------------------------------- diff --git a/flume-ng-doc/site.xml b/flume-ng-doc/site.xml index 9851821..29ea2ae 100644 --- a/flume-ng-doc/site.xml +++ b/flume-ng-doc/site.xml @@ -19,7 +19,7 @@ <skin> <groupId>org.apache.maven.skins</groupId> <artifactId>maven-fluido-skin</artifactId> - <version>1.0</version> + <version>1.7</version> </skin> <publishDate position="right"/> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-doc/sphinx/FlumeUserGuide.rst ---------------------------------------------------------------------- diff --git a/flume-ng-doc/sphinx/FlumeUserGuide.rst b/flume-ng-doc/sphinx/FlumeUserGuide.rst index 9d163c7..5ae9110 100644 --- a/flume-ng-doc/sphinx/FlumeUserGuide.rst +++ b/flume-ng-doc/sphinx/FlumeUserGuide.rst @@ -792,9 +792,9 @@ and use the same settings for all components, which means less and more centrali The global setup can be configured either through system properties or through environment variables. -================================== =============================== ================================== +================================== =============================== ============================================================================================ System property Environment variable Description -================================== =============================== ================================== +================================== =============================== ============================================================================================ javax.net.ssl.keyStore FLUME_SSL_KEYSTORE_PATH Keystore location javax.net.ssl.keyStorePassword FLUME_SSL_KEYSTORE_PASSWORD Keystore password javax.net.ssl.keyStoreType FLUME_SSL_KEYSTORE_TYPE Keystore type (by default JKS) @@ -807,7 +807,7 @@ flume.ssl.exclude.protocols FLUME_SSL_EXCLUDE_PROTOCOLS Protocols t flume.ssl.include.cipherSuites FLUME_SSL_INCLUDE_CIPHERSUITES Cipher suites to include when calculating enabled cipher suites. A comma (,) separated list. Excluded cipher suites will be excluded from this list if provided. flume.ssl.exclude.cipherSuites FLUME_SSL_EXCLUDE_CIPHERSUITES Cipher suites to exclude when calculating enabled cipher suites. A comma (,) separated list. -================================== =============================== ================================== +================================== =============================== ============================================================================================ The SSL system properties can either be passed on the command line or by setting the ``JAVA_OPTS`` environment variable in *conf/flume-env.sh*. (Although, using the command line is inadvisable because @@ -864,9 +864,9 @@ When paired with the built-in Avro Sink on another (previous hop) Flume agent, it can create tiered collection topologies. Required properties are in **bold**. -=================== ================ =================================================== +===================== ================ ======================================================= Property Name Default Description -=================== ================ =================================================== +===================== ================ ======================================================= **channels** -- **type** -- The component type name, needs to be ``avro`` **bind** -- hostname or IP address to listen on @@ -901,7 +901,7 @@ include-cipher-suites -- Space-separated list of cipher suites to If included-cipher-suites is empty, it includes every supported cipher suites. ipFilter false Set this to true to enable ipFiltering for netty ipFilterRules -- Define N netty ipFilter pattern rules with this config. -================== ================ =================================================== +===================== ================ ======================================================= Example for agent named a1: @@ -940,9 +940,9 @@ agent-principal and agent-keytab are the properties used by the Thrift source to authenticate to the kerberos KDC. Required properties are in **bold**. -=================== =========== ================================================================== +===================== =========== ========================================================================================================================== Property Name Default Description -=================== =========== ================================================================== +===================== =========== ========================================================================================================================== **channels** -- **type** -- The component type name, needs to be ``thrift`` **bind** -- hostname or IP address to listen on @@ -977,7 +977,7 @@ include-cipher-suites -- Space-separated list of cipher suites to incl kerberos false Set to true to enable kerberos authentication. In kerberos mode, agent-principal and agent-keytab are required for successful authentication. The Thrift source in secure mode, will accept connections only from Thrift clients that have kerberos enabled and are successfully authenticated to the kerberos KDC. agent-principal -- The kerberos principal used by the Thrift Source to authenticate to the kerberos KDC. agent-keytab â- The keytab location used by the Thrift Source in combination with the agent-principal to authenticate to the kerberos KDC. -=================== =========== ================================================================== +===================== =========== ========================================================================================================================== Example for agent named a1: @@ -1794,9 +1794,9 @@ Syslog TCP Source The original, tried-and-true syslog TCP source. -=================== =========== ============================================== +===================== =========== ================================================================================================= Property Name Default Description -=================== =========== ============================================== +===================== =========== ================================================================================================= **channels** -- **type** -- The component type name, needs to be ``syslogtcp`` **host** -- Host name or IP address to bind to @@ -1835,7 +1835,7 @@ exclude-cipher-suites -- Space-separated list of cipher suites to excl include-cipher-suites -- Space-separated list of cipher suites to include. The enabled cipher suites will be the included cipher suites without the excluded cipher suites. If included-cipher-suites is empty, it includes every supported cipher suites. -=================== =========== ============================================== +===================== =========== ================================================================================================= For example, a syslog TCP source for agent named a1: @@ -1859,9 +1859,9 @@ Provides support for RFC-3164 and many common RFC-5424 formatted messages. Also provides the capability to configure the character set used on a per-port basis. -==================== ================ ============================================== +===================== ================ ============================================== Property Name Default Description -==================== ================ ============================================== +===================== ================ ============================================== **channels** -- **type** -- The component type name, needs to be ``multiport_syslogtcp`` **host** -- Host name or IP address to bind to. @@ -1906,7 +1906,7 @@ exclude-cipher-suites -- Space-separated list of cipher suites to include-cipher-suites -- Space-separated list of cipher suites to include. The enabled cipher suites will be the included cipher suites without the excluded cipher suites. If included-cipher-suites is empty, it includes every supported cipher suites. -==================== ================ ============================================== +===================== ================ ============================================== For example, a multiport syslog TCP source for agent named a1: @@ -1969,9 +1969,9 @@ inserted into the channel in one transaction. This source is based on Jetty 9.4 and offers the ability to set additional Jetty-specific parameters which will be passed directly to the Jetty components. -==================== ============================================ ===================================================================================== +===================== ============================================ ===================================================================================== Property Name Default Description -==================== ============================================ ===================================================================================== +===================== ============================================ ===================================================================================== **type** The component type name, needs to be ``http`` **port** -- The port the source should bind to. bind 0.0.0.0 The hostname or IP address to listen on @@ -2005,7 +2005,7 @@ HttpConfiguration.* Jetty specif SslContextFactory.* Jetty specific settings to be set on org.eclipse.jetty.util.ssl.SslContextFactory (only applicable when *ssl* is set to true). ServerConnector.* Jetty specific settings to be set on org.eclipse.jetty.server.ServerConnector -========================================================================================================================================================= +===================== ============================================ ===================================================================================== Deprecated Properties @@ -5224,7 +5224,7 @@ quantifying how much data you generate. That is not always a simple task! Most data streams are bursty (for instance, due to diurnal patterns) and potentially unpredictable. A good starting point is to think about the maximum throughput you'll have in each tier of the topology, both -in terms of *events per second* and *bytes per second*. Once you know the +in terms of *events per second* and *bytes per second*. Once you know the required throughput of a given tier, you can calulate a lower bound on how many nodes you require for that tier. To determine attainable throughput, it's best to experiment with Flume on your hardware, using synthetic or sampled http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-embedded-agent/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-embedded-agent/pom.xml b/flume-ng-embedded-agent/pom.xml index a99f129..72380b2 100644 --- a/flume-ng-embedded-agent/pom.xml +++ b/flume-ng-embedded-agent/pom.xml @@ -28,6 +28,11 @@ limitations under the License. <name>Flume NG Embedded Agent</name> <description>Flume Embedded Agent: Stable public API for Embedding a Flume 1.x Agent</description> + <properties> + <!-- TODO fix pmd violations --> + <pmd.maxAllowedViolations>2</pmd.maxAllowedViolations> + </properties> + <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-legacy-sources/flume-avro-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-legacy-sources/flume-avro-source/pom.xml b/flume-ng-legacy-sources/flume-avro-source/pom.xml index c5fb68e..21fe14b 100644 --- a/flume-ng-legacy-sources/flume-avro-source/pom.xml +++ b/flume-ng-legacy-sources/flume-avro-source/pom.xml @@ -31,6 +31,8 @@ limitations under the License. <name>Flume legacy Avro source</name> <properties> + <!-- TODO fix spotbugs violations --> + <spotbugs.maxAllowedViolations>2</spotbugs.maxAllowedViolations> <thrift.executable>${env.THRIFT_HOME}/bin/thrift</thrift.executable> </properties> @@ -65,10 +67,6 @@ limitations under the License. </pluginManagement> <plugins> <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - <plugin> <groupId>org.apache.avro</groupId> <artifactId>avro-maven-plugin</artifactId> <executions> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-legacy-sources/flume-thrift-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-legacy-sources/flume-thrift-source/pom.xml b/flume-ng-legacy-sources/flume-thrift-source/pom.xml index ce84145..27caf22 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/pom.xml +++ b/flume-ng-legacy-sources/flume-thrift-source/pom.xml @@ -30,6 +30,12 @@ limitations under the License. <artifactId>flume-thrift-source</artifactId> <name>Flume legacy Thrift Source</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>38</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>119</pmd.maxAllowedViolations> + </properties> + <profiles> <profile> <id>compileThrift</id> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java ---------------------------------------------------------------------- diff --git a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java index 7140f07..8c751a8 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java +++ b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java @@ -19,7 +19,6 @@ package org.apache.flume.source.thriftLegacy; -import java.lang.InterruptedException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.charset.Charset; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-legacy-sources/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-legacy-sources/pom.xml b/flume-ng-legacy-sources/pom.xml index 5329ecb..611e753 100644 --- a/flume-ng-legacy-sources/pom.xml +++ b/flume-ng-legacy-sources/pom.xml @@ -26,20 +26,10 @@ limitations under the License. <version>1.9.0-SNAPSHOT</version> </parent> - <groupId>org.apache.flume</groupId> <artifactId>flume-ng-legacy-sources</artifactId> <name>Flume legacy Sources</name> <packaging>pom</packaging> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> - <modules> <module>flume-thrift-source</module> <module>flume-avro-source</module> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-node/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-node/pom.xml b/flume-ng-node/pom.xml index 83faadd..84aaa40 100644 --- a/flume-ng-node/pom.xml +++ b/flume-ng-node/pom.xml @@ -31,29 +31,11 @@ <artifactId>flume-ng-node</artifactId> <name>Flume NG Node</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <executions> - <execution> - <id>verify.rat</id> - <phase>verify</phase> - <goals> - <goal>check</goal> - </goals> - <configuration> - <excludes> - <!-- JSON doesn't support comments --> - <exclude>src/test/resources/flume-conf.json</exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs violations --> + <spotbugs.maxAllowedViolations>7</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>7</pmd.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sdk/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sdk/pom.xml b/flume-ng-sdk/pom.xml index 658abce..a8747bf 100644 --- a/flume-ng-sdk/pom.xml +++ b/flume-ng-sdk/pom.xml @@ -28,6 +28,12 @@ limitations under the License. <name>Flume NG SDK</name> <description>Flume Software Development Kit: Stable public API for integration with Flume 1.x</description> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>67</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>131</pmd.maxAllowedViolations> + </properties> + <profiles> <profile> <id>compileThrift</id> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sdk/src/main/java/org/apache/flume/api/FailoverRpcClient.java ---------------------------------------------------------------------- diff --git a/flume-ng-sdk/src/main/java/org/apache/flume/api/FailoverRpcClient.java b/flume-ng-sdk/src/main/java/org/apache/flume/api/FailoverRpcClient.java index 5b9cef5..b6d89d3 100644 --- a/flume-ng-sdk/src/main/java/org/apache/flume/api/FailoverRpcClient.java +++ b/flume-ng-sdk/src/main/java/org/apache/flume/api/FailoverRpcClient.java @@ -19,7 +19,6 @@ package org.apache.flume.api; import java.net.InetSocketAddress; -import java.util.ArrayList; import java.util.List; import java.util.Properties; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClient.java ---------------------------------------------------------------------- diff --git a/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClient.java b/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClient.java index 2cee7cb..15b4ad7 100644 --- a/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClient.java +++ b/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClient.java @@ -56,7 +56,7 @@ public interface RpcClient { * resources.</p> * * @param event - * @return + * * @throws EventDeliveryException when an error prevents event delivery. */ public void append(Event event) throws EventDeliveryException; @@ -79,7 +79,7 @@ public interface RpcClient { * resources.</p> * * @param events List of events to send - * @return + * * @throws EventDeliveryException when an error prevents event delivery. */ public void appendBatch(List<Event> events) throws http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClientFactory.java ---------------------------------------------------------------------- diff --git a/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClientFactory.java b/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClientFactory.java index 5cb3332..4326b57 100644 --- a/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClientFactory.java +++ b/flume-ng-sdk/src/main/java/org/apache/flume/api/RpcClientFactory.java @@ -110,7 +110,7 @@ public class RpcClientFactory { /** * Deprecated. Use - * {@link getDefaultInstance() getDefaultInstance(String, Integer)} instead. + * {@link #getDefaultInstance(String, Integer)} instead. * @throws FlumeException * @deprecated */ @@ -133,7 +133,7 @@ public class RpcClientFactory { /** * Deprecated. Use - * {@link getDefaultInstance() getDefaultInstance(String, Integer, Integer)} + * {@link #getDefaultInstance(String, Integer, Integer)} * instead. * @throws FlumeException * @deprecated http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-dataset-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-dataset-sink/pom.xml b/flume-ng-sinks/flume-dataset-sink/pom.xml index 30cca81..3c9b729 100644 --- a/flume-ng-sinks/flume-dataset-sink/pom.xml +++ b/flume-ng-sinks/flume-dataset-sink/pom.xml @@ -30,20 +30,11 @@ limitations under the License. <artifactId>flume-dataset-sink</artifactId> <name>Flume NG Kite Dataset Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <inherited>true</inherited> - <extensions>true</extensions> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugspmd violations --> + <spotbugs.maxAllowedViolations>8</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>11</pmd.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-hdfs-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-hdfs-sink/pom.xml b/flume-ng-sinks/flume-hdfs-sink/pom.xml index f51cfef..214760f 100644 --- a/flume-ng-sinks/flume-hdfs-sink/pom.xml +++ b/flume-ng-sinks/flume-hdfs-sink/pom.xml @@ -30,14 +30,11 @@ limitations under the License. <artifactId>flume-hdfs-sink</artifactId> <name>Flume NG HDFS Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>14</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>24</pmd.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-hive-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-hive-sink/pom.xml b/flume-ng-sinks/flume-hive-sink/pom.xml index 951f205..a177b7c 100644 --- a/flume-ng-sinks/flume-hive-sink/pom.xml +++ b/flume-ng-sinks/flume-hive-sink/pom.xml @@ -26,19 +26,16 @@ limitations under the License. <version>1.9.0-SNAPSHOT</version> </parent> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>6</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>7</pmd.maxAllowedViolations> + </properties> + <groupId>org.apache.flume.flume-ng-sinks</groupId> <artifactId>flume-hive-sink</artifactId> <name>Flume NG Hive Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> - <profiles> <profile> <id>hadoop-1.0</id> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-http-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-http-sink/pom.xml b/flume-ng-sinks/flume-http-sink/pom.xml index 687a02b..594eeec 100644 --- a/flume-ng-sinks/flume-http-sink/pom.xml +++ b/flume-ng-sinks/flume-http-sink/pom.xml @@ -30,14 +30,11 @@ limitations under the License. <artifactId>flume-http-sink</artifactId> <name>Flume HTTP/S Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>1</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>1</pmd.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-http-sink/src/test/java/org/apache/flume/sink/http/TestHttpSink.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-http-sink/src/test/java/org/apache/flume/sink/http/TestHttpSink.java b/flume-ng-sinks/flume-http-sink/src/test/java/org/apache/flume/sink/http/TestHttpSink.java index 175df2c..d8fcde2 100644 --- a/flume-ng-sinks/flume-http-sink/src/test/java/org/apache/flume/sink/http/TestHttpSink.java +++ b/flume-ng-sinks/flume-http-sink/src/test/java/org/apache/flume/sink/http/TestHttpSink.java @@ -19,13 +19,11 @@ package org.apache.flume.sink.http; import org.apache.flume.Channel; -import org.apache.flume.ChannelException; import org.apache.flume.Context; import org.apache.flume.Event; import org.apache.flume.Sink.Status; import org.apache.flume.Transaction; import org.apache.flume.instrumentation.SinkCounter; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-irc-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-irc-sink/pom.xml b/flume-ng-sinks/flume-irc-sink/pom.xml index 0f40c8e..f0e481c 100644 --- a/flume-ng-sinks/flume-irc-sink/pom.xml +++ b/flume-ng-sinks/flume-irc-sink/pom.xml @@ -30,14 +30,10 @@ limitations under the License. <artifactId>flume-irc-sink</artifactId> <name>Flume NG IRC Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs violations --> + <spotbugs.maxAllowedViolations>1</spotbugs.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-elasticsearch-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-elasticsearch-sink/pom.xml b/flume-ng-sinks/flume-ng-elasticsearch-sink/pom.xml index 1df26b8..a70aa2f 100644 --- a/flume-ng-sinks/flume-ng-elasticsearch-sink/pom.xml +++ b/flume-ng-sinks/flume-ng-elasticsearch-sink/pom.xml @@ -24,14 +24,11 @@ <artifactId>flume-ng-elasticsearch-sink</artifactId> <name>Flume NG ElasticSearch Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>8</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>10</pmd.maxAllowedViolations> + </properties> <dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java b/flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java index 83c3ffd..4fda1b8 100644 --- a/flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java +++ b/flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java @@ -17,7 +17,6 @@ * under the License. */ package org.apache.flume.sink.elasticsearch; -import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import java.io.IOException; import java.nio.charset.Charset; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-hbase-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-hbase-sink/pom.xml b/flume-ng-sinks/flume-ng-hbase-sink/pom.xml index 0f8af71..684736a 100644 --- a/flume-ng-sinks/flume-ng-hbase-sink/pom.xml +++ b/flume-ng-sinks/flume-ng-hbase-sink/pom.xml @@ -21,14 +21,12 @@ <artifactId>flume-ng-hbase-sink</artifactId> <name>Flume NG HBase Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>24</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>14</pmd.maxAllowedViolations> + </properties> + <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestAsyncHBaseSink.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestAsyncHBaseSink.java b/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestAsyncHBaseSink.java index f8faa1e..583f8d4 100644 --- a/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestAsyncHBaseSink.java +++ b/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestAsyncHBaseSink.java @@ -570,7 +570,7 @@ public class TestAsyncHBaseSink { * * @param table * @param numEvents Number of events inserted into the table - * @return + * @return array of byte array * @throws IOException */ private byte[][] getResults(HTable table, int numEvents) throws IOException { http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestHBaseSink.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestHBaseSink.java b/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestHBaseSink.java index 217913b..3c366e2 100644 --- a/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestHBaseSink.java +++ b/flume-ng-sinks/flume-ng-hbase-sink/src/test/java/org/apache/flume/sink/hbase/TestHBaseSink.java @@ -390,7 +390,7 @@ public class TestHBaseSink { * * @param table * @param numEvents Number of events inserted into the table - * @return + * @return array of byte arrays * @throws IOException */ private byte[][] getResults(HTable table, int numEvents) throws IOException { http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-hbase2-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-hbase2-sink/pom.xml b/flume-ng-sinks/flume-ng-hbase2-sink/pom.xml index 7419a88..f8f764c 100644 --- a/flume-ng-sinks/flume-ng-hbase2-sink/pom.xml +++ b/flume-ng-sinks/flume-ng-hbase2-sink/pom.xml @@ -21,14 +21,11 @@ <artifactId>flume-ng-hbase2-sink</artifactId> <name>Flume NG HBase2 Sink</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs violations --> + <spotbugs.maxAllowedViolations>3</spotbugs.maxAllowedViolations> + </properties> + <dependencyManagement> <dependencies> <!-- HBase2 dependencies --> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-hbase2-sink/src/test/java/org/apache/flume/sink/hbase2/TestHBase2Sink.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-hbase2-sink/src/test/java/org/apache/flume/sink/hbase2/TestHBase2Sink.java b/flume-ng-sinks/flume-ng-hbase2-sink/src/test/java/org/apache/flume/sink/hbase2/TestHBase2Sink.java index 277e0cf..21aa488 100644 --- a/flume-ng-sinks/flume-ng-hbase2-sink/src/test/java/org/apache/flume/sink/hbase2/TestHBase2Sink.java +++ b/flume-ng-sinks/flume-ng-hbase2-sink/src/test/java/org/apache/flume/sink/hbase2/TestHBase2Sink.java @@ -406,7 +406,7 @@ public class TestHBase2Sink { * * @param table * @param numEvents Number of events inserted into the table - * @return + * @return array of byte arrays * @throws IOException */ private byte[][] getResults(Table table, int numEvents) throws IOException { http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-kafka-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-kafka-sink/pom.xml b/flume-ng-sinks/flume-ng-kafka-sink/pom.xml index 2a24bc1..10d2cf9 100644 --- a/flume-ng-sinks/flume-ng-kafka-sink/pom.xml +++ b/flume-ng-sinks/flume-ng-kafka-sink/pom.xml @@ -22,13 +22,15 @@ <artifactId>flume-ng-kafka-sink</artifactId> <name>Flume Kafka Sink</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>3</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>3</pmd.maxAllowedViolations> + </properties> + <build> <plugins> <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-kafka-sink/src/test/java/org/apache/flume/sink/kafka/util/TestUtil.java ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-kafka-sink/src/test/java/org/apache/flume/sink/kafka/util/TestUtil.java b/flume-ng-sinks/flume-ng-kafka-sink/src/test/java/org/apache/flume/sink/kafka/util/TestUtil.java index 71ed99e..00780fd 100644 --- a/flume-ng-sinks/flume-ng-kafka-sink/src/test/java/org/apache/flume/sink/kafka/util/TestUtil.java +++ b/flume-ng-sinks/flume-ng-kafka-sink/src/test/java/org/apache/flume/sink/kafka/util/TestUtil.java @@ -23,13 +23,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; -import java.net.BindException; import java.net.InetAddress; import java.net.ServerSocket; import java.net.UnknownHostException; import java.util.List; import java.util.Properties; -import java.util.Random; /** * A utility class for starting/stopping Kafka Server. http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-morphline-solr-sink/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-morphline-solr-sink/pom.xml b/flume-ng-sinks/flume-ng-morphline-solr-sink/pom.xml index 5f8732a..8b19514 100644 --- a/flume-ng-sinks/flume-ng-morphline-solr-sink/pom.xml +++ b/flume-ng-sinks/flume-ng-morphline-solr-sink/pom.xml @@ -29,6 +29,9 @@ limitations under the License. <name>Flume NG Morphline Solr Sink</name> <properties> + <!-- TODO fix spotbugspmd violations --> + <spotbugs.maxAllowedViolations>6</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>6</pmd.maxAllowedViolations> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <solr.version>${solr-global.version}</solr.version> <solr.expected.version>${solr-global.version}</solr.expected.version> <!-- sanity check to verify we actually run against the expected version rather than some outdated version --> @@ -139,20 +142,11 @@ limitations under the License. <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> - <executions> - <execution> - <id>test.rat</id> - <phase>test</phase> - <goals> - <goal>check</goal> - </goals> - <configuration> - <excludes> - <exclude>src/test/resources/**</exclude> - </excludes> - </configuration> - </execution> - </executions> + <configuration> + <excludes> + <exclude>src/test/resources/**</exclude> + </excludes> + </configuration> </plugin> </plugins> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/flume-ng-morphline-solr-sink/src/test/resources/solr/collection1/conf/schema.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/flume-ng-morphline-solr-sink/src/test/resources/solr/collection1/conf/schema.xml b/flume-ng-sinks/flume-ng-morphline-solr-sink/src/test/resources/solr/collection1/conf/schema.xml index 65991e1..fa5b788 100644 --- a/flume-ng-sinks/flume-ng-morphline-solr-sink/src/test/resources/solr/collection1/conf/schema.xml +++ b/flume-ng-sinks/flume-ng-morphline-solr-sink/src/test/resources/solr/collection1/conf/schema.xml @@ -184,8 +184,8 @@ <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are currently supported on types that are sorted internally as strings and on numeric types. - This includes "string","boolean", and, as of 3.5 (and 4.x), - int, float, long, date, double, including the "Trie" variants. + This includes "string","boolean", and, as of 3.5 (and 4.x), + int, float, long, date, double, including the "Trie" variants. - If sortMissingLast="true", then a sort on this field will cause documents without the field to come after documents with the field, regardless of the requested sort order (asc or desc). @@ -308,9 +308,9 @@ <!-- A general text field that has reasonable, generic cross-language defaults: it tokenizes with StandardTokenizer, - removes stop words from case-insensitive "stopwords.txt" - (empty by default), and down cases. At query time only, it - also applies synonyms. --> + removes stop words from case-insensitive "stopwords.txt" + (empty by default), and down cases. At query time only, it + also applies synonyms. --> <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> @@ -349,11 +349,11 @@ enablePositionIncrements="true" /> <filter class="solr.LowerCaseFilterFactory"/> - <filter class="solr.EnglishPossessiveFilterFactory"/> + <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> - <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory: + <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory: <filter class="solr.EnglishMinimalStemFilterFactory"/> - --> + --> <filter class="solr.PorterStemFilterFactory"/> </analyzer> <analyzer type="query"> @@ -365,23 +365,23 @@ enablePositionIncrements="true" /> <filter class="solr.LowerCaseFilterFactory"/> - <filter class="solr.EnglishPossessiveFilterFactory"/> + <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> - <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory: + <!-- Optionally you may want to use this less aggressive stemmer instead of PorterStemFilterFactory: <filter class="solr.EnglishMinimalStemFilterFactory"/> - --> + --> <filter class="solr.PorterStemFilterFactory"/> </analyzer> </fieldType> <!-- A text field with defaults appropriate for English, plus - aggressive word-splitting and autophrase features enabled. - This field is just like text_en, except it adds - WordDelimiterFilter to enable splitting and matching of - words on case-change, alpha numeric boundaries, and - non-alphanumeric chars. This means certain compound word - cases will work, for example query "wi fi" will match - document "WiFi" or "wi-fi". + aggressive word-splitting and autophrase features enabled. + This field is just like text_en, except it adds + WordDelimiterFilter to enable splitting and matching of + words on case-change, alpha numeric boundaries, and + non-alphanumeric chars. This means certain compound word + cases will work, for example query "wi fi" will match + document "WiFi" or "wi-fi". --> <fieldType name="text_en_splitting" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"> <analyzer type="index"> @@ -436,7 +436,7 @@ </fieldType> <!-- Just like text_general except it reverses the characters of - each token, to enable more efficient leading wildcard queries. --> + each token, to enable more efficient leading wildcard queries. --> <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> @@ -513,10 +513,10 @@ a token of "foo|1.4" would be indexed as "foo" with a payload of 1.4f Attributes of the DelimitedPayloadTokenFilterFactory : "delimiter" - a one character delimiter. Default is | (pipe) - "encoder" - how to encode the following value into a playload - float -> org.apache.lucene.analysis.payloads.FloatEncoder, - integer -> o.a.l.a.p.IntegerEncoder - identity -> o.a.l.a.p.IdentityEncoder + "encoder" - how to encode the following value into a playload + float -> org.apache.lucene.analysis.payloads.FloatEncoder, + integer -> o.a.l.a.p.IntegerEncoder + identity -> o.a.l.a.p.IdentityEncoder Fully Qualified class name implementing PayloadEncoder, Encoder must have a no arg constructor. --> <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/> @@ -537,10 +537,10 @@ --> <fieldType name="descendent_path" class="solr.TextField"> <analyzer type="index"> - <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" /> + <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" /> </analyzer> <analyzer type="query"> - <tokenizer class="solr.KeywordTokenizerFactory" /> + <tokenizer class="solr.KeywordTokenizerFactory" /> </analyzer> </fieldType> <!-- @@ -549,10 +549,10 @@ --> <fieldType name="ancestor_path" class="solr.TextField"> <analyzer type="index"> - <tokenizer class="solr.KeywordTokenizerFactory" /> + <tokenizer class="solr.KeywordTokenizerFactory" /> </analyzer> <analyzer type="query"> - <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" /> + <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" /> </analyzer> </fieldType> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sinks/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sinks/pom.xml b/flume-ng-sinks/pom.xml index cbb6db1..4977acb 100644 --- a/flume-ng-sinks/pom.xml +++ b/flume-ng-sinks/pom.xml @@ -31,15 +31,6 @@ limitations under the License. <name>Flume NG Sinks</name> <packaging>pom</packaging> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> - <modules> <module>flume-hdfs-sink</module> <module>flume-irc-sink</module> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-jms-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-jms-source/pom.xml b/flume-ng-sources/flume-jms-source/pom.xml index fb2eb76..b7d79aa 100644 --- a/flume-ng-sources/flume-jms-source/pom.xml +++ b/flume-ng-sources/flume-jms-source/pom.xml @@ -30,6 +30,12 @@ limitations under the License. <artifactId>flume-jms-source</artifactId> <name>Flume JMS Source</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>5</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>4</pmd.maxAllowedViolations> + </properties> + <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-kafka-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-kafka-source/pom.xml b/flume-ng-sources/flume-kafka-source/pom.xml index cf3fdff..9119b20 100644 --- a/flume-ng-sources/flume-kafka-source/pom.xml +++ b/flume-ng-sources/flume-kafka-source/pom.xml @@ -30,14 +30,11 @@ <artifactId>flume-kafka-source</artifactId> <name>Flume Kafka Source</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>16</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>32</pmd.maxAllowedViolations> + </properties> <dependencies> <dependency> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-scribe-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-scribe-source/pom.xml b/flume-ng-sources/flume-scribe-source/pom.xml index 1b15874..45940af 100644 --- a/flume-ng-sources/flume-scribe-source/pom.xml +++ b/flume-ng-sources/flume-scribe-source/pom.xml @@ -30,6 +30,12 @@ limitations under the License. <artifactId>flume-scribe-source</artifactId> <name>Flume Scribe Source</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>19</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>76</pmd.maxAllowedViolations> + </properties> + <profiles> <profile> <id>compileThrift</id> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-taildir-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-taildir-source/pom.xml b/flume-ng-sources/flume-taildir-source/pom.xml index 011532e..9cc07a3 100644 --- a/flume-ng-sources/flume-taildir-source/pom.xml +++ b/flume-ng-sources/flume-taildir-source/pom.xml @@ -30,6 +30,12 @@ limitations under the License. <artifactId>flume-taildir-source</artifactId> <name>Flume Taildir Source</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>13</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>3</pmd.maxAllowedViolations> + </properties> + <dependencies> <dependency> <groupId>org.apache.flume</groupId> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirEventReader.java ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirEventReader.java b/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirEventReader.java index 0dd8eb9..6b9c4f3 100644 --- a/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirEventReader.java +++ b/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirEventReader.java @@ -38,8 +38,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.apache.flume.source.taildir.TaildirSourceConfigurationConstants - .BYTE_OFFSET_HEADER_KEY; +import static org.apache.flume.source.taildir.TaildirSourceConfigurationConstants.BYTE_OFFSET_HEADER_KEY; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-twitter-source/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-twitter-source/pom.xml b/flume-ng-sources/flume-twitter-source/pom.xml index a63a10c..b2d9d50 100644 --- a/flume-ng-sources/flume-twitter-source/pom.xml +++ b/flume-ng-sources/flume-twitter-source/pom.xml @@ -30,6 +30,12 @@ limitations under the License. <artifactId>flume-twitter-source</artifactId> <name>Flume Twitter Source</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>4</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>2</pmd.maxAllowedViolations> + </properties> + <dependencies> <dependency> <groupId>org.apache.flume</groupId> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-twitter-source/src/main/java/org/apache/flume/source/twitter/TwitterSource.java ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-twitter-source/src/main/java/org/apache/flume/source/twitter/TwitterSource.java b/flume-ng-sources/flume-twitter-source/src/main/java/org/apache/flume/source/twitter/TwitterSource.java index 948e6c0..0431451 100644 --- a/flume-ng-sources/flume-twitter-source/src/main/java/org/apache/flume/source/twitter/TwitterSource.java +++ b/flume-ng-sources/flume-twitter-source/src/main/java/org/apache/flume/source/twitter/TwitterSource.java @@ -33,7 +33,6 @@ import org.apache.avro.file.DataFileWriter; import org.apache.avro.generic.GenericData.Record; import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; -import org.apache.avro.io.DatumWriter; import org.apache.flume.Context; import org.apache.flume.Event; import org.apache.flume.EventDrivenSource; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/flume-twitter-source/src/test/java/org/apache/flume/source/twitter/TestTwitterSource.java ---------------------------------------------------------------------- diff --git a/flume-ng-sources/flume-twitter-source/src/test/java/org/apache/flume/source/twitter/TestTwitterSource.java b/flume-ng-sources/flume-twitter-source/src/test/java/org/apache/flume/source/twitter/TestTwitterSource.java index f6cc2c9..b2636ee 100644 --- a/flume-ng-sources/flume-twitter-source/src/test/java/org/apache/flume/source/twitter/TestTwitterSource.java +++ b/flume-ng-sources/flume-twitter-source/src/test/java/org/apache/flume/source/twitter/TestTwitterSource.java @@ -36,7 +36,6 @@ import org.apache.flume.channel.ReplicatingChannelSelector; import org.apache.flume.conf.Configurables; import org.apache.flume.sink.DefaultSinkProcessor; import org.apache.flume.sink.LoggerSink; -import org.apache.flume.source.twitter.TwitterSource; import org.junit.Assert; import org.junit.Assume; import org.junit.BeforeClass; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-sources/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-sources/pom.xml b/flume-ng-sources/pom.xml index bb9c789..8366a67 100644 --- a/flume-ng-sources/pom.xml +++ b/flume-ng-sources/pom.xml @@ -31,15 +31,6 @@ limitations under the License. <name>Flume Sources</name> <packaging>pom</packaging> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> - <modules> <module>flume-scribe-source</module> <module>flume-jms-source</module> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-tests/pom.xml ---------------------------------------------------------------------- diff --git a/flume-ng-tests/pom.xml b/flume-ng-tests/pom.xml index 91653a0..162ed4e 100644 --- a/flume-ng-tests/pom.xml +++ b/flume-ng-tests/pom.xml @@ -88,7 +88,6 @@ <dependency> <groupId>com.github.stefanbirkner</groupId> <artifactId>system-rules</artifactId> - <version>1.17.0</version> <scope>test</scope> </dependency> </dependencies> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestSpooldirSource.java ---------------------------------------------------------------------- diff --git a/flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestSpooldirSource.java b/flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestSpooldirSource.java index 6018380..3801745 100644 --- a/flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestSpooldirSource.java +++ b/flume-ng-tests/src/test/java/org/apache/flume/test/agent/TestSpooldirSource.java @@ -23,15 +23,12 @@ import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.google.common.io.Files; -import org.apache.commons.io.FileUtils; import org.apache.flume.test.util.StagedInstall; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Properties; import java.util.Set; http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-shared/flume-shared-kafka-test/pom.xml ---------------------------------------------------------------------- diff --git a/flume-shared/flume-shared-kafka-test/pom.xml b/flume-shared/flume-shared-kafka-test/pom.xml index d6d6412..2c1b9dd 100644 --- a/flume-shared/flume-shared-kafka-test/pom.xml +++ b/flume-shared/flume-shared-kafka-test/pom.xml @@ -22,13 +22,15 @@ <artifactId>flume-shared-kafka-test</artifactId> <name>Flume Shared Kafka Test Utils</name> + <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>1</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>1</pmd.maxAllowedViolations> + </properties> + <build> <plugins> <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-shared/pom.xml ---------------------------------------------------------------------- diff --git a/flume-shared/pom.xml b/flume-shared/pom.xml index 0b77424..7e9f4c7 100644 --- a/flume-shared/pom.xml +++ b/flume-shared/pom.xml @@ -31,14 +31,6 @@ limitations under the License. <name>Flume Shared Utils</name> <packaging>pom</packaging> - <build> - <plugins> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - </plugin> - </plugins> - </build> <modules> <module>flume-shared-kafka</module> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/flume-tools/pom.xml ---------------------------------------------------------------------- diff --git a/flume-tools/pom.xml b/flume-tools/pom.xml index c86ead5..abc25eb 100644 --- a/flume-tools/pom.xml +++ b/flume-tools/pom.xml @@ -34,6 +34,9 @@ limitations under the License. <name>Flume NG Tools</name> <properties> + <!-- TODO fix spotbugs/pmd violations --> + <spotbugs.maxAllowedViolations>5</spotbugs.maxAllowedViolations> + <pmd.maxAllowedViolations>2</pmd.maxAllowedViolations> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/mvnw ---------------------------------------------------------------------- diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..5551fde --- /dev/null +++ b/mvnw @@ -0,0 +1,286 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" http://git-wip-us.apache.org/repos/asf/flume/blob/fb16ffc0/mvnw.cmd ---------------------------------------------------------------------- diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100755 index 0000000..48363fa --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE%
