5 Replies Latest reply on Jan 27, 2015 8:11 AM by Thomas Segismont

    Maven RHQ Plugin

    Gareth Healy Newbie

      I've recently added the RHQ plugin to my POMs to validate the plugin xml. See below:

       

      <build>
        <plugins>
        <plugin>
        <groupId>org.rhq.maven.plugins</groupId>
        <artifactId>rhq-agent-plugin-plugin</artifactId>
         <!-- Tell Maven that this plugin will extend the standard lifecycle and packaging -->
        <!-- Without this the build fails to recognize the custom packaging -->
         <extensions>true</extensions>
        <configuration>
        <archive>
        <manifest>
        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
        </manifest>
        <manifestEntries>
        <Maven-Version>${maven-version}</Maven-Version>
        <Java-Version>${java.version}</Java-Version>
        <Java-Vendor>${java.vendor}</Java-Vendor>
        <Os-Name>${os.name}</Os-Name>
        <Os-Arch>${os.arch}</Os-Arch>
        <Os-Version>${os.version}</Os-Version>
        </manifestEntries>
        </archive>
        </configuration>
        <executions>
        <execution>
        <id>validate</id>
        <phase>package</phase>
        <goals>
        <goal>validate</goal>
        </goals>
        <configuration>
        <rhqVersion>${rhq-version}</rhqVersion>
        </configuration>
        </execution>
        </executions>
        </plugin>
        </plugins>
      </build>

       

      The problem is, when i build i get the following exception:

       

      [main] DEBUG Sigar  - no libsigar-universal64-macosx.dylib in java.library.path

      org.hyperic.sigar.SigarException: no libsigar-universal64-macosx.dylib in java.library.path

        at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)

        at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Class.java:191)

        at org.rhq.core.system.SystemInfoFactory.initialize(SystemInfoFactory.java:289)

        at org.rhq.core.system.SystemInfoFactory.createSystemInfo(SystemInfoFactory.java:213)

        at org.rhq.core.pc.plugin.PluginManager.createPluginContext(PluginManager.java:350)

        at org.rhq.core.pc.plugin.PluginManager.loadPlugin(PluginManager.java:308)

        at org.rhq.core.pc.plugin.PluginManager.<init>(PluginManager.java:178)

        at org.rhq.core.pc.plugin.PluginValidator.validatePlugins(PluginValidator.java:108)

        at org.rhq.core.pc.plugin.PluginValidator.main(PluginValidator.java:93)

      [WARN] SystemInfoFactory - Native library not available on this platform: java.lang.reflect.InvocationTargetException:null -> org.hyperic.sigar.SigarException:no libsigar-universal64-macosx.dylib in java.library.path

       

      The build doesn't fail, but i want to understand how i can get rid of the error, as it will be picked up by someone in the future.

       

      I've tried running maven as per:

       

      mvn clean install -Djava.library.path=/Users/garethah/Documents/github/garethahealy/jon-plugins/lib/

       

      With the lib folder containing:

       

      localhost:lib garethah$ ls -lrt

      total 1528

      -rw-r--r--@ 1 garethah  staff  397440 26 Jan 11:21 libsigar-universal64-macosx.dylib

      -rw-r--r--@ 1 garethah  staff  377668 26 Jan 11:22 libsigar-universal-macosx.dylib

       

      But that doesn't change anything. Any ideas?