soulwing / tnm4j

A simplified SNMP API for Java, based on Jürgen Schönwälder's Tnm extension for Tcl.
GNU General Public License v3.0
41 stars 18 forks source link

Can't install with Maven #13

Closed decadence closed 3 years ago

decadence commented 3 years ago
<dependency>
    <groupId>org.soulwing.snmp</groupId>
    <artifactId>tnm4j</artifactId>
    <version>1.0.9</version>
</dependency>

I got this error when I try to build project with Maven:

Failed to execute goal on project Test: Could not resolve dependencies for project com.Test:jar:0.2: Failed to collect dependencies at org.soulwing.snmp:tnm4j:jar:1.0.9 -> org.snmp4j:snmp4j:jar:2.3.3: Failed to read artifact descriptor for org.snmp4j:snmp4j:jar:2.3.3: Could not transfer artifact org.snmp4j:snmp4j:pom:2.3.3 from/to oosnmp (https://oosnmp.net/dist/release): Transfer failed for https://oosnmp.net/dist/release/org/snmp4j/snmp4j/2.3.3/snmp4j-2.3.3.pom: Certificate for <oosnmp.net> doesn't match any of the subject alternative names: [morewap.com, www.morewap.com].

Can you help with this?

MaximilianMitterrutzner commented 3 years ago

It seems to be a problem with the version of one of the dependencies of tnm4j, namely snmp4j. To fix this issue, you have to follow these steps:

  1. Execute "mvn install", which will try to load all the dependencies.
  2. Navigate to the current user directory (On Windows it will probably be "C:\Users[USERNAME]").
  3. Open the ".m2"-Folder and navigate to the path "org/soulwing/snmp/tnm4j/1.0.9/".
  4. Open the file "tnm4j-1.0.9.pom" in a text editor of your choice.
  5. In this file you now have to search for the dependency with the groupId "org.snmp4j" and the artifactId "snmp4j". Here you will have to change the version from "2.3.3" to "2.8.0". This is because maven is searching for the dependencies in it's central repository, but there the version "2.3.3" does not exist anymore, so we'll have to use a newer one. You could also try to select any other than "2.8.0", but this one is the only one I tried.
  6. After saving the file return to your project and run "mvn install" again. It should work now.
ceharris commented 3 years ago

At the root of all of this was the (misguided) decision by Frank Fock to try run his own Maven repository for snmp4j. That ill-fated journey seems to have run its course, as there are now snmp4j artifacts in Maven Central. I'll update the pom and cut a new release based on a later version of snmp4j.

ceharris commented 3 years ago

Looks like 2.8.4 is the latest version that is API compatible with Tnm4j, so we'll go to that version next.

ceharris commented 3 years ago

Resolved in tnm4j 1.0.10