这可能是一个愚蠢的问题,但不知怎的,我无法弄明白(即使有很多已经给出的stackoverflow答案)如何做到这一点:
mvn package
,可以用java -jar
... 执行jar文件,一切正常.mvn exec:java
在命令行上调用maven命令(比如或类似的东西),Maven将从远程存储库下载jar文件并执行它.独立于用户所在的当前目录.我怎么做?目前,我收到的错误消息是我需要在一个包含现有pom.xml文件的目录中.
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<groupId>handof.nod</groupId>
<artifactId>clirunnertest</artifactId>
<version>1.0</version>
<name>CLIRunnerTest</name>
<description>Kleines Testprogramm um zu testen wie Spring Boot auf der Command Line funktioniert</description>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Package as an executable jar/war -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>target/clirunnertest-1.0.jar</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud) 我对Docker完全陌生,我尝试从“入门”教程中运行示例图像。
我的操作系统是Windows 10 Home(64位),我使用Docker Toolbox进行安装。我创建了3个文件,就像演示程序告诉我的那样,然后将内容复制到其中,以避免键入错误。当我使用docker run -p 4000:80 friendlyhello启动映像时
似乎没有问题,但是当我尝试使用localhost:4000在浏览器中连接时,浏览器(Google Chrome最实际的版本)告诉我localhost拒绝连接。即使使用Microsoft Edge,也会出现相同的错误。
我还尝试使用一项持续的规则更改Windows防火墙,以允许docker-engine.exe所有端口使用,但并没有帮助。
有没有人给我提示如何解决这个问题?我真的很想让示例运行:-)
链接到入门示例:https: //docs.docker.com/get-started/part2/#pull-and-run-the-image-from-the-remote-repository
更新:似乎我安装了错误版本的OracleVM VirtualBox,并且由于错误而导致默认VM的启动无法正常工作。我安装了较新的版本,然后再次启动默认图像,它可以正常工作。
使用以下命令启动Docker容器后:docker run -d -p 4000:80 friendlyhello
我能够通过端口4000在VirtualBox内调用演示应用程序:
不幸的是,这使我完全不知道docker应该如何工作:-/。我以为在运行docker之后,我将能够在Windows OS上访问它,因为这只是另一个过程,但是现在看来我仍然需要虚拟机?有人可以向我解释一下我目前所缺少的吗?
我是 jenkins 的新手,我尝试根据教程构建一个声明性管道。在页面上:https : //jenkins.io/doc/book/pipeline/syntax/#matrix-cell-directives 有一个关于如何使用我尝试过的矩阵构建管道的示例。
不幸的是,我收到以下错误:
WorkflowScript: 32: Unknown stage section "matrix". Starting with version 0.5, steps in a stage must be in a ‘steps’ block. @ line 32, column 5.
stage ('Deploy NB') {
^
WorkflowScript: 32: Expected one of "steps", "stages", or "parallel" for stage "Deploy NB" @ line 32, column 5.
stage ('Deploy NB') {
Run Code Online (Sandbox Code Playgroud)
我在 jenkinsfile 中的管道如下所示:lib 中的函数肯定没有任何问题,因为它们在其他几个运行时没有问题的 jenkinsfile 中使用。
pipeline {
agent {
node {
label ""
// Location of the output files …
Run Code Online (Sandbox Code Playgroud)