- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用 gitlab CI 来构建和运行我的测试。
我使用默认的 .gitlab-ci.yml:
# This file is a template, and might need editing before it works on your project.
---
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#
# This template will build and test your projects as well as create the documentation.
#
# * Caches downloaded dependencies and plugins between invocation.
# * Verify but don't deploy merge requests.
# * Deploy built artifacts from master branch only.
# * Shows how to use multiple jobs in test stage for verifying functionality
# with multiple JDKs.
# * Uses site:stage to collect the documentation for multi-module projects.
# * Publishes the documentation for `master` branch.
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# Because some enforcer rules might check dependency convergence and class duplications
# we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
.validate: &validate
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS test-compile'
# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify: &verify
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS verify site site:stage'
except:
- master
# Validate merge requests using JDK7
validate:jdk7:
<<: *validate
image: maven:3.3.9-jdk-7
# Validate merge requests using JDK8
validate:jdk8:
<<: *validate
image: maven:3.3.9-jdk-8
# Verify merge requests using JDK7
verify:jdk7:
<<: *verify
image: maven:3.3.9-jdk-7
# Verify merge requests using JDK8
verify:jdk8:
<<: *verify
image: maven:3.3.9-jdk-8
# For `master` branch run `mvn deploy` automatically.
# Here you need to decide whether you want to use JDK7 or 8.
# To get this working you need to define a volume while configuring your gitlab-ci-multi-runner.
# Mount your `settings.xml` as `/root/.m2/settings.xml` which holds your secrets.
# See https://maven.apache.org/settings.html
deploy:jdk8:
# Use stage test here, so the pages job may later pickup the created site.
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS deploy site site:stage'
only:
- master
# Archive up the built documentation site.
artifacts:
paths:
- target/staging
image: maven:3.3.9-jdk-8
pages:
image: busybox:latest
stage: deploy
script:
# Because Maven appends the artifactId automatically to the staging path if you did define a parent pom,
# you might need to use `mv target/staging/YOUR_ARTIFACT_ID public` instead.
- mv target/staging public
dependencies:
- deploy:jdk8
artifacts:
paths:
- public
only:
- master
当我运行管道时,它失败并收到以下错误:
2288 [错误] 您指定的目标需要一个项目来执行,但此目录 (/builds/IceCristall/the-great-triggering) 中没有 POM。请验证您从正确的目录调用 Maven。 -> [帮助1]org.apache.maven.lifecycle.MissingProjectException:您指定的目标需要一个项目来执行,但此目录中没有 POM (/builds/IceCristall/the-great-triggering)。请验证您从正确的目录调用了 Maven。
这是完整的日志:
Running with gitlab-runner 11.2.0-rc2 (1644837a)
on docker-auto-scale ed2dce3a
Using Docker executor with image maven:3.3.9-jdk-8 ...
Pulling docker image maven:3.3.9-jdk-8 ...
Using docker image sha256:9997d8483b2fc521a4159feab922546dda0c5c22b5084f86dfab48f123ae4364 for maven:3.3.9-jdk-8 ...
Running on runner-ed2dce3a-project-7913048-concurrent-0 via runner-ed2dce3a-srm-1534626556-3eb27695...
Cloning repository...
Cloning into '/builds/IceCristall/the-great-triggering'...
Checking out e41a61bd as master...
Skipping Git submodules setup
Checking cache for default...
FATAL: file does not exist
Failed to extract cache
$ mvn $MAVEN_CLI_OPTS test-compile
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /usr/share/maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.14.48-coreos-r2", arch: "amd64", family: "unix"
2053 [INFO] Error stacktraces are turned on.
2152 [INFO] Scanning for projects...
2252 [INFO] ------------------------------------------------------------------------
2253 [INFO] BUILD FAILURE
2253 [INFO] ------------------------------------------------------------------------
2254 [INFO] Total time: 0.133 s
2254 [INFO] Finished at: 2018-08-18T21:12:14+00:00
2286 [INFO] Final Memory: 6M/56M
2287 [INFO] ------------------------------------------------------------------------
2288 [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/builds/IceCristall/the-great-triggering). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/builds/IceCristall/the-great-triggering). Please verify you invoked Maven from the correct directory.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:84)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
2299 [ERROR]
2299 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2299 [ERROR]
2299 [ERROR] For more information about the errors and possible solutions, please read the following articles:
2300 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
ERROR: Job failed: exit code 1
当我正确理解此日志时,该项目是从路径下的 Docker 容器中的我的存储库复制的:/builds/IceCristall/the-great-triggering
现在执行mvn命令并没有找到pom.xml
我有点困惑,因为 pom.xml 位于“the-great-triggering”文件夹中。
此外,我找不到可以在 ci 配置文件中定义此路径的位置。
有人对问题所在以及我可以在哪里搜索它有建议吗?
最佳答案
错误消息显示:“此目录 (/builds/IceCristall/the-great-triggering) 中没有 POM。”。您确定已提交 pom.xml 文件并将其推送到存储库的所需分支吗?
关于java - Gitlab:您指定的目标需要一个项目来执行,但该目录中没有POM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51912817/
我正在使用 Maven 3.x,我的父 pom 和子 pom 中有以下结构。 父类 com.mygoogle.sample workorder 1.0-SNAPSHOT pom 1.0-SN
我已将各个项目中的所有存储库配置重构为一个父 pom,该父 pom 是为了对存储库和分发管理等内容进行单点配置的特定目的而创建的。据我了解,这应该是最佳实践。将我的父 pom 部署到 Nexus 服务
我尝试使用 mvn help:effective-pom 命令在示例应用程序上生成有效的 pom。 http://books.sonatype.com/mvnref-book/reference/po
在一个项目中,我们有一个名为时间戳的属性,它没有在父 POM 和子 POM 中定义,但仍然可以在 pom.xml 中访问。任何线索将不胜感激。 最佳答案 它可以由插件设置(如 https://www.
我在使用“uploadArchives”上传存档时收到“无法初始化 POM pom-default.xml:无法验证 POM”。我也尝试了 maven-publish 插件,但仍然没有成功。我们将不胜
我创建了一个程序,使用 HTML5 canvas 绘制一个 pom pom,参数大小、x、y、蓬松度和颜色。 pom pom 是通过从中心出来的画线创建的,参数蓬松度决定了从中心出来的股数。我有一个确
我正在关注maven的教程。我有一个非常简单的项目,里面有几个模块。在模块 pom 上,我想通过 ${parent.groupid} 和 ${parent.version} 引用主项目 pom 版本和
当我构建我的项目时,我收到以下警告: [INFO] ------------------------------------------------------------------------ [
我正在尝试构建一个 Maven 项目。我的其他团队成员能够毫无问题地构建它。我收到以下错误: [WARNING] The POM for org.hectorclient:hector-core:ja
我目前正在为 Maven 苦苦挣扎:我有一个由几个嵌套模块组成的复杂项目,对于其中一些模块,我在 POM 中有类似的配置。 我想让它干净。实际上,我想定义一个“runnable-jar”通用配置并在某
我正在将 maven Artifact 推送到 nexus,对于版本号小于子 POM 的父 POM 是否有任何影响? 最佳答案 据我所知没有。多模块项目中的模块版本可能以任何可能的方式有所不同。但是,
我在 Eclipse (Helios) 中有一个项目,带有 Maven pom.xml。我的项目是一个将使用 Hibernate、MySQL 的 Web 应用程序。 但是我在正确处理 pom.xml
repository我的 build.grade 部分已: mavenLocal() //maven { url { 'http://192.168.2
在多模块项目结构中 myApp |-moduleA |---pom.xml |-moduleB |---pom.xml |-pom.xml 如果我在 parent.pom 中有以下属性 4
我为 Maven 插件编写了代码,用于更新 pom 文件中的版本号。但是,当我尝试保存新的 pom 时,它被保存为有效的 pom。有没有办法将其保存为解析之前的样子?谢谢! private Maven
我有一个父 pom 在 pluginManagement 中定义了插件的一些配置项,其中有一个特定的配置。我不想在 child pom 中。 我尝试覆盖我的子 pom 中的其他配置项,这有效,但“删除
我不确定这是否受 Maven 支持。我很感激我能得到的任何帮助。 我有一个定义依赖项和排除项的父 pom。我无法更改父 pom: foo bar 1.0
当前场景: 父pom有一个distributionManagement部分,里面定义了两个repositories(releases和snapshots);引用如下: 父 pom:
似乎有几种方法可以在多项目构建中构建父 pom,我想知道是否有人对每种方式的优点/缺点有任何想法。 拥有父 pom 的最简单方法是将其放在项目的根目录中,即 myproject/ myprojec
我想在我的 Maven 项目中定义一个本地存储库。 我有一个 super pom 和几个子模块。我的文件结构是: /root /repository /child po
我是一名优秀的程序员,十分优秀!