Dependencies outside of Apache NiFi must not use SNAPSHOT versions - apache-nifi

I'm new to NiFi and I'm trying to develop my first custom processor.
I'm following documentation(s)/tutorial(s) on how to create one, and here I am:
generated maven skeleton project for nifi-processor; (✔)
added some simple implementation in the onTrigger(...) method; (✔)
failing to build .nar. (x)
Whenever I'm executing mvn clean package either within any sub-directory of the custom processor project structure (nifi-artifactBaseName-nar or nifi-artifactBaseName-processors) or in the root directory of the project, I get this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-maven-version) on project nifi-myfirstcustomrprocessor-nar:
[ERROR] Rule 3: org.apache.maven.enforcer.rules.dependency.RequireReleaseDeps failed with message:
[ERROR] Dependencies outside of Apache NiFi must not use SNAPSHOT versions
[ERROR] com.giorgi.tutorials:nifi-myfirstcustomrprocessor-nar:nar:1.0-SNAPSHOT
[ERROR] com.giorgi.tutorials:nifi-myfirstcustomrprocessor-processors:jar:1.0-SNAPSHOT <--- is not a release dependency
Anything I'm doing wrong? any help?

Solved.
When creating a custom processor project (or just any maven project), version 1.0-SNAPSHOT is generated by default (disregarding of whether you create it from command-line, IDE, or etc.), and that's NOT OK for NiFi custom processor - you should NOT use SNAPSHOT for versioning your custom processor artifact.
I just changed 1.0-SNAPSHOT to 1.0 and everything worked fine - .nar has been built.

Related

maven release without scm/vcs

I want to build a release version of my spring application with maven without the use of scm or ANY OTHER version control system - All I want is to build an application ready to be served via tomcat. While this sounds simple, it seems impossible for me to achieve.
I already tried options like suppressCommitBeforeTag / remoteTagging / pushChanges / dryRun directly via the command line
mvn -DremoteTagging=false -DsuppressCommitBeforeTag=true -DpushChanges=false release:prepare or by setting inside the pom.xml in the corresponding plugin configuration.
No matter what I do, I always get
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:3.0.0-M1:prepare
(default-cli) on project eStore: Missing required setting: scm
connection or developerConnection must be specified.
How can I completely deactivate version control / remote tagging when releasing?

We have a case where there are multiple projects configured in sonar. All the project have different modules with same names?

We have a case where there are multiple projects configured in sonar. All the project have different modules with same names.
With this, as and when we execute sonar for one of the project, the execution is getting terminated with below error.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project XXX: Module "XXXX" is already part of project "YYYY" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project XXXX: Module "YYYY" is already part of project "YYYY"
It seems that because the module name is same , Sonar is terminating the execution. Note that we are using sonar version 4.5.5 and facing this issue. While earlier we were using sonar version 4.1.1 and with that version the execution was successful (probably sonar was overriding earlier report with the newer one in case of conflicting module name).
Please suggest possible solution for this? Thanks,
Complete error log is available here
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/sonarqube/-L7cby77-28/6L6zPlb6AAAJ
I think you need to rename you modules like if your project is abc.
Please change your modules like abc_xxx etc...it may work for you
Have you tried using the project name property?
In a pom.xml file:
<sonar.projectName>Some project name here</sonar.projectName>

How to release Maven project using Jenkins

When I am trying to release a Maven project using Jenkins, I am getting an error like this:
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project maven-plugin: You don't have a SNAPSHOT project in the reactor projects list.
The error message means that the project (or one of its submodules) is not a SNAPSHOT project, i.e. it's version is not [version]-SNAPSHOT but only [version].
You cannot release a project that is not a SNAPSHOT project so you need to change the version of your pom.xml to include -SNAPSHOT.

SonarQube scan failing with "is already part of project XXX error is already part of project"

Recently I upgraded sonarqube from 4.0 to 4.3.3. Post upgrade when I try to run the maven build I am getting the error:
Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.4:sonar (default-cli) on project xxx on project yyy Module "abc.def.xyz" is already part of project of other project.
The issue is we scan on multiple branches so we will have modules with the same name.
Is there a way to turn off this validation?
Assume you have multiple modules Maven project with below structure:
com.company:project
com.company:project-module1
com.company:project-module2
In your java source code, now "com.company:project" renamed to "com.company:myProject", so new java source strucutre becomes:
com.company:myProject
com.company:project-module1
com.company:project-module2
When you build new source and push analysis data to Sonar, it prompt:
[ERROR] Failed to execute goal
org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
(default-cli) on project myProject: Module
"com.company:project-module1" is already part of project
"com.company:project" -> [Help 1]
This error is because the "com.company:project-module1" already executed and registered into Sonar before and now it belongs to "com.company:project" project whihc no longer exist in your source code anymore.
Solution:
In Sonar project configuration --> Update key, change the project "com.company:project" key from "com.company:project" to "com.company:myProject", rerun Maven build and push to Sonar, issue will solve.

Maven gives this project has disliked artifacts error when using Jung dependency

I have a Java project where I want to make some calls to a Jung library. I added the following lines to the pom.xml
net.sf.jung
jung-algorithms
2.0.1
However when I run "mvn package", I get the following error
[ERROR] Failed to execute goal licensing-maven-plugin:1.
7.5:check (enforce-licensing-oss) on project server-examples: This project
has 3 disliked artifacts. -> [Help 1]
Any insights as to what may be going wrong ?
You have configured the licensing-maven-plugin to complain when you introduce a dependency with certain licenses. You, or whoever wrote your pom. If you read the configuration for that plugin it will tell you what licenses it is configured to like and dislike.

Resources