这看起来应该是一件小事。但我无法弄清楚我应该做什么。我是Maven/Spark的新手。经过四处搜寻,仔细查看文档以及没有。我无法弄清楚如何启动我的火花应用程序?Java Spark框架,部署失败
我按照本指南在Intellij中设置。 https://sparktutorials.github.io/2015/04/02/setting-up-a-spark-project-with-maven.html
我可以运行所有的maven任务,除了部署。
部署失败,此错误。
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project framework: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [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.
我不确定这件事是否重要?部署旨在启动服务器的任务?我不确定。
的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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.krishollenbeck.framework</groupId>
<artifactId>framework</artifactId>
<version>1.0</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
</project>
这是DOCS说什么。
如何启动服务器?当您做某些事情需要启动服务器时(即 声明路由或设置端口),服务器将自动启动 。您也可以通过调用init()来手动启动服务器 。
http://sparkjava.com/documentation.html#stopping-the-server
好吗?那是什么意思?通常有一些命令或某些东西来启动服务器。
问题:TL; DR
如何启动火花服务器?
偏离主题的其他排序:
是火花仍然保持?这是一个糟糕的框架使用?我正在寻找一个轻量级的java服务器。大多数应用逻辑将被处理客户端。只需要处理服务器端的一些基本的登录/ CRUD内容。并构建一些宁静的API。
项目结构:(FYI)
嗯..也许这是我错误的原因。我实际上遇到了intellij的一个问题。它一直试图使用1.5进行编译。即使在我把所有东西都改为1.8之后。 –
仍然使用''尝试运行部署时出现同样的错误 –
因为部署阶段需要在部署maven插件文档中所述的pom中的分发管理部分 – Adonis