[ 
https://issues.apache.org/jira/browse/NIFI-4930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494569#comment-16494569
 ] 

ASF GitHub Bot commented on NIFI-4930:
--------------------------------------

GitHub user derekstraka opened a pull request:

    https://github.com/apache/nifi-maven/pull/3

    NIFI-4930: Resolve issues when fetching nar files from artifact repos…

    …itories like artifactory
    
    The NAR Maven Plugin 1.2.0 is using artifact.getVersion() to determine the 
Nar-Dependency-Version, however this version number can be a timestamped 
snapshot version number if the dependency was downloaded from a remote repo. 
The Nar-Dependency-Version can then differ from the declared Nar-Version in the 
other JAR.
    
    Signed-off-by: Derek Straka <[email protected]>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/derekstraka/nifi-maven NIFI-4930

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi-maven/pull/3.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3
    
----
commit 40d242edbc8e31d8e26759e98927d71a11c24649
Author: Derek Straka <derek@...>
Date:   2018-05-30T01:33:36Z

    NIFI-4930: Resolve issues when fetching nar files from artifact 
repositories like artifactory
    
    The NAR Maven Plugin 1.2.0 is using artifact.getVersion() to determine the 
Nar-Dependency-Version, however this version number can be a timestamped 
snapshot version number if the dependency was downloaded from a remote repo. 
The Nar-Dependency-Version can then differ from the declared Nar-Version in the 
other JAR.
    
    Signed-off-by: Derek Straka <[email protected]>

----


> Nar-Dependency-Version - timestamped snapshot version problem
> -------------------------------------------------------------
>
>                 Key: NIFI-4930
>                 URL: https://issues.apache.org/jira/browse/NIFI-4930
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Tools and Build
>    Affects Versions: 1.2.0
>            Reporter: Arne Degenring
>            Assignee: Derek Straka
>            Priority: Major
>              Labels: Nar-Maven-Plugin
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> The NAR Maven Plugin 1.2.0 is using artifact.getVersion() to determine the 
> Nar-Dependency-Version, however this version number can be a timestamped 
> snapshot version number if the dependency was downloaded from a remote repo. 
> The Nar-Dependency-Version can then differ from the declared Nar-Version in 
> the other JAR. 
> Suggested Fix in NarMojo.java: use artifact.getBaseVersion() instead of 
> artifact.getVersion():
> Replace line 705:
> narDependency = new NarDependency(artifact.getGroupId(), 
> artifact.getArtifactId(), artifact.getVersion());
> with:
> narDependency = new NarDependency(artifact.getGroupId(), 
> artifact.getArtifactId(), artifact.getBaseVersion());
>  
> --
> Long explanation, from 
> [https://lists.apache.org/thread.html/ce44faa7b1a54aac417fca06200712de629c3bc2ed692813c0a10a73@%3Cusers.nifi.apache.org%3E]
> We have seen a strange problem on NiFi 1.4.0 where custom processors could 
> suddenly not be started, because of incompatibility with custom services:
> 2018-03-02 13:40:35,490 ERROR [main] o.apache.nifi.controller.FlowController 
> Unable to start ...[id=5d57d39a-015c-1000-ffff-ffffd654d90b] due to 
> java.lang.IllegalStateException: Processor ... is not in a valid state due to 
> ...  is invalid because ... - 1.4-SNAPSHOT from ...  is not compatible with 
> ... - 1.4-SNAPSHOT ...]
> It seems that the root cause was related to:
> 2018-03-02 13:39:55,086 WARN [main] org.apache.nifi.nar.NarClassLoaders While 
> loading ...:...:1.5-SNAPSHOT' unable to locate exact NAR dependency 
> '...:...:1.4-20180302.111133-16'. Only found one possible match 
> ...:....:1.4-SNAPSHOT'. Continuing...
> It turned out that our various custom NARs were  built on different built 
> agents.
> Maven has the (ugly) behaviour that when a snapshot version is present in the 
> local repository after local build, the version number will be e.g. 
> 1.4-SNAPSHOT. However if it is downloaded from a remote repository, the 
> version number includes a timestamp such as 1.4-20180302.111133-16.
> So the manifest of the depending NARs contained:
> Nar-Dependency-Version: 1.4-20180302.111133-16
> while the other NAR file declared:
> Nar-Version: 1.4-SNAPSHOT
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to