Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-13773 Made nifi-nar-maven-plugin capable of handling different v… #39

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,23 +239,25 @@ private Artifact getProvidedArtifact(final String groupId, final String artifact
private ExtensionClassLoader createProvidedEntitiesClassLoader(final ArtifactsHolder artifactsHolder)
throws MojoExecutionException, ProjectBuildingException {

final Set<Artifact> providedArtifacts = new HashSet<>();

final String nifiApiVersion = determineProvidedEntityVersion(artifactsHolder.getAllArtifacts(), "org.apache.nifi", "nifi-api");
if (nifiApiVersion == null) {
throw new MojoExecutionException("Could not find any dependency, provided or otherwise, on [org.apache.nifi:nifi-api]");
} else {
getLog().info("Found a dependency on version " + nifiApiVersion + " of NiFi API");
}

final String slf4jApiVersion = determineProvidedEntityVersion(artifactsHolder.getAllArtifacts(),"org.slf4j", "slf4j-api");

final Artifact nifiApiArtifact = getProvidedArtifact("org.apache.nifi", "nifi-api", nifiApiVersion);
final Artifact nifiFrameworkApiArtifact = getProvidedArtifact("org.apache.nifi", "nifi-framework-api", nifiApiArtifact.getVersion());
providedArtifacts.add(nifiApiArtifact);

final Artifact slf4jArtifact = getProvidedArtifact("org.slf4j", "slf4j-api", slf4jApiVersion);
final String nifiFrameworkApiVersion = determineProvidedEntityVersion(artifactsHolder.getAllArtifacts(),"org.apache.nifi", "nifi-framework-api");
if (nifiFrameworkApiVersion != null) {
final Artifact nifiFrameworkApiArtifact = getProvidedArtifact("org.apache.nifi", "nifi-framework-api", nifiFrameworkApiVersion);
providedArtifacts.add(nifiFrameworkApiArtifact);
}

final Set<Artifact> providedArtifacts = new HashSet<>();
providedArtifacts.add(nifiApiArtifact);
providedArtifacts.add(nifiFrameworkApiArtifact);
final String slf4jApiVersion = determineProvidedEntityVersion(artifactsHolder.getAllArtifacts(),"org.slf4j", "slf4j-api");
final Artifact slf4jArtifact = getProvidedArtifact("org.slf4j", "slf4j-api", slf4jApiVersion);
providedArtifacts.add(slf4jArtifact);

getLog().debug("Creating Provided Entities Class Loader with artifacts: " + providedArtifacts);
Expand Down