TeamCity无法部署到Artifactory - 报告“预期文件夹但找到了文件”

时间:2013-10-09 00:28:32

标签: java maven teamcity artifactory

我有一个最近正在运行并正确部署的Maven构建,现在它无法部署。据我所知,构建设置和pom.xml中没有任何变化。 (我在成功和失败的文件夹上对pom做了一个差异,它们是相同的;假设文件夹尚未更新。)

Maven构建的平衡能够部署。我对所有项目使用相同的模板,也使用相同的settings.xml文件。

构建成功完成,然后事情变得奇怪。我查看了TeamCity中两个版本的日志,并且命令看起来是一样的,除了失败(在那时退出)。

我注意到的事情:

  1. Artifactory中的失败日志消息发出mkdir命令,
  2. 后来发出警告,希望找到一个目录,但找到了一个文件,
  3. 搜索那个短语,我找到了异常类。 FolderExpectedException for Artifactory。
  4. TeamCity中的日志在失败之前看起来一样。
  5. 其他Maven构建(使用相同的构建模板& settings.xml文件)成功部署。
  6. 我对后续和失败的poms进行了差异化,没有任何差异。
  7. 目前,我没有Artifactory的成功日志;我打算在机器上挖掘,看看能不能找到旧日志。
  8. 在构建代理的两个工作目录中(成功& not),jar位于target/mylib.jar
  9. 最大唯一快照设置为0,因此我认为这与this older bug.
  10. 无关
  11. 如果我将快照从libs-snapshot-local移出到列入黑名单的存储库并尝试重新部署...它将创建5-6-0-SNAPSHOT根文件夹,但随后它会创建与jar相同的空子文件夹和pom!但是TeamCity中target / mylib.jar中的工件绝对是一个jar文件。
  12. TeamCity 8.0.4 build 27616; Artifactory 3.0.1 rev 30008
  13. TeamCity最近从8.0.2升级,此时部署正在进行中。我没有尝试过回滚,但基于相同构建模板的其他构建已成功部署,所以我不认为是这样,但这可能是接下来要检查的内容。
  14. 工件路径(来自常规设置)为:**/*.jar
  15. 运行此帐户的帐户是域帐户,但未锁定。它可以完全控制每台构建计算机上的TeamCity Build Agent目录。
  16. 问题:

    1. 我还能找到什么?
    2. 我可以尝试改变吗?
    3. 我能做些什么来导出TeamCity在成功构建和现在失败的构建中看到的所有内容吗?
    4. 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'
      

1 个答案:

答案 0 :(得分:0)

这对TeamCity构建配置来说是一个问题。我的猜测是它在从8.0.2到8.0.4的更新过程中被破坏了,但我不是百分百肯定的。 我正在向他们提交错误。

我确定这一点的方式是该配置的问题:

  1. 从Maven构建模板(失败基于的相同模板)
  2. 创建新配置
  3. 使用与损坏的
  4. 相同的构建参数设置新配置
  5. 针对新配置启动了一个构建,成功了。
  6. 多次验证构建参数是否相同。
  7. 有趣的是,我对这些进行了备份,然后将它们复制到TeamCity中的新项目中。当我这样做时,它们都成功了,包括那个在主项目中失败的副本。

    在原始项目中,它似乎也停留在较旧的版本上。希望他们可以解释为什么它会失败(并且可能在未来提供更好的错误信息),但是,我能够绕过它。