Fail upload jar into github with maven - java

I try to follow : Hosting a Maven repository on github
My POM.xml
<parent>
<artifactId>rf</artifactId>
<groupId>com.zlhades</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>rfcore</artifactId>
<properties>
<java-version>1.7</java-version>
<github.global.server>github</github.global.server>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message> <!-- git commit message -->
<noJekyll>true</noJekyll> <!-- disable webpage processing -->
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above -->
<branch>refs/heads/mvn-repo</branch> <!-- remote branch name -->
<includes><include>**/*</include></includes>
<repositoryName>RequestForward</repositoryName> <!-- github repo name -->
<repositoryOwner>zlhades</repositoryOwner> <!-- github username -->
</configuration>
<executions>
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
</dependencies>
And I got below error:
=========================log==========================
[ERROR] Failed to execute goal
com.github.github:site-maven-plugin:0.12:site (default) on project
rfcore: Error creating commit: Invalid request.
[ERROR] For 'properties/name', nil is not a string.
[ERROR] For 'properties/name', nil is not a string. (422)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal com.github.github:site-maven-plugin:0.12:site (default)
on project rfcore: Error creating commit: Invalid request.
For 'properties/name', nil is not a string.
For 'properties/name', nil is not a string. (422)
=========================log==========================
How to fix this issue?

Thx, I found the answer:
The comment at the bottom of this post suggests that you need to have filled in the Real Name field in your github profile to avoid this error.
https://malalanayake.wordpress.com/2014/03/10/create-simple-maven-repository-on-github/

Related

Building Maven Project : Giving compilation Error

I am new to Java/Maven, and I am trying to build a maven Spring Boot project, it was earlier working and was successfully creating jar package as well. But it suddenly stopped working and started giving Maven Compile error.
I know it has something to do with the pom.xml file. My best guess : Some changes in this file has caused it to fail.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.loanglide</groupId>
<artifactId>drools-helloworld</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>drools-helloworld</name>
<description>Springboot application</description>
<properties>
<maven.compiler.source>12.0.1</maven.compiler.source>
<maven.compiler.target>12.0.1</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<kie.version>6.1.0.Final</kie.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>1.1.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<version>6.1.0.Final</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.28</version>
<exclusions>
<exclusion>
<groupId>freemarker<!-- Legacy org-less group --></groupId>
<artifactId>freemarker</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</build>
</project>
Error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.905 s
[INFO] Finished at: 2019-08-08T01:52:48+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project springboot-helloworld: Fatal error compiling: error: invalid target release: 12.0.1 -> [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/MojoExecutionException
Java Version
java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)
I have tried many stackoverflow answer to similar question, but still not able to resolve this issue.
If you are using Java 12, add the following to Maven pom.xml.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>12</release>
</configuration>
</plugin>
The properties maven.compiler.source and maven.compiler.target are used by many plugins on default lifecycle, as compiler, as you can see at this answer.
You must try:
<properties>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
</properties>
But if you want to override only this goal, you can configure it like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>12</release>
</configuration>
</plugin>
As you are new with Java, keep in mind the new versioning schema so even you have installed the 12 version you can target the 11 LTS target if no new language feature is intended to be used.

exec-maven-plugin how to set mainClass in pom.xml when using DynamoDBLocal [duplicate]

This question already has answers here:
run main class of Maven project [duplicate]
(2 answers)
Closed 3 years ago.
I am new to Maven and am struggling to find the right way to ask this question (since I doubt the problem is specific to DynamoDBLocal).
I am attempting to start a REST server using Jersey with Grizzly servlet, but mvn exec:java is failing because I can't figure out how to specify mainClass. For my unit tests, I'm using in-memory DynamoDBLocal to mock the database. I am also hoping in the short term to use DynamoDBLocal as the actual database while running the REST server (just during proof-of-concept stages) just to not spend money on AWS until I'm ready to serve some traffic.
When running mvn exec:java, I get the following failure:
$ mvn exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) # my-app ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.436 s
[INFO] Finished at: 2019-03-17T16:49:52-07:00
[INFO] Final Memory: 14M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project my-app: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or invalid -> [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/PluginParameterException
pom.xml (ctrl+f "HELP"):
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<properties>
<jacoco.threshold.class>1.00</jacoco.threshold.class>
<jacoco.threshold.method>0.90</jacoco.threshold.method>
<jacoco.threshold.instruction>0.80</jacoco.threshold.instruction>
<jacoco.threshold.line>0.80</jacoco.threshold.line>
<jacoco.threshold.branch>0.80</jacoco.threshold.branch>
<jacoco.threshold.complexity>0.80</jacoco.threshold.complexity>
<dependencies.jersey2.version>2.28</dependencies.jersey2.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<!--
Sqlite4java is needed by DynamoDB Local, but argLine is also needed by JaCoCo.
See JaCoCo help links:
1. https://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec
2. https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
3. https://stackoverflow.com/questions/23190107/cannot-use-jacoco-jvm-args-and-surefire-jvm-args-together-in-maven
-->
<argLine>-Dsqlite4java.library.path=${basedir}/lib/sqlite4java ${argLine}</argLine>
</configuration>
</plugin>
<!--
JaCoCo setup tutorial # https://automationrhapsody.com/automated-code-coverage-of-unit-tests-with-jacoco-and-maven/
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<configuration>
<excludes>
<exclude>**/config/*.class</exclude>
<exclude>**/exceptions/*.class</exclude>
<exclude>**/models/**/*.class</exclude>
</excludes>
</configuration>
<executions>
<!-- Prepares the property pointing to the JaCoCo runtime agent. -->
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- Create the index.html report file in target/site/ dir. -->
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<!-- Enforce code coverage -->
<execution>
<id>jacoco-check</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>CLASS</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.class}</minimum>
</limit>
<limit>
<counter>METHOD</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.method}</minimum>
</limit>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.instruction}</minimum>
</limit>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.line}</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.branch}</minimum>
</limit>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>${jacoco.threshold.complexity}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.16</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-dynamodb -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-dynamodb</artifactId>
<version>1.11.349</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<!-- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html#DynamoDBLocal.Maven -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>DynamoDBLocal</artifactId>
<version>1.11.119</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin -->
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
</dependency>
<!-- JAX-RS -->
<!-- from https://howtodoinjava.com/jersey/jersey-2-hello-world-application-tutorial/ -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
</dependency>
<!-- Jersey with Grizzly servlet -->
<!-- From https://jersey.github.io/documentation/latest/getting-started.html-->
<!-- Benchmark from 2016 shows Grizzly is (neglibly) the best - https://menelic.com/2016/01/06/java-rest-api-benchmark-tomcat-vs-jetty-vs-grizzly-vs-undertow/ -->
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>${dependencies.jersey2.version}</version>
</dependency>
<dependency> <!-- Idk what this is? -->
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${dependencies.jersey2.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.tngtech.java/junit-dataprovider -->
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<version>1.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<!-- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html#DynamoDBLocal.Maven -->
<repository>
<id>dynamodb-local-oregon</id>
<name>DynamoDB Local Release Repository</name>
<url>https://s3-us-west-2.amazonaws.com/dynamodb-local/release</url>
</repository>
</repositories>
<profiles>
<profile>
<id>start-dynamodb-local</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<executable>java</executable>
<arguments>
<argument>-cp</argument>
<classpath/>
<argument>-Dsqlite4java.library.path=${basedir}/target/dependencies</argument>
<argument>com.amazonaws.services.dynamodbv2.local.main.ServerRunner</argument>
<argument>-inMemory</argument>
<argument>-port</argument>
<argument>8000</argument>
</arguments>
<!-- HELP: Do I add mainClass here? -->
<!-- <mainClass>com.pathto.mymainclass.Main</mainClass> -->
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- HELP: Do I add mainClass within a new profile here? -->
</project>
I've tried searching SO for how/where to add mainClass but I haven't found something similar enough to my pom, nor have I been able to understand how maven/pom works to figure out how to make this work.
I should also add: mvn package succeeds in running all of my tests, including one that runs the Grizzly server on port 8080 and connects to it from the RESTful client:
import java.net.URI;
import javax.ws.rs.client.ClientBuilder;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
/**
* Validate that server dependencies successfully run a server on our local port and we can connect to it via HTTP client.
*/
public class ServerTest {
private static final String BASE_URI = "http://localhost:8080/rest/v1/";
private HttpServer httpServer;
#Before
public void startServer() {
ResourceConfig resourceConfig = new ResourceConfig().packages("com.pathto.mycontrollers");
httpServer = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), resourceConfig);
}
#After
public void stopServer() {
httpServer.shutdownNow();
}
#Test
public void test() {
// There is a simple class com.pathto.mycontrollers.HealthController that just responds saying "healthy"
String healthResponse = ClientBuilder.newClient()
.target(BASE_URI)
.path("health")
.request()
.get(String.class);
Assert.assertEquals("healthy", healthResponse);
}
}
#Fridge honestly not sure coz I'm still pretty new around here, but I'll leave this here anyways :)
Take a look at: run main class of Maven project

