Plugin development with Maven

Extensions and customization
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
jonny_wray
Posts:2
Joined:22 May 2012 17:14
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Plugin development with Maven

Post by jonny_wray » 22 May 2012 17:24

Hi,

I'm starting to develop a plugin and want to integrate with the rest of our development process and so use Maven as a build tool. I'm attempting to use the nbm Maven plugin to produce an nbm file that I can then use to load as a plugin.

I'm got my project set up with a simple example plugin using the bootcamp as a starting point. It's compiling fine but I'm having an issue with packaging and dependencies. Here's my relevant Maven section.

Code: Select all


    <dependencies>

        <!-- Netbeans API that forms the basis for Gephi plugin integration -->
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-api-annotations-common</artifactId>
            <version>RELEASE712</version>
        </dependency>

        <!-- Gephi libraries and extension points -->
        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>toolkit</artifactId>
            <version>0.8.5</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>
If I leave the scope of the toolkit as provided the nbm packages up fine but I get runtime class not found exceptions when I attempt to load the plugin. If I remove the scope = provided I get the error:

Code: Select all

[ERROR] Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.7:manifest (default-manifest) on project library-gephi-metrics: Module dependency has friend
 dependency on org.openide.utilbut is not listed as friend. -> [Help 1]
It's obviously a Netbeans dependency resolution issue to do with the toolkit and it's friends but I don't know enough about Netbeans to go any further.

Has anyone had any success with this approach? Anything I'm missing?

thanks,
Jonny

jonny_wray
Posts:2
Joined:22 May 2012 17:14
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Plugin development with Maven

Post by jonny_wray » 23 May 2012 15:27

To answer my own question, the Maven issue can be overcome by not using the toolkit jar but instead using individual jars that are included in the modules section of the bootcamp/platform/gephi directory. The specific versions and group/artifact IDs are extracted from StatisticsPluginExample/nbproject/project.xml, although of course you could use any values as long as the jars match up with the Maven repository location.

This would be a lot easier if there were Gephi Maven artifacts available, and you'd get automated dependency resolution.

Again, if anyone has pointers to better way of doing this I'd be happy to hear them.

For reference, here's the relevant section of my resultant pom.

Code: Select all


        <dependency>
            <groupId>org.codeartisans.thirdparties.swing</groupId>
            <artifactId>org-openide-util-lookup</artifactId>
            <version>8.3.1</version>
        </dependency>

        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>data-attributes-api</artifactId>
            <version>0.8.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>graph-api</artifactId>
            <version>0.8.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.gephi</groupId>
            <artifactId>statistics-api</artifactId>
            <version>0.8.1.1</version>
        </dependency>
Jonny

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Plugin development with Maven

Post by mbastian » 08 Jun 2012 07:23

I'm working on converting Gephi to Maven and publish the artifacts on a repository. I was stuck by a Netbeans Platform 7.1 bug for a while it has been fixed... Stay tuned

dhalbert
Posts:1
Joined:02 Jan 2013 21:58
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Plugin development with Maven

Post by dhalbert » 02 Jan 2013 23:27

Reviving this topic:

Hi - is there a mavenized version of gephi-plugins available yet? Or, if you have your own mavenized plugins branch, would you be willing to share it?

Thanks,
Dan

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable