Я начинаю первую попытку использовать Vert.x в Java. IDE — это Netbeans версии 8.1. Vert.x — версия 3.0.0. Код этого проекта показан ниже. Файл pom.xml также указан ниже. Этот код будет выполняться в среде IDE Netbeans, но сборка (для файла jar) не завершится без ошибки, показанной в ОТЧЕТЕ О СБОРЕ ниже. Таким образом, сгенерированный файл jar не будет выполнен. Я исследовал все ресурсы, которые смог найти в Интернете, и не смог найти адекватного решения/ответа. Я был бы признателен за любую помощь, которую кто-либо может предложить для решения этой проблемы.
Файл POM создается средой IDE Netbeans при создании нового проекта:
Файл — Новый проект - Maven - Проект из Archetype - vertx-java-archetype
Затем я добавил метод main().
ДЕТАЛЬНЫЙ ОТЧЕТ ОБ ОШИБКАХ СТРОКИ:
--- maven-jar-plugin:2.3.2:jar (default-jar) @ mavenproject2 ---
Building jar: C:\Projects\GenMatchJ\mavenproject2\target\mavenproject2-1.0-SNAPSHOT.jar
--- maven-shade-plugin:2.3:shade (default) @ mavenproject2 ---
Including io.vertx:vertx-core:jar:3.0.0 in the shaded jar.
Including io.netty:netty-common:jar:4.0.28.Final in the shaded jar.
Including io.netty:netty-buffer:jar:4.0.28.Final in the shaded jar.
Including io.netty:netty-transport:jar:4.0.28.Final in the shaded jar.
Including io.netty:netty-handler:jar:4.0.28.Final in the shaded jar.
Including io.netty:netty-codec:jar:4.0.28.Final in the shaded jar.
Including io.netty:netty-codec-http:jar:4.0.28.Final in the shaded jar.
Including com.fasterxml.jackson.core:jackson-core:jar:2.5.3 in the shaded jar.
Including com.fasterxml.jackson.core:jackson-databind:jar:2.5.3 in the shaded jar.
Including com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0 in the shaded jar.
Including io.vertx:vertx-web:jar:3.0.0 in the shaded jar.
Including io.vertx:vertx-auth-common:jar:3.0.0 in the shaded jar.
--- exec-maven-plugin:1.3.2:exec (default) @ mavenproject2 ---
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.290s
Finished at: Sun Jun 05 13:01:40 EDT 2016
Final Memory: 30M/313M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (default) on project mavenproject2: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec are missing or invalid -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, p l e a s e r e a d t h e f o l l o w i n g a r t i c l e s : < b r / > [ H e l p 1 ] h t t p : / / c w i k i . a p a c h e . o r g / c o n f l u e n c e / d i s p l a y / M A V E N / P l u g i n P a r a m e t e r E x c e p t i o n < b r / > < / к о д > < b r / > < br />ФАЙЛ POM.XML:
4.0.0
com.ssp
mavenproject2
1.0-SNAPSHOT
jar
io.vertx
vertx-dependencies
3.0.0
pom
import
io.vertx
vertx-core
io.vertx
vertx-web
org.apache.maven.plugins
maven-compiler-plugin
3.3
1.8
1.8
org.apache.maven.plugins
maven-shade-plugin
2.3
package
shade
io.vertx.core.Starter
com.ssp.mavenproject2.Main
META-INF/services/io.vertx.core.spi.VerticleFactory
${project.build.directory}/mavenproject2-${project.version}-fat.jar
org.codehaus.mojo
exec-maven-plugin
1.3.2
verify
exec
io.vertx.core.Starter
${basedir}/src/main/java/
vertx.deployment.options.redeploy
true
vertx.deployment.options.redeployScanPeriod
100
run
com/ssp/mavenproject2/Main.java
MainSsp
Main entry point for SSP Example with embedded Vert.x
ИСХОДНЫЙ КОД:
package com.ssp.mavenproject2;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Vertx;
import javax.swing.JOptionPane;
/**
*
*/
public class Main extends AbstractVerticle {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "This Vert.x/Java integration is UUUGGGGHH tough without documentation...");
// Create an HTTP server which simply returns "Hello World!" to each request.
Vertx.vertx().createHttpServer().requestHandler(req -> req.response().end("Hello World!")).listen(8080);
Vertx.vertx().setPeriodic(3000, res -> {
System.out.println("Periodic event triggered.");
});
try{
Thread.sleep(30000);
}catch(Exception e)
{
System.out.println("Exception caught");
}
}
@Override
public void start() throws Exception {
vertx.setPeriodic(3000, res -> {
System.out.println("Periodic event triggered.");
});
}
}
Подробнее здесь: https://stackoverflow.com/questions/376 ... ec-default
Не удалось выполнить цель org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (по умолчанию) в проекте mavenproject2: ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Не удалось выполнить цель org.codehaus.mojo: jaxb2-maven-plugin: 1.6: xjc (default-cli)
Anonymous » » в форуме JAVA - 0 Ответы
- 3 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Версия с разрешением ошибок для плагина «org.codehaus.mojo:maven-war-plugin» из репозиториев
Anonymous » » в форуме JAVA - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Ошибка разрешения версии для плагина 'org.codehaus.mojo: maven-war-plugin' из репозиториев
Anonymous » » в форуме JAVA - 0 Ответы
- 10 Просмотры
-
Последнее сообщение Anonymous
-