Github user mmiklavc commented on the issue:

    https://github.com/apache/metron/pull/530
  
    I think I've figured out what's going on with the plugin versions. I was 
under the impression that Maven updated its local metadata on at least a daily 
basis. It would appear that this is not true. I cleaned the archetype libs from 
my local repo multiple times and ran the generate command with subsequent 
output:
    ```
    mvn archetype:generate -DarchetypeCatalog=local
    [INFO] Scanning for projects...
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.4/maven-archetype-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype/2.4/maven-archetype-2.4.pom
 (13 kB at 18 kB/s)
    [INFO]
    [INFO] 
------------------------------------------------------------------------
    [INFO] Building Maven Stub Project (No POM) 1
    [INFO] 
------------------------------------------------------------------------
    [INFO]
    [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > 
generate-sources @ standalone-pom >>>
    [INFO]
    [INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < 
generate-sources @ standalone-pom <<<
    [INFO]
    [INFO]
    [INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ 
standalone-pom ---
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.4/archetype-catalog-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.4/archetype-catalog-2.4.pom
 (1.9 kB at 25 kB/s)
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.4/archetype-models-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.4/archetype-models-2.4.pom
 (2.8 kB at 35 kB/s)
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-descriptor/2.4/archetype-descriptor-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-descriptor/2.4/archetype-descriptor-2.4.pom
 (1.9 kB at 25 kB/s)
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-registry/2.4/archetype-registry-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-registry/2.4/archetype-registry-2.4.pom
 (1.9 kB at 25 kB/s)
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-common/2.4/archetype-common-2.4.pom
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-common/2.4/archetype-common-2.4.pom
 (16 kB at 161 kB/s)
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.4/archetype-catalog-2.4.jar
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-descriptor/2.4/archetype-descriptor-2.4.jar
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-registry/2.4/archetype-registry-2.4.jar
    Downloading: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-common/2.4/archetype-common-2.4.jar
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.4/archetype-catalog-2.4.jar
 (19 kB at 214 kB/s)
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-registry/2.4/archetype-registry-2.4.jar
 (17 kB at 84 kB/s)
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-descriptor/2.4/archetype-descriptor-2.4.jar
 (23 kB at 113 kB/s)
    Downloaded: 
https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-common/2.4/archetype-common-2.4.jar
 (173 kB at 584 kB/s)
    [INFO] Generating project in Interactive mode
    [INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
    Choose archetype:
       Your filter doesn't match any archetype (hint: enter to return to 
initial list)
    Choose a number or apply filter (format: [groupId:]artifactId, case 
sensitive contains):
    ```
    No matter how many times I ran it, it would always return 2.4. Also, the 
Metron archetype wouldn't show up. I would run it in the full dev CentOS vm and 
get 3.0.1 every time. I thought it might be some MacPorts or ZShell weirdness, 
so I tried with Bash and still the same. Then I downloaded a fresh version of 
Maven and ran the binary directly - again, same result. Next, I ran the same 
command while adding the "-U" option for updating snapshots. Per the name, 
you'd think this would only affect snapshots, however here are the results.
    ```
    mvn archetype:generate -DarchetypeCatalog=local                             
                                                                               
<<<
    [INFO] Scanning for projects...
    [INFO]
    [INFO] 
------------------------------------------------------------------------
    [INFO] Building Maven Stub Project (No POM) 1
    [INFO] 
------------------------------------------------------------------------
    [INFO]
    [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > 
generate-sources @ standalone-pom >>>
    [INFO]
    [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < 
generate-sources @ standalone-pom <<<
    [INFO]
    [INFO]
    [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ 
standalone-pom ---
    [INFO] Generating project in Interactive mode
    [INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
    Choose archetype:
    1: local -> org.apache.metron:metron-maven-parser-extension-archetype 
(Apache Maven Parser Extension Archetype for Metron)
    Choose a number or apply filter (format: [groupId:]artifactId, case 
sensitive contains): :
    ```
    The plugin version now resolves to 3.0.1 and our Metron archetype now shows 
up as expected in the list.
    
    @ottobackwards per these findings, we should probably add a note in the 
docs when using the archetype plugin that tells users to pass the "-U" flag. 
Mismatched plugin versions (across the 3.x line) will invariably cause trouble 
due to the changes outlined in the following links:
    
    - 
https://lists.apache.org/thread.html/7f4d65fe71b412afd07eb82dc44aa5b65ba0125ddbc28ad279cd110b@%3Cdev.maven.apache.org%3E
    - https://issues.apache.org/jira/browse/ARCHETYPE-519
    - https://issues.apache.org/jira/browse/ARCHETYPE-438
    
    In summary, the Maven archetype plugin introduced some 
non-backwards-compatible changes in 3.0.0.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to