2 Replies Latest reply on Sep 17, 2015 1:50 PM by e965my

    Why do plugin names include "SNAPSHOT"?

    e965my Intermediate

      Hello,

       

      My company is migrating from Jive 6 to Jive 8.  As part of that effort I am rebuilding our plugins.    When the plugin is created the word "SNAPSHOT" it is included in the name, like this:

      "ehi-tac-plugin-8.0.1.0-0-SNAPSHOT.jar"

       

      My expectation was that the plugin be named like this:

      "ehi-tac-plugin"

       

      I am using this document as my guide: How To: Create a Custom Jive Project.  I use this maven command to generate the plugin project:

      mvn -U jive:create-plugin

       

      Here is the top portion of the pom for this plugin.  As you can see, the artifactId is "ehi-tac-plugin"

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <artifactId>ehi-tac-plugin</artifactId>
          <name>ehi-tac-plugin</name>
          <packaging>jar</packaging>
          <url>http://www.jivesoftware.com</url>
      
          <parent>
              <groupId>com.jivesoftware.ehi</groupId>
              <artifactId>hubdev</artifactId>
              <version>8.0.1.0-0-SNAPSHOT</version>
          </parent>
      

       

      Here is the plugin.xml.  You can see that the <name> node is "ehi-tac-plugin"

       

      <plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/2_5/plugin.xsd">
          <name>ehi-tac-plugin</name>
          <description>ehi-tac-plugin</description>
          <author></author>
          <version>${project.version}</version>
          <minServerVersion>${jive.version.min}</minServerVersion>
          <maxServerVersion>${jive.version.max}</maxServerVersion>
          
        <!-- you will want to change your class name here! -->
          <class>com.ehi.plugin.EHITermsAndConditionsPlugin</class>
      
      </plugin>
      

      .

      Thanks a lot in advance,

      Scott Hopkins

       

      cc: Ryan Rutan, Kit Menke, Amber Orenstein, Ryan King

        • Re: Why do plugin names include "SNAPSHOT"?
          cwmenke Novice

          Scott,

          The reason SNAPSHOT is being added to the name of the jar is because by default maven packaging combines artifactId with version: ehi-tac-plugin + 8.0.1.0-0-SNAPSHOT. Both of these are coming from your pom.xml and the version is being pulled from the parent pom's version.

           

          Looks like you can change the final jar name using some config you can add to your pom.xml:

          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <version>2.3.2</version>
              <configuration>
                  <finalName>myJar</finalName>                   
              </configuration>
          </plugin>  
          

          Source: http://stackoverflow.com/a/14490656

          Thanks,

          Kit

          1 person found this helpful
            • Re: Why do plugin names include "SNAPSHOT"?
              e965my Intermediate

              The topic was touched on here too, I just never saw it:

              Jive SBS Maven Archetypes

               

              I modified my plugin pom like this:

               

                  <build>
                      <outputDirectory>${project.build.directory}/classes</outputDirectory>
                      <finalName>ehi-email-plugin</finalName>
                      <plugins>
                          <plugin>
                          ...
              

               

              This also works:

              <finalName>${name}</finalName>

               

              And problem solved.  Thanks a lot Kit!