diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml
index 036926f5e3..8e109d8033 100755
--- a/nifi-assembly/pom.xml
+++ b/nifi-assembly/pom.xml
@@ -48,6 +48,28 @@ language governing permissions and limitations under the License. -->
+
+ org.codehaus.mojo
+ buildnumber-maven-plugin
+ false
+
+
+ validate
+
+ create
+
+
+
+
+ false
+ false
+ 7
+ true
+
+ buildRevision
+ buildBranch
+
+
@@ -630,5 +652,18 @@ language governing permissions and limitations under the License. -->
+
+ build-info-no-git
+
+ false
+
+ ../.git/HEAD
+
+
+
+
+
+
+
diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
index 0242905a7c..554bae55e0 100644
--- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
+++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
@@ -24,9 +24,12 @@ import java.net.InetSocketAddress;
import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -198,6 +201,12 @@ public abstract class NiFiProperties {
// expression language properties
public static final String VARIABLE_REGISTRY_PROPERTIES = "nifi.variable.registry.properties";
+ // build info
+ public static final String BUILD_TAG = "nifi.build.tag";
+ public static final String BUILD_BRANCH = "nifi.build.branch";
+ public static final String BUILD_REVISION = "nifi.build.revision";
+ public static final String BUILD_TIMESTAMP = "nifi.build.timestamp";
+
// defaults
public static final String DEFAULT_TITLE = "NiFi";
public static final Boolean DEFAULT_AUTO_RESUME_STATE = true;
@@ -992,6 +1001,21 @@ public abstract class NiFiProperties {
}
}
+ public Date getBuildTimestamp() {
+ String buildTimestampString = getProperty(NiFiProperties.BUILD_TIMESTAMP);
+ if (!StringUtils.isEmpty(buildTimestampString)) {
+ try {
+ SimpleDateFormat buildTimestampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ Date buildTimestampDate = buildTimestampFormat.parse(buildTimestampString);
+ return buildTimestampDate;
+ } catch (ParseException parseEx) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
public int size() {
return getPropertyKeys().size();
}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java
index 913401b537..c33b6ab144 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/AboutDTO.java
@@ -17,6 +17,7 @@
package org.apache.nifi.web.api.dto;
import com.wordnik.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.web.api.dto.util.DateTimeAdapter;
import org.apache.nifi.web.api.dto.util.TimezoneAdapter;
import javax.xml.bind.annotation.XmlType;
@@ -36,6 +37,11 @@ public class AboutDTO {
private String contentViewerUrl;
private Date timezone;
+ private String buildTag;
+ private String buildRevision;
+ private String buildBranch;
+ private Date buildTimestamp;
+
/* getters / setters */
/**
* The title to be used on the page and in the About dialog.
@@ -113,4 +119,50 @@ public class AboutDTO {
public void setTimezone(Date timezone) {
this.timezone = timezone;
}
+
+ @ApiModelProperty(
+ value = "Build tag"
+ )
+ public String getBuildTag() {
+ return buildTag;
+ }
+
+ public void setBuildTag(String buildTag) {
+ this.buildTag = buildTag;
+ }
+
+ @ApiModelProperty(
+ value = "Build revision or commit hash"
+ )
+ public String getBuildRevision() {
+ return buildRevision;
+ }
+
+ public void setBuildRevision(String buildRevision) {
+ this.buildRevision = buildRevision;
+ }
+
+ @ApiModelProperty(
+ value = "Build branch"
+ )
+ public String getBuildBranch() {
+ return buildBranch;
+ }
+
+ public void setBuildBranch(String buildBranch) {
+ this.buildBranch = buildBranch;
+ }
+
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ @ApiModelProperty(
+ value = "Build timestamp",
+ dataType = "string"
+ )
+ public Date getBuildTimestamp() {
+ return buildTimestamp;
+ }
+
+ public void setBuildTimestamp(Date buildTimestamp) {
+ this.buildTimestamp = buildTimestamp;
+ }
}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java
index 0ff7eadf30..05826fc464 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsSnapshotDTO.java
@@ -23,6 +23,7 @@ import java.util.Set;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.nifi.web.api.dto.util.DateTimeAdapter;
import org.apache.nifi.web.api.dto.util.TimeAdapter;
import com.wordnik.swagger.annotations.ApiModelProperty;
@@ -65,6 +66,8 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable {
private Date statsLastRefreshed;
+ private VersionInfoDTO versionInfo;
+
@ApiModelProperty("Number of available processors if supported by the underlying system.")
public Integer getAvailableProcessors() {
@@ -305,6 +308,14 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable {
this.maxHeapBytes = maxHeapBytes;
}
+ @ApiModelProperty("The nifi, os, java, and build version information")
+ public VersionInfoDTO getVersionInfo() {
+ return versionInfo;
+ }
+
+ public void setVersionInfo(VersionInfoDTO versionInfo) {
+ this.versionInfo = versionInfo;
+ }
@Override
public SystemDiagnosticsSnapshotDTO clone() {
@@ -347,6 +358,8 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable {
gcUsage.add(gcDto.clone());
}
+ other.setVersionInfo(getVersionInfo().clone());
+
return other;
}
@@ -549,4 +562,129 @@ public class SystemDiagnosticsSnapshotDTO implements Cloneable {
return other;
}
}
+
+ /**
+ * Details for version information.
+ */
+ @XmlType(name = "versionInfo")
+ public static class VersionInfoDTO implements Cloneable {
+
+ private String nifiVersion;
+ private String javaVendor;
+ private String javaVersion;
+ private String osName;
+ private String osVersion;
+ private String osArchitecture;
+ private String buildTag;
+ private String buildRevision;
+ private String buildBranch;
+ private Date buildTimestamp;
+
+ @ApiModelProperty("The version of this NiFi.")
+ public String getNiFiVersion() {
+ return nifiVersion;
+ }
+
+ public void setNiFiVersion(String nifiVersion) {
+ this.nifiVersion = nifiVersion;
+ }
+
+ @ApiModelProperty("Java JVM vendor")
+ public String getJavaVendor() {
+ return javaVendor;
+ }
+
+ public void setJavaVendor(String javaVendor) {
+ this.javaVendor = javaVendor;
+ }
+
+ @ApiModelProperty("Java version")
+ public String getJavaVersion() {
+ return javaVersion;
+ }
+
+ public void setJavaVersion(String javaVersion) {
+ this.javaVersion = javaVersion;
+ }
+
+ @ApiModelProperty("Host operating system name")
+ public String getOsName() {
+ return osName;
+ }
+
+ public void setOsName(String osName) {
+ this.osName = osName;
+ }
+
+ @ApiModelProperty("Host operating system version")
+ public String getOsVersion() {
+ return osVersion;
+ }
+
+ public void setOsVersion(String osVersion) {
+ this.osVersion = osVersion;
+ }
+
+ @ApiModelProperty("Host operating system architecture")
+ public String getOsArchitecture() {
+ return osArchitecture;
+ }
+
+ public void setOsArchitecture(String osArchitecture) {
+ this.osArchitecture = osArchitecture;
+ }
+
+ @ApiModelProperty("Build tag")
+ public String getBuildTag() {
+ return buildTag;
+ }
+
+ public void setBuildTag(String buildTag) {
+ this.buildTag = buildTag;
+ }
+
+ @ApiModelProperty("Build revision or commit hash")
+ public String getBuildRevision() {
+ return buildRevision;
+ }
+
+ public void setBuildRevision(String buildRevision) {
+ this.buildRevision = buildRevision;
+ }
+
+ @ApiModelProperty("Build branch")
+ public String getBuildBranch() {
+ return buildBranch;
+ }
+
+ public void setBuildBranch(String buildBranch) {
+ this.buildBranch = buildBranch;
+ }
+
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ @ApiModelProperty("Build timestamp")
+ public Date getBuildTimestamp() {
+ return buildTimestamp;
+ }
+
+ public void setBuildTimestamp(Date buildTimestamp) {
+ this.buildTimestamp = buildTimestamp;
+ }
+
+ @Override
+ public VersionInfoDTO clone() {
+ final VersionInfoDTO other = new VersionInfoDTO();
+ other.setNiFiVersion(getNiFiVersion());
+ other.setJavaVendor(getJavaVendor());
+ other.setJavaVersion(getJavaVersion());
+ other.setOsName(getOsName());
+ other.setOsVersion(getOsVersion());
+ other.setOsArchitecture(getOsArchitecture());
+ other.setBuildTag(getBuildTag());
+ other.setBuildTimestamp(getBuildTimestamp());
+ other.setBuildBranch(getBuildBranch());
+ other.setBuildRevision(getBuildRevision());
+ return other;
+ }
+ }
}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
index 4c1c07c784..c98fbfae35 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/pom.xml
@@ -170,6 +170,13 @@
12 hours
+
+
+ ${project.scm.tag}
+ ${maven.build.timestamp}
+
+ ${buildBranch}
+ ${buildRevision}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
index d34380c3d1..a768af47b9 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/nifi.properties
@@ -195,4 +195,10 @@ nifi.kerberos.spnego.authentication.expiration=${nifi.kerberos.spnego.authentica
# external properties files for variable registry
# supports a comma delimited list of file locations
-nifi.variable.registry.properties=
\ No newline at end of file
+nifi.variable.registry.properties=
+
+# Build info
+nifi.build.tag=${nifi.build.tag}
+nifi.build.branch=${nifi.build.branch}
+nifi.build.revision=${nifi.build.revision}
+nifi.build.timestamp=${nifi.build.timestamp}
\ No newline at end of file
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
index c97bb71289..3119863d30 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/FlowResource.java
@@ -1089,7 +1089,14 @@ public class FlowResource extends ApplicationResource {
aboutDTO.setTimezone(new Date());
// get the content viewer url
- aboutDTO.setContentViewerUrl(getProperties().getProperty(NiFiProperties.CONTENT_VIEWER_URL));
+ final NiFiProperties properties = getProperties();
+ aboutDTO.setContentViewerUrl(properties.getProperty(NiFiProperties.CONTENT_VIEWER_URL));
+
+ // Get build info
+ aboutDTO.setBuildTag(properties.getProperty(NiFiProperties.BUILD_TAG));
+ aboutDTO.setBuildRevision(properties.getProperty(NiFiProperties.BUILD_REVISION));
+ aboutDTO.setBuildBranch(properties.getProperty(NiFiProperties.BUILD_BRANCH));
+ aboutDTO.setBuildTimestamp(properties.getBuildTimestamp());
// create the response entity
final AboutEntity entity = new AboutEntity();
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index 3826b63f8c..39d09e94fe 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -107,6 +107,7 @@ import org.apache.nifi.reporting.BulletinRepository;
import org.apache.nifi.reporting.ReportingTask;
import org.apache.nifi.scheduling.SchedulingStrategy;
import org.apache.nifi.util.FormatUtils;
+import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.util.StringUtils;
import org.apache.nifi.web.FlowModification;
import org.apache.nifi.web.Revision;
@@ -193,6 +194,7 @@ public final class DtoFactory {
private ControllerServiceProvider controllerServiceProvider;
private EntityFactory entityFactory;
private Authorizer authorizer;
+ private NiFiProperties properties;
public ControllerConfigurationDTO createControllerConfigurationDto(final ControllerFacade controllerFacade) {
final ControllerConfigurationDTO dto = new ControllerConfigurationDTO();
@@ -2356,6 +2358,10 @@ public final class DtoFactory {
garbageCollectionDtos.add(createGarbageCollectionDTO(entry.getKey(), entry.getValue()));
}
+ // version info
+ final SystemDiagnosticsSnapshotDTO.VersionInfoDTO versionInfoDto = createVersionInfoDTO();
+ snapshot.setVersionInfo(versionInfoDto);
+
return dto;
}
@@ -2395,6 +2401,21 @@ public final class DtoFactory {
return dto;
}
+ public SystemDiagnosticsSnapshotDTO.VersionInfoDTO createVersionInfoDTO() {
+ final SystemDiagnosticsSnapshotDTO.VersionInfoDTO dto = new SystemDiagnosticsSnapshotDTO.VersionInfoDTO();
+ dto.setNiFiVersion(properties.getUiTitle());
+ dto.setJavaVendor(System.getProperty("java.vendor"));
+ dto.setJavaVersion(System.getProperty("java.version"));
+ dto.setOsName(System.getProperty("os.name"));
+ dto.setOsVersion(System.getProperty("os.version"));
+ dto.setOsArchitecture(System.getProperty("os.arch"));
+ dto.setBuildTag(properties.getProperty(NiFiProperties.BUILD_TAG));
+ dto.setBuildRevision(properties.getProperty(NiFiProperties.BUILD_REVISION));
+ dto.setBuildBranch(properties.getProperty(NiFiProperties.BUILD_BRANCH));
+ dto.setBuildTimestamp(properties.getBuildTimestamp());
+ return dto;
+ }
+
/**
* Creates a ResourceDTO from the specified Resource.
*
@@ -3063,4 +3084,8 @@ public final class DtoFactory {
public void setBulletinRepository(BulletinRepository bulletinRepository) {
this.bulletinRepository = bulletinRepository;
}
+
+ public void setProperties(final NiFiProperties properties) {
+ this.properties = properties;
+ }
}
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
index 7cfe448c2c..bdc042af6c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
@@ -52,6 +52,7 @@
+
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp
index 9024f35b98..0d99aaaf3a 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/about-dialog.jsp
@@ -22,6 +22,17 @@
+
+
+
+
+
+ Tagged
+
+
+ From on branch
+
+
Apache NiFi is a framework to support highly scalable and flexible dataflows.
It can be run on on laptops up through clusters of enterprise class servers.
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp
index 02bcf610db..2b68060cec 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/cluster/cluster-content.jsp
@@ -45,6 +45,9 @@