我有一个最近正在运行并正确部署的Maven构建,现在它无法部署。据我所知,构建设置和pom.xml中没有任何变化。 (我在成功和失败的文件夹上对pom做了一个差异,它们是相同的;假设文件夹尚未更新。)
Maven构建的平衡能够部署。我对所有项目使用相同的模板,也使用相同的settings.xml文件。
构建成功完成,然后事情变得奇怪。我查看了TeamCity中两个版本的日志,并且命令看起来是一样的,除了失败(在那时退出)。
mkdir
命令,FolderExpectedException
for Artifactory。target/mylib.jar
5-6-0-SNAPSHOT
根文件夹,但随后它会创建与jar相同的空子文件夹和pom!但是TeamCity中target / mylib.jar中的工件绝对是一个jar文件。**/*.jar
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 - failure - 注意jar上的mkdir -p
命令
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'
答案 0 :(得分:0)
这对TeamCity构建配置来说是一个问题。我的猜测是它在从8.0.2到8.0.4的更新过程中被破坏了,但我不是百分百肯定的。 我正在向他们提交错误。
我确定这一点的方式是该配置的问题:
有趣的是,我对这些进行了备份,然后将它们复制到TeamCity中的新项目中。当我这样做时,它们都成功了,包括那个在主项目中失败的副本。
在原始项目中,它似乎也停留在较旧的版本上。希望他们可以解释为什么它会失败(并且可能在未来提供更好的错误信息),但是,我能够绕过它。