NIFI-7069: Add groovy-dateutil module to scripting bundles

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #4021.
This commit is contained in:
Matthew Burgess 2020-01-27 15:14:42 -05:00 committed by Pierre Villard
parent 37ef10e6fb
commit 04fae9cb5f
No known key found for this signature in database
GPG Key ID: BEE1599F0726E9CD
6 changed files with 49 additions and 1 deletions

View File

@ -47,6 +47,21 @@ The following binary components are provided under the Apache Software License v
Licensed under the Creative Commons Attribution Licence v2.5
http://creativecommons.org/licenses/by/2.5/
(ASLv2) Groovy Dateutil
The following NOTICE information applies:
Groovy Language
Copyright 2003-2018 The respective authors and developers
Developers and Contributors are listed in the project POM file
and Gradle build file
This product includes software developed by
The Groovy community (http://groovy.codehaus.org/).
This product bundles icons from the famfamfam.com silk icons set
http://www.famfamfam.com/lab/icons/silk/
Licensed under the Creative Commons Attribution Licence v2.5
http://creativecommons.org/licenses/by/2.5/
(ASLv2) Apache Ant
The following NOTICE information applies:
Copyright 1999-2018 The Apache Software Foundation

View File

@ -53,6 +53,12 @@
<version>${nifi.groovy.version}</version>
<scope>provided</scope>
</dependency>
<!-- groovy-all does not include groovy-dateutil by default, so must explicitly include it here -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-dateutil</artifactId>
<version>${nifi.groovy.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>

View File

@ -19,6 +19,9 @@ if (flowFile == null) {
context?.yield();
}
else {
// Try to parse a date here, will fail after Groovy 2.5.0 if groovy-dateutil is not included
Date.parse('yyyyMMdd', '20190630')
flowFile = session.putAttribute(flowFile, "from-content", "test content")
session.transfer(flowFile, REL_SUCCESS)
}

View File

@ -47,6 +47,21 @@ The following binary components are provided under the Apache Software License v
Licensed under the Creative Commons Attribution Licence v2.5
http://creativecommons.org/licenses/by/2.5/
(ASLv2) Groovy Dateutil
The following NOTICE information applies:
Groovy Language
Copyright 2003-2018 The respective authors and developers
Developers and Contributors are listed in the project POM file
and Gradle build file
This product includes software developed by
The Groovy community (http://groovy.codehaus.org/).
This product bundles icons from the famfamfam.com silk icons set
http://www.famfamfam.com/lab/icons/silk/
Licensed under the Creative Commons Attribution Licence v2.5
http://creativecommons.org/licenses/by/2.5/
(ASLv2) Apache Ant
The following NOTICE information applies:
Copyright 1999-2018 The Apache Software Foundation

View File

@ -145,6 +145,12 @@
<artifactId>groovy-xml</artifactId>
<version>${scripting.groovy.version}</version>
<scope>provided</scope>
</dependency>
</dependency>
<!-- groovy-all does not include groovy-dateutil by default, so must explicitly include it here -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-dateutil</artifactId>
<version>${scripting.groovy.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -40,6 +40,9 @@ class GroovyProcessor implements Processor {
void onScheduled(ProcessContext context) {
// Set the attribute value for use in onTrigger
setAttributeFromThisInOnScheduled = 'test content'
// Try to parse a date here, will fail after Groovy 2.5.0 if groovy-dateutil is not included
Date.parse('yyyyMMdd', '20190630')
}
void onStopped(ProcessContext context) {