gephi / gephi-plugins

Repository for Gephi Plugins maintained by the team. Each plugin has it's branch.
269 stars 620 forks source link

Impossible to build Maven - Cannot resolve dependency #226

Closed Ephesiel closed 2 years ago

Ephesiel commented 3 years ago

Hi, I forked this git and tried to follow instructions in the README to create my own plugin, but when I run this command :

mvn clean package

I constantly get this error :

[ERROR] Failed to execute goal on project gephi-plugins: Could not resolve dependencies for project org.gephi:gephi-plugins:pom:0.9.2: Failed to collect dependencies at org.gephi:gephi:tar.gz:linux:0.9.2 -> org.netbeans.cluster:platform:pom:RELEASE82: Failed to read artifact descriptor for org.netbeans.cluster:platform:pom:RELEASE82: Could not transfer artifact org.netbeans.cluster:platform:pom:RELEASE82 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [netbeans (http://bits.netbeans.org/nexus/content/groups/netbeans/, default, releases)] -> [Help 1]

I'm new with Maven and issues #77 and #214 didn't help me, I just followed instructions in the README file.

I followed the link given by the error and a blank page with this text appeared :

Repository decommissioned. Please refer to https://netbeans.apache.org/about/oracle-transition.html for more information.

And after clicking the link above, I thought this part was interesting :

As of March the 6th, 2021, we’ll be standing on our own feet, and all the Apache NetBeans Project source and convenience binaries will be hosted by the Apache Infra Team.

And then, a "new" code for handling netbeans repository

<build>
    <repositories>
        <repository>
            <id>netbeans</id>
            <name>NetBeans</name>
            <url>http://netbeans.apidesign.org/maven2/</url>
        </repository>
    </repositories>
<build>

Is that possible that the pom.xml file is not up to date ? Or am I missing something ?

I spoke with someone who already used Maven at the office and he said that none of gephi repositories are working with Maven, all of them display the error.

Thanks for the help !

Ephesiel commented 3 years ago

I finally found a solution by myself and it was quite simple :

The NetBeans repositories have indeed changed, so, in modules/pom.xml :

<repository>
    <id>netbeans</id>
    <name>NetBeans</name>
    <url>http://bits.netbeans.org/nexus/content/groups/netbeans/</url>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
</repository>

We have to change the <url> tag to :

<url>http://netbeans.apidesign.org/maven2/</url>

I did that and it didn't work because my Maven version didn't dupport non secure url repositories (http) and I need to add a "s" in order to make it works.

<url>https://netbeans.apidesign.org/maven2/</url>

For a reason that I don't know, the project still not compile and we have to go to the parent pom.xml on the root folder and add the same NetBeans repository than above.

After doing that it compile.

I don't know if this is normal, but I'm new to Maven and I didn't know : if you want to use some gephi packages in your module (and wou want) you have to add them into module/YourModule/pom.xml in the <dependencies> tag ! Like that :

<dependencies>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>layout-api</artifactId>
        <version>0.9.2</version>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>graph-api</artifactId>
        <version>0.9.2</version>
    </dependency>
    <!-- ... -->
</dependencies>

I tested it with the GridLayout plugin from the Gephi Plugins Bootcamp and it worked.

Ephesiel commented 3 years ago

I don't close the issue : it can be useful to update outdated files (or find a better solution maybe).

yossisp commented 3 years ago

I made a pull request with @Ephesiel changes.

mbastian commented 2 years ago

Hi, since we've moved now to the 0.9.3 base this issue has been resolved. The 0.9.3 base depends on the RELEASE130 version of Netbeans Platform, which is available from Maven central. No more needed to have a Netbeans-specific repository (yah!). Sorry for the long delay!