I`m using the sample plugin provided by graylog2 to develop a notification plugin by myself. When I run “mvn package”, it shows a build error, related to not being able to locate a dependency:
$ mvn package
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects…
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.graylog.plugins:graylog-plugin-snmp-notification:jar:1.0.0-SNAPSHOT
[WARNING] ‘dependencies.dependency.(groupId:artifactId:type:classifier)’ must be unique: com.google.auto.value:auto-value:jar -> version ${auto-value.version} vs 1.2 @ line 90, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[WARNING] The project org.graylog.plugins:graylog-plugin-snmp-notification:jar:1.0.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] --------< org.graylog.plugins:graylog-plugin-snmp-notification >--------
[INFO] Building graylog-plugin-snmp-notification 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.graylog:graylog-project:jar:3.2.0-beta.4-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.090 s
[INFO] Finished at: 2020-03-04T10:31:10-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project graylog-plugin-snmp-notification: Could not resolve dependencies for project org.graylog.plugins:graylog-plugin-snmp-notification:jar:1.0.0-SNAPSHOT: Failure to find org.graylog:graylog-project:jar:3.2.0-beta.4-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
=====================================
When I try to use plugin install inside IntelliJ, it shows this message:
Failure to find org.graylog:graylog-project:jar:3.2.0-beta.4-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced
====================================
This is my current pom.xml file for the described plugin:
<parent>
<groupId>org.graylog.plugins</groupId>
<artifactId>graylog-plugin-web-parent</artifactId>
<version>3.2.0-beta.4-SNAPSHOT</version>
<relativePath>../graylog2-server/graylog-plugin-parent/graylog-plugin-web-parent</relativePath>
</parent>
<artifactId>graylog-plugin-snmp-notification</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>Graylog ${project.artifactId} plugin.</description>
<url>https://www.graylog.org</url>
<developers>
<developer>
<name>null</name>
<email>null</email>
</developer>
</developers>
<scm>
<connection>scm:git:git@github.com:snmpRepo.git</connection>
<developerConnection>scm:git:git@github.com:snmpRepo.git</developerConnection>
<url>https://github.com/snmpRepo</url>
<tag>HEAD</tag>
</scm>
<properties>
<maven.source.skip>true</maven.source.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.site.skip>true</maven.site.skip>
<graylog.version>3.2.0-beta.4-SNAPSHOT</graylog.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<graylog2.version>2.0.3</graylog2.version>
<graylog2.plugin-dir>/usr/share/graylog-server/plugin</graylog2.plugin-dir>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<version>4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.snmp4j</groupId>
<artifactId>snmp4j</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>${auto-value.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>${auto-service.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.graylog</groupId>
<artifactId>graylog-project</artifactId>
<version>${graylog.version}</version>
</dependency>
<dependency>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.graylog2</groupId>
<artifactId>graylog2-server</artifactId>
<version>3.2.0-beta.4-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${web.build-dir}</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Graylog-Plugin-Properties-Path>${project.groupId}.${project.artifactId}</Graylog-Plugin-Properties-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<mavenExecutorId>forked-path</mavenExecutorId>
<tagNameFormat>@{project.version}</tagNameFormat>
<preparationGoals>clean test</preparationGoals>
<goals>package</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessors>
<annotationProcessor>com.google.auto.value.processor.AutoValueProcessor</annotationProcessor>
<annotationProcessor>com.google.auto.service.processor.AutoServiceProcessor</annotationProcessor>
</annotationProcessors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<artifactSet>
<excludes>
<exclude>com.google.guava:guava</exclude>
<exclude>com.fasterxml.jackson.core:*</exclude>
<exclude>org.apache.httpcomponents:httpclient</exclude>
<exclude>joda-time:joda-time</exclude>
<exclude>commons-codec:commons-codec</exclude>
<exclude>com.google.protobuf:protobuf-java</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
===============================
Am I importing or describing any dependency in a wrong way?
This problem is giving me headeaches for almost 3 days. Any help is much appreciated.