我有一个最近工作并正确部署的 Maven 构建,但现在无法部署。据我所知,构建设置和 pom.xml 都没有改变。(我对成功和失败文件夹的 pom 进行了比较,它们是相同的;假设文件夹尚未更新。)
Maven 构建的平衡能够部署。我对所有项目使用相同的模板,以及相同的 settings.xml 文件。
构建成功完成,然后事情变得很奇怪。我查看了 TeamCity 中两个版本的日志,除了失败(此时退出)之外,命令似乎相同。
我注意到的事情:
- Artifactory 中的失败日志消息发出
mkdir
命令, - 然后稍后警告期待一个目录但找到一个文件,
- 搜索那个短语,我找到了异常类。
FolderExpectedException
为神器。 - 在失败之前,TeamCity 中的日志看起来是一样的。
- 其他 Maven 构建(使用相同的构建模板和 settings.xml 文件)成功部署。
- 我对成功和失败的 pom 进行了比较,没有任何区别。
- 目前,我没有来自 Artifactory 的成功日志;不过,我将在机器上进行挖掘,看看是否可以找到较旧的日志。
- 在构建代理的两个工作目录中(成功与否),jar 位于
target/mylib.jar
- 最大唯一快照设置为 0,所以我认为这与这个较旧的错误无关。
- 如果我将快照从 libs-snapshot-local 移到黑名单存储库并尝试再次部署...它将创建
5-6-0-SNAPSHOT
根文件夹,但随后会创建与 jar 和 pom 命名相同的空子文件夹!但是 TeamCity 中 target/mylib.jar 中的工件绝对是一个 jar 文件。 - TeamCity 8.0.4 内部版本 27616;神器 3.0.1 修订版 30008
- TeamCity 最近从 8.0.2 升级,当时部署工作正常。我没有尝试回滚它,但是基于相同构建模板的其他构建正在成功部署,所以我认为不是这样,但这可能是接下来要检查的事情。
- 工件路径(来自常规设置)是:
**/*.jar
- 运行它的帐户是域帐户,并且没有被锁定。它可以完全控制每台构建机器上的 TeamCity Build Agent 目录。
问题:
- 我还能寻找什么?
- 有什么我可以尝试改变的吗?
- 我能做些什么来导出 TeamCity 在成功构建和失败构建中看到的所有内容吗?
TeamCity 日志 - 成功
[Step 1/1] Publishing artifacts
[Publishing artifacts] Collecting files to publish:
[E:\TCBuildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.xml.gz
=> .teamcity]
[Publishing artifacts] Sending
E:/TCBuildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz
[Step 1/1] Deploying artifacts to http://myserver.com:8081/artifactory
[Step 1/1] Deploying artifact:
http://myserver.com:8081/artifactory/libs-snapshot-local/
com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar
[11:07:24][Step 1/1] Deploying artifact:
http://myserver.com:8081/artifactory/libs-snapshot-local/
com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.pom
[11:07:27][Step 1/1] Deploying build info ...
[11:07:27][Step 1/1] Deploying build info to:
http://myserver.com:8081/artifactory/api/build
TeamCity 日志 - 失败
[Step 1/1] Publishing artifacts
[Publishing artifacts] Collecting files to publish:
[E:\TCBuildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.xml.gz =>
.teamcity]
[Publishing artifacts] Sending
E:/TCBuildAgent/temp/buildTmp/.tc-maven-bi/maven-build-info.xml.gz
[Step 1/1] Deploying artifacts to http://myserver.com:8081/artifactory
[Step 1/1] Deploying artifact:
http://myserver.com:8081/artifactory/libs-snapshot-local/
com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar
[Step 1/1] Error deploying artifact:
E:\TCBuildAgent\work\2e99f45d5745c8fa\target\mylib.jar. Skipping
deployment of remaining artifacts (if any) and build info.
Artifactory log - 失败 -注意mkdir -p
jar上的命令
2013-10-08 18:00:23,718 [http-bio-8081-exec-1424] [INFO ]
(o.a.e.UploadServiceImpl:263) - MKDir request to
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
2013-10-08 18:00:23,734 [http-bio-8081-exec-1424] [WARN ]
(o.a.s.f.l.SessionLockEntry:111) - Mutable item
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
has local modifications that will be discarded.
2013-10-08 18:00:23,734 [http-bio-8081-exec-1424] [ERROR]
(o.a.w.s.RepoFilter :206) - Sending HTTP error code 500: Expected a folder
but found a file, at:
libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar
2013-10-08 18:00:23,734 [http-bio-8081-exec-1425] [INFO ]
(o.a.e.UploadServiceImpl:263) - MKDir request to
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
2013-10-08 18:00:23,749 [http-bio-8081-exec-1425] [WARN ]
(o.a.s.f.l.SessionLockEntry:111) - Mutable item
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
has local modifications that will be discarded.
2013-10-08 18:00:23,749 [http-bio-8081-exec-1425] [ERROR]
(o.a.w.s.RepoFilter :206) - Sending HTTP error code 500: Expected a folder
but found a file, at:
libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar
相关的 pom.xml 条目 %<-- snip:
<groupId>com.company.myapp</groupId>
<artifactId>mylib</artifactId>
<version>5.6.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mylib</name>
<properties>
<maven.build.timestamp.format>yyyy.MM.dd:HH.mm</maven.build.timestamp.format>
<main.package>com.company.myapp</main.package>
<build.time>${maven.build.timestamp}</build.time>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ciassets</id>
<name>ciassets-snapshots</name>
<url>http://myserver.com:8081/artifactory/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
Artifactory 创建目录而不是 poms 时的日志文件:
2013-10-08 19:12:19,198 [http-bio-8081-exec-1454] [INFO ]
(o.a.e.UploadServiceImpl:263) - MKDir request to
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
2013-10-08 19:12:19,214 [http-bio-8081-exec-1454] [INFO ]
(o.a.e.UploadServiceImpl:269) - Directory
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.jar'
was created successfully.
2013-10-08 19:12:19,448 [http-bio-8081-exec-1454] [INFO ]
(o.a.e.UploadServiceImpl:263) - MKDir request to
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.pom'
2013-10-08 19:12:19,464 [http-bio-8081-exec-1454] [INFO ]
(o.a.e.UploadServiceImpl:269) - Directory
'libs-snapshot-local:com/company/myapp/mylib/5.6.0-SNAPSHOT/mylib-5.6.0-SNAPSHOT.pom'
was created successfully.
2013-10-08 19:12:19,682 [http-bio-8081-exec-1454] [INFO ]
(o.a.r.r.c.BuildResource:280) - Adding build
'Java Stack :: My App - branch 5.6.0/ #9_412'
2013-10-08 19:12:19,792 [http-bio-8081-exec-1454] [INFO ]
(o.a.r.r.c.BuildResource:296) - Added build
'Java Stack :: My App - branch 5.6.0/ #9_412'