From 49e7ff802bdbf87386d9b92783106e48d9bb27dc Mon Sep 17 00:00:00 2001 From: joewitt Date: Sun, 3 Dec 2017 17:45:03 -0500 Subject: [PATCH] NIFI-4652 updating to latest apache version and updating key maven plugins, fixing versions for grpc to avoid extranous build dir, correcting checkstyle issues, resolving build problem with incorrect usage of activeByDefault in maven. Key change is now for the 'dir-only' profile it is now activated via a system property -Ddir-only instead of profile. No other activeByDefault profiles exist except to minifi the javascript but that usage is acceptible as-is. --- nifi-assembly/pom.xml | 53 ++++------- .../elasticsearch/TestFetchElasticsearch.java | 2 +- .../elasticsearch/TestPutElasticsearch.java | 2 +- .../nifi/processors/TestISPEnrichIP.java | 4 +- .../controller/scheduling/ScheduleState.java | 3 +- .../scheduling/StandardProcessScheduler.java | 2 +- .../nifi-grpc-processors/pom.xml | 18 ++-- .../nifi/processors/grpc/TestGRPCServer.java | 4 +- .../nifi/processors/grpc/TestInvokeGRPC.java | 38 +++----- ...tEventIdFirstSchemaRecordReaderWriter.java | 2 +- pom.xml | 94 +++++-------------- 11 files changed, 72 insertions(+), 150 deletions(-) diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml index 115dc538bc6e..b1ab989e677b 100755 --- a/nifi-assembly/pom.xml +++ b/nifi-assembly/pom.xml @@ -44,6 +44,11 @@ language governing permissions and limitations under the License. --> src/main/assembly/dependencies.xml posix + + dir + zip + tar.gz + @@ -832,42 +837,11 @@ language governing permissions and limitations under the License. --> - generateArchives + avoid-archive-formats - true - - - - - maven-assembly-plugin - - nifi-${project.version} - false - - - - make shared resource - - single - - package - - - dir - zip - tar.gz - - - - - - - - - - dir-only - - false + + dir-only + @@ -885,6 +859,15 @@ language governing permissions and limitations under the License. --> package + + 0775 + 0775 + 0664 + + + src/main/assembly/dependencies.xml + + posix dir diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestFetchElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestFetchElasticsearch.java index 30c42d014894..b36b2964a40e 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestFetchElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestFetchElasticsearch.java @@ -101,7 +101,7 @@ public void testFetchElasticsearchOnTrigger() throws IOException { runner.assertAllFlowFilesTransferred(FetchElasticsearch.REL_SUCCESS, 1); assertFalse(runner.getProvenanceEvents().isEmpty()); - runner.getProvenanceEvents().forEach(event -> { assertEquals(event.getEventType(), ProvenanceEventType.FETCH); }); + runner.getProvenanceEvents().forEach(event -> assertEquals(event.getEventType(), ProvenanceEventType.FETCH) ); final MockFlowFile out = runner.getFlowFilesForRelationship(FetchElasticsearch.REL_SUCCESS).get(0); assertNotNull(out); out.assertAttributeEquals("doc_id", "28039652140"); diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestPutElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestPutElasticsearch.java index 6da6a2971c88..306f5138df06 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestPutElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/test/java/org/apache/nifi/processors/elasticsearch/TestPutElasticsearch.java @@ -101,7 +101,7 @@ public void testPutElasticSearchOnTrigger() throws IOException { runner.assertAllFlowFilesTransferred(PutElasticsearch.REL_SUCCESS, 1); assertFalse(runner.getProvenanceEvents().isEmpty()); - runner.getProvenanceEvents().forEach(event -> { assertEquals(event.getEventType(), ProvenanceEventType.SEND); }); + runner.getProvenanceEvents().forEach(event -> assertEquals(event.getEventType(), ProvenanceEventType.SEND)); final MockFlowFile out = runner.getFlowFilesForRelationship(PutElasticsearch.REL_SUCCESS).get(0); assertNotNull(out); out.assertAttributeEquals("doc_id", "28039652140"); diff --git a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/test/java/org/apache/nifi/processors/TestISPEnrichIP.java b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/test/java/org/apache/nifi/processors/TestISPEnrichIP.java index 0b1c06e55620..b1fa5ee809d0 100644 --- a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/test/java/org/apache/nifi/processors/TestISPEnrichIP.java +++ b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/test/java/org/apache/nifi/processors/TestISPEnrichIP.java @@ -284,7 +284,9 @@ private IspResponse getIspResponse() throws Exception { return new ObjectMapper().reader(IspResponse.class).with(inject).readValue(maxMindIspResponse); - } private IspResponse getIspResponseWithoutASNDetail() throws Exception { + } + + private IspResponse getIspResponseWithoutASNDetail() throws Exception { final String maxMindIspResponse = "{\n" + " \"isp\" : \"Apache NiFi - Test ISP\",\n" + " \"organization\" : \"Apache NiFi - Test Organization\",\n" + diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/scheduling/ScheduleState.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/scheduling/ScheduleState.java index de2c35ae0145..207d30809d2e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/scheduling/ScheduleState.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/scheduling/ScheduleState.java @@ -74,8 +74,7 @@ public String toString() { * scheduled to run will receive a true and MUST call the methods annotated with * {@link OnStopped @OnStopped} * - * @return true if the caller is required to call Processor methods annotated with - * @OnStopped, false otherwise + * @return true if the caller is required to call Processor methods annotated with @OnStopped */ public boolean mustCallOnStoppedMethods() { return mustCallOnStoppedMethods.getAndSet(false); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java index 122e50c97b42..c7f158180a58 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java @@ -294,7 +294,7 @@ public void run() { * {@link ProcessorNode#start(ScheduledExecutorService, long, org.apache.nifi.processor.ProcessContext, Runnable)} * method. * - * @see StandardProcessorNode#start(ScheduledExecutorService, long, org.apache.nifi.processor.ProcessContext, Runnable). + * @see StandardProcessorNode#start(ScheduledExecutorService, long, org.apache.nifi.processor.ProcessContext, Runnable) */ @Override public synchronized CompletableFuture startProcessor(final ProcessorNode procNode) { diff --git a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml index fa74818c1fd1..420b842cc8e5 100644 --- a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml +++ b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml @@ -45,22 +45,22 @@ language governing permissions and limitations under the License. --> io.grpc grpc-netty - 1.4.0 + 1.8.0 io.grpc grpc-protobuf - 1.4.0 + 1.8.0 io.grpc grpc-stub - 1.4.0 + 1.8.0 io.netty netty-tcnative-boringssl-static - 2.0.3.Final + 2.0.7.Final org.apache.nifi @@ -83,7 +83,7 @@ language governing permissions and limitations under the License. --> kr.motd.maven os-maven-plugin - 1.4.1.Final + 1.5.0.Final @@ -98,11 +98,11 @@ language governing permissions and limitations under the License. --> org.xolstice.maven.plugins protobuf-maven-plugin - 0.5.0 + 0.5.1 - com.google.protobuf:protoc:3.2.0:exe:${os.detected.classifier} + com.google.protobuf:protoc:3.5.0:exe:${os.detected.classifier} grpc-java - io.grpc:protoc-gen-grpc-java:1.3.0:exe:${os.detected.classifier} + io.grpc:protoc-gen-grpc-java:1.8.0:exe:${os.detected.classifier} ${basedir}/src/main/resources/proto @@ -118,7 +118,7 @@ language governing permissions and limitations under the License. --> org.codehaus.mojo build-helper-maven-plugin - 1.4 + 3.0.0 test diff --git a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestGRPCServer.java b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestGRPCServer.java index 7aeced8e1d4e..7e11b4db4893 100644 --- a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestGRPCServer.java +++ b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestGRPCServer.java @@ -86,7 +86,7 @@ public static int randomPort() throws IOException { /** * Starts the gRPC server @localhost:port. */ - public void start(final int port) throws Exception { + public int start(final int port) throws Exception { final NettyServerBuilder nettyServerBuilder = NettyServerBuilder .forPort(port) .directExecutor() @@ -132,6 +132,7 @@ public void start(final int port) throws Exception { } server = nettyServerBuilder.build().start(); + final int actualPort = server.getPort(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override @@ -142,6 +143,7 @@ public void run() { System.err.println("*** server shut down"); } }); + return actualPort; } /** diff --git a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestInvokeGRPC.java b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestInvokeGRPC.java index f709a19212dd..3b0c41ad8544 100644 --- a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestInvokeGRPC.java +++ b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/src/test/java/org/apache/nifi/processors/grpc/TestInvokeGRPC.java @@ -46,8 +46,7 @@ public void testSuccess() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); runner.setProperty(InvokeGRPC.PROP_SERVICE_PORT, String.valueOf(port)); @@ -86,8 +85,7 @@ public void testSuccessWithFlowFileContent() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -126,8 +124,7 @@ public void testSuccessAlwaysOutputResponse() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -168,8 +165,7 @@ public void testExceedMaxMessageSize() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); runner.setProperty(InvokeGRPC.PROP_SERVICE_PORT, String.valueOf(port)); @@ -202,8 +198,7 @@ public void testRetry() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -236,9 +231,7 @@ public void testRetryAlwaysOutputResponse() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); - + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); runner.setProperty(InvokeGRPC.PROP_SERVICE_PORT, String.valueOf(port)); @@ -279,8 +272,7 @@ public void testNoRetryOnError() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -312,8 +304,7 @@ public void testNoRetryOnErrorAlwaysOutputResponseAndPenalize() throws Exception final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -356,8 +347,7 @@ public void testNoInput() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class); try { - final int port = TestGRPCServer.randomPort(); - server.start(port); + final int port = server.start(0); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); @@ -411,13 +401,12 @@ public void testSecureTwoWaySsl() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class, sslProperties); try { - final int port = TestGRPCServer.randomPort(); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); + useSSLContextService(runner, sslProperties); + final int port = server.start(0); runner.setProperty(InvokeGRPC.PROP_SERVICE_PORT, String.valueOf(port)); runner.setProperty(InvokeGRPC.PROP_USE_SECURE, "true"); - useSSLContextService(runner, sslProperties); - server.start(port); final MockFlowFile mockFlowFile = new MockFlowFile(SUCCESS); runner.enqueue(mockFlowFile); @@ -455,13 +444,12 @@ public void testSecureOneWaySsl() throws Exception { final TestGRPCServer server = new TestGRPCServer<>(DummyFlowFileService.class, sslProperties); try { - final int port = TestGRPCServer.randomPort(); final TestRunner runner = TestRunners.newTestRunner(InvokeGRPC.class); runner.setProperty(InvokeGRPC.PROP_SERVICE_HOST, TestGRPCServer.HOST); + useSSLContextService(runner, getTruststoreProperties()); + final int port = server.start(0); runner.setProperty(InvokeGRPC.PROP_SERVICE_PORT, String.valueOf(port)); runner.setProperty(InvokeGRPC.PROP_USE_SECURE, "true"); - useSSLContextService(runner, getTruststoreProperties()); - server.start(port); final MockFlowFile mockFlowFile = new MockFlowFile(SUCCESS); runner.enqueue(mockFlowFile); diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestEventIdFirstSchemaRecordReaderWriter.java b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestEventIdFirstSchemaRecordReaderWriter.java index 9c89ab30e213..a6833b44d73d 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestEventIdFirstSchemaRecordReaderWriter.java +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/TestEventIdFirstSchemaRecordReaderWriter.java @@ -63,7 +63,7 @@ public void setup() { journalFile = new File("target/storage/" + UUID.randomUUID().toString() + "/testEventIdFirstSchemaRecordReaderWriter"); tocFile = TocUtil.getTocFile(journalFile); idGenerator.set(0L); - }; + } @Test public void testContentClaimUnchanged() throws IOException { diff --git a/pom.xml b/pom.xml index dfec43226559..3f2d73635e15 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.apache apache - 17 + 18 org.apache.nifi @@ -1679,7 +1679,6 @@ org.apache.maven.plugins maven-compiler-plugin - 3.2 true true @@ -1693,25 +1692,9 @@ 2.9.2-01 true - - org.apache.maven.plugins - maven-war-plugin - 2.5 - - - org.apache.maven.plugins - maven-dependency-plugin - 2.9 - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - org.apache.maven.plugins maven-surefire-plugin - 2.18 true @@ -1731,19 +1714,13 @@ org.apache.maven.surefire surefire-junit4 - 2.18 + ${surefire.version} - - org.apache.maven.plugins - maven-failsafe-plugin - 2.18 - org.apache.maven.plugins maven-assembly-plugin - 2.5.2 gnu @@ -1753,30 +1730,14 @@ jaxb2-maven-plugin 2.3.1 - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - org.apache.maven.plugins - maven-site-plugin - 3.4 - org.codehaus.mojo exec-maven-plugin - 1.3.2 - - - org.apache.maven.plugins - maven-jar-plugin - 2.5 + 1.6.0 org.apache.maven.plugins maven-javadoc-plugin - 2.10.1 false true @@ -1790,7 +1751,6 @@ org.apache.maven.plugins maven-release-plugin - 2.5.1 true apache-release @@ -1815,7 +1775,7 @@ org.codehaus.mojo rpm-maven-plugin - 2.1.4 + 2.1.5 org.codehaus.mojo @@ -1830,12 +1790,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.15 + 2.17 com.puppycrawl.tools checkstyle - 6.5 + 8.5 @@ -1883,7 +1843,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.5 + 1.6.8 true 15 @@ -1951,13 +1911,11 @@ - - - + - + @@ -2013,20 +1971,6 @@ .github/PULL_REQUEST_TEMPLATE.md - - - - org.apache.maven.doxia - doxia-core - 1.6 - - - xerces - xercesImpl - - - - @@ -2079,14 +2023,18 @@ org.apache.maven.plugins maven-checkstyle-plugin - - - check-style - - check - - - + + + check-style + verify + + UTF-8 + + + check + + +