You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by trixpan <gi...@git.apache.org> on 2016/09/11 15:54:57 UTC

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

GitHub user trixpan opened a pull request:

    https://github.com/apache/nifi/pull/1004

    NIFI-2756 - Add displayName to maven archetypes

    @alopresto Would you mind having a look on this PR?
    
    I am not familiar with maven archetypes but I noticed that the ones we have seem to result in code lacking some of the present practices such as having displayName, including * imports, unused classes, etc.
    
    This PR tries to address that.
    
    Cheer
    


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

    $ git pull https://github.com/trixpan/nifi NIFI-2756

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

    https://github.com/apache/nifi/pull/1004.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 #1004
    
----
commit 7f4436286713dcbb303114eeb5f1fd8fc8ef9799
Author: Andre F de Miranda <tr...@users.noreply.github.com>
Date:   2016-09-11T15:49:01Z

    NIFI-2756 - Add displayName to maven archetypes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/1004


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r80064941
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -41,7 +51,8 @@
     public class MyProcessor extends AbstractProcessor {
     
         public static final PropertyDescriptor MY_PROPERTY = new PropertyDescriptor
    -            .Builder().name("My Property")
    +            .Builder().name("MY_PROPERTY")
    --- End diff --
    
    Hmmmm... luckily you are democratic enough to review my code with those ugly capital letters used on "friendly" names. :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r79869457
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -29,9 +28,20 @@
     import org.apache.nifi.annotation.documentation.SeeAlso;
     import org.apache.nifi.annotation.documentation.Tags;
     import org.apache.nifi.processor.exception.ProcessException;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.ProcessorInitializationContext;
    +import org.apache.nifi.processor.Relationship;
     import org.apache.nifi.processor.util.StandardValidators;
     
    -import java.util.*;
    +
    +
    +        import java.util.ArrayList;
    --- End diff --
    
    Bit of extra whitespace here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r79869437
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -19,7 +19,6 @@
     import org.apache.nifi.components.PropertyDescriptor;
     import org.apache.nifi.components.PropertyValue;
     import org.apache.nifi.flowfile.FlowFile;
    -import org.apache.nifi.processor.*;
    --- End diff --
    
    Thank you for removing this!! Makes an initial compile much cleaner :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on the issue:

    https://github.com/apache/nifi/pull/1004
  
    @bbende mind sharing the steps you took? Keen to try to reproduce and fix.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r80064544
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -19,7 +19,6 @@
     import org.apache.nifi.components.PropertyDescriptor;
     import org.apache.nifi.components.PropertyValue;
     import org.apache.nifi.flowfile.FlowFile;
    -import org.apache.nifi.processor.*;
    --- End diff --
    
    welcome


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by mattyb149 <gi...@git.apache.org>.
Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r79869645
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -41,7 +51,8 @@
     public class MyProcessor extends AbstractProcessor {
     
         public static final PropertyDescriptor MY_PROPERTY = new PropertyDescriptor
    -            .Builder().name("My Property")
    +            .Builder().name("MY_PROPERTY")
    --- End diff --
    
    Not that it matters, but most of the time I see machine-friendly names I've been seeing them like "my-processor-my-property" vs "MY_PROPERTY". Since it's a placeholder here, then no big deal, just sharing :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1004#discussion_r80066292
  
    --- Diff: nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java ---
    @@ -29,9 +28,20 @@
     import org.apache.nifi.annotation.documentation.SeeAlso;
     import org.apache.nifi.annotation.documentation.Tags;
     import org.apache.nifi.processor.exception.ProcessException;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.ProcessorInitializationContext;
    +import org.apache.nifi.processor.Relationship;
     import org.apache.nifi.processor.util.StandardValidators;
     
    -import java.util.*;
    +
    +
    +        import java.util.ArrayList;
    --- End diff --
    
    addressed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by trixpan <gi...@git.apache.org>.
Github user trixpan commented on the issue:

    https://github.com/apache/nifi/pull/1004
  
    @bbende hopefully the second commit should address your feedback. 
    
    May I ask you to test and if ok, merge into master?
    
    Kind regards


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #1004: NIFI-2756 - Add displayName to maven archetypes

Posted by bbende <gi...@git.apache.org>.
Github user bbende commented on the issue:

    https://github.com/apache/nifi/pull/1004
  
    @trixpan sure...
    
    1) mvn clean install on this branch
    
    2) In some other directory:
    
    `mvn archetype:generate -DarchetypeGroupId=org.apache.nifi -DarchetypeArtifactId=nifi-processor-bundle-archetype -DarchetypeVersion=1.1.0-SNAPSHOT -DnifiVersion=1.1.0-SNAPSHOT -DarchetypeCatalog=local`
    
    3) Fill in something like groupId org.apache.nifi, artifactId displaytest-bundle, basename displaytest
    
    4) Try to build the generated project using mvn clean install -Pcontrib-check
    
    5) Repeat with service archetype:
    
    `mvn archetype:generate -DarchetypeGroupId=org.apache.nifi -DarchetypeArtifactId=nifi-service-bundle-archetype -DarchetypeVersion=1.1.0-SNAPSHOT -DnifiVersion=1.1.0-SNAPSHOT -DarchetypeCatalog=local`
    
    For additional reference:
    https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---