NIFI-11302 Corrected Registry version retrieval

- Updated Maven JAR plugin configuration for nifi-registry-data-model to include implementation version

This closes #7057

Co-authored-by: David Handermann <exceptionfactory@apache.org>
Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Mark Bean 2023-03-18 10:48:31 -04:00 committed by exceptionfactory
parent f062b0d1f1
commit af3737e670
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
3 changed files with 21 additions and 5 deletions

View File

@ -53,4 +53,21 @@
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.registry;
package org.apache.nifi.registry.about;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@ApiModel
public class RegistryAbout {
private String registryAboutVersion;
private final String registryAboutVersion;
/**
* Container for the version string of this Registry.

View File

@ -19,8 +19,7 @@ package org.apache.nifi.registry.web.api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Authorization;
import org.apache.nifi.registry.NiFiRegistryApiApplication;
import org.apache.nifi.registry.RegistryAbout;
import org.apache.nifi.registry.about.RegistryAbout;
import org.apache.nifi.registry.event.EventService;
import org.apache.nifi.registry.web.service.ServiceFacade;
import org.springframework.beans.factory.annotation.Autowired;
@ -56,7 +55,7 @@ public class RegistryAboutResource extends ApplicationResource {
response = RegistryAbout.class
)
public Response getVersion() {
final String implVersion = NiFiRegistryApiApplication.class.getPackage().getImplementationVersion();
final String implVersion = RegistryAbout.class.getPackage().getImplementationVersion();
final RegistryAbout version = new RegistryAbout(implVersion);
return Response.status(Response.Status.OK).entity(version).build();
}