Could not resolve dependencies for my Maven project

I am trying to create a program that will use the sikulix libraries. So I copy pasted the dependencies from https://mvnrepository.com/artifact/com.sikulix/sikulixapi/1.1.2. Then I ran mvn install to install the libraries and I got this error
[ERROR] Failed to execute goal on project auto-fish: Could not resolve dependencies for project com.bine:auto-fish:jar:1.0: Could not find artifact com.github.vidstige:jadb:jar:-v1.0-g94ebf38-23 in central (https://repo.maven.apache.org/maven2)
After doing some research I realized I may need to add a repositories tag with the sikulixapi repo. That gave me this error.
[ERROR] Failed to execute goal on project auto-fish: Could not resolve dependencies for project com.bine:auto-fish:jar:1.0: Could not find artifact com.github.vidstige:jadb:jar:-v1.0-g94ebf38-23 in Sikulix Repo (https://mvnrepository.com/artifact/com.sikulix/sikulixapi)
At this point I am unsure as to what I should do. This is my first every Maven project.
`
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.bine</groupId>
<artifactId>auto-fish</artifactId>
<version>1.0</version>
<name>auto-fish</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>Sikulix Repo</id>
<url>https://mvnrepository.com/artifact/com.sikulix/sikulixapi</url>
</repository>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
`
The code is split up but note that they are all in the pom file for my maven project. Also the first 5 lines aren't not showing up for some reason but I feel like they are not important. And i'm using Vs code for all this.
And if you're wondering the goal of this is to create something that will play some dumb fishing game for me, but this is more of a test to see if I can pull it off rather than something I actually need lol.
If you look at your vidstige artifact in mvnrepository.com, you'll see it lists "Mulesoft" as the only repo that contains it. Following that link shows https://repository.mulesoft.org/nexus/content/repositories/public/ as the optional repository URL you should be adding, not the mvnrepository URL you added which was just a link to the mvnrepository search engine results.
So in short, this should hopefully work:
<repository>
<id>Mulesoft Repo</id>
<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
</repository>
Note I'm unfamiliar with this repository, so if it requires any kind of authentication or licensing you would want to follow up with instructions from that repo owner.
Alternatively you can skip the dependency download using exclusion.
Since i am not aware of your source code. I am just suggesting this solution
<dependency>
<exclusions>
<exclusion>
<groupId>com.github.vidstige</groupId>
<artifactId>jadb</artifactId>
</exclusion>
</exclusions>
</dependency>
Solution found from LaunchPad

Maven compilation failure but no java error

I'm developing an editor plug-in in Eclipse Neon. The project is separated into a parent project, managing it's dependencies and a child project, which contains the actual source code. After migrating my plug-in from Eclipse Mars to Neon, I changed the method IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true); to IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true);, because the first one is deprecated now. If I try to rebuild the project with Maven, it gives me a compilation failure:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project language-editor-core: Compilation failure: Compilation failure:
[ERROR] C:\Users\X\Documents\tfeditor\language-editor-core\src\main\java\de\se_rwth\langeditor\texteditor\hyperlinks\HyperlinkDetectorImpl.java:[228]
[ERROR] IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true);
[ERROR] ^^^^^^^^^^^^^^^^^^^
[ERROR] The method getEditorDescriptor(String, boolean) in the type IDE is not applicable for the arguments (String, boolean, boolean)
[ERROR] 1 problem (1 error)
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :language-editor-core
The pom.xml of the parent project is this one:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.monticore</groupId>
<artifactId>language-editor</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Language Editor</name>
<organization>
<name>Department of Software Engineering, RWTH Aachen University</name>
<url>http://www.se-rwth.de/</url>
</organization>
<packaging>pom</packaging>
<modules>
<module>language-editor-core</module>
<module>cdtrans-editor</module>
<module>matrans-editor</module>
<module>language-editor-updatesite</module>
</modules>
<properties>
<monticore.version>4.5.0</monticore.version>
<monticoreRuntime.version>4.5.0</monticoreRuntime.version>
<cd4a.version>1.3.7-SNAPSHOT</cd4a.version>
<cd4a-trans.version>0.0.3-SNAPSHOT</cd4a-trans.version>
<typestrans.version>0.0.3-SNAPSHOT</typestrans.version>
<literalstrans.version>0.0.3-SNAPSHOT</literalstrans.version>
<tfruntime.version>4.4.0-SNAPSHOT</tfruntime.version>
<odrules.version>4.4.0-SNAPSHOT</odrules.version>
<secommons.version>1.7.7</secommons.version>
<antlr.version>4.5</antlr.version>
<guava.version>18.0</guava.version>
<matrans.version>0.0.2.E-SNAPSHOT</matrans.version>
<macommontrans.version>0.0.2-SNAPSHOT</macommontrans.version>
<tycho.version>0.22.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<wagon.version>1.0</wagon.version>
<compiler.plugin>3.3</compiler.plugin>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-utilities</artifactId>
<version>${secommons.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticoreRuntime.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4analysis</artifactId>
<version>${cd4a.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>cd4a-trans</artifactId>
<version>${cd4a-trans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>literalstrans</artifactId>
<version>${literalstrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>typestrans</artifactId>
<version>${typestrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.runtime</artifactId>
<version>${tfruntime.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>de.monticore.tf.odrules</artifactId>
<version>${tfruntime.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>matrans</artifactId>
<version>${matrans.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.tf</groupId>
<artifactId>macommontrans</artifactId>
<version>${macommontrans.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>de.se_rwth.eclipse</groupId>
<artifactId>de.se_rwth.eclipse.targetplatform.luna</artifactId>
<version>1.0.2-SNAPSHOT</version>
</artifact>
</target>
<pomDependencies>consider</pomDependencies>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>${wagon.version}</version>
<executions>
<execution>
<id>deploy-repository</id>
<phase>deploy</phase>
<goals>
<goal>upload-single</goal>
</goals>
<configuration>
<fromFile>${project.build.directory}/${project.build.finalName}.zip</fromFile>
<serverId>se-nexus</serverId>
<url>https://nexus.se.rwth-aachen.de/service/local/repositories/monticore-snapshots/content-compressed</url>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<repository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-releases/</url>
</repository>
<snapshotRepository>
<id>se-nexus</id>
<url>http://nexus.se.rwth-aachen.de/content/repositories/monticore-snapshots/</url>
</snapshotRepository>
<site>
<id>se-nexus</id>
<url>dav:http://nexus.se.rwth-aachen.de/content/sites/se-sites/monticore/${project.version}/</url>
</site>
</distributionManagement>
<repositories>
<repository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>se-public</id>
<url>http://nexus.se.rwth-aachen.de/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</project>
The specific line in the code is not marked as wrong by Eclipse and the execution of the code also works well, so where is the problem?
Indeed, after adding the Eclipse Neon repository to the pom.xml with this:
<repositories>
<repository>
<id>eclipse-neon</id>
<url>http://download.eclipse.org/releases/neon</url>
<layout>p2</layout>
</repository>
</repositories>
, the Maven build works and does not mark the editorDescriptor = IDE.getEditorDescriptor(storage.getName(), true, true); as an error -> Problem solved
do a
mvn clean
and try to build once more

Maven-plugin-plugin default-descriptor error message after upgrade to 3.1.1

I am upgrading my system's Maven runtime from 3.0.5 to 3.1.1 and trying to build my project using mvn clean install like I normally would. Using the older Maven runtime, the build would always succeed. However, I am now always getting this error message during the build:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project XYZ: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor failed: 48188 -> [Help 1]
I thought that perhaps it was due to my dependencies and plugins being outdated, so I ran mvn versions:use-latest-versions to update my pom.xml versions. That still did not fix this issue. Any ideas?
UPDATE
By popular demand, here is what my pom.xml file looks like. Note that all dependency and plugin versions were updated by mvn versions:use-latest-versions except for Sitebricks and qdox, due to breaking changes that I didn't want to integrate into my project.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.company</groupId>
<artifactId>my-own-project</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>My Cool Maven Plugin</name>
<packaging>maven-plugin</packaging>
<distributionManagement>
<repository>
<id>someID</id>
<url>http://some.url.com</url>
</repository>
</distributionManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.20</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.11</version>
</dependency>
<dependency>
<groupId>com.google.sitebricks</groupId>
<artifactId>sitebricks</artifactId>
<version>0.8.5</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<effort>Max</effort>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</reporting>
</project>
Upgrading and using below dependency with config resolved my issue:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
I had exactly the same problem and tried probably every hint provided in the possible duplicate Basic maven plugin project not working, Mojo plugin descriptors not generating, but nothing worked. Eventually in turned out that an old version 2.6.1 of the library com.ibm.icu:icu4j that was used by some other 3rd party module was responsible. I got rid of the icu4j dependency entirely and maven-plugin-plugin run with out problems thereafter.

Categories