2015-11-13 44 views
4

我正在使用JFrog artifactory 3.2.1.1和Maven 3.2.1。无法从artifactory中找到神器

我上传了一个存在于版本库浏览器下的libs-snapshot-local中的内置项目。如果我浏览到com.foo.project,我会在artifactory浏览器中看到project-1.0-20151113.133436-1.jar文件和pom和元数据。

即使访问http://example.com:8081/artifactory/webapp/browserepo.html?42&pathId=libs-snapshot-local:com/foo/project/1.0-SNAPSHOT/project-1.0-20151113.133436-1.jar也会向我显示里面的jar文件。

我用的settings.xml发生器从artifactory的生成<repository>标签,我在下面的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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.foo.bar</groupId> 
    <artifactId>exampleApp</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>exampleApp</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 
    <repositories> 
    <repository> 
     <snapshots /> 
     <id>snapshots</id> 
     <name>libs-snapshot</name> 
     <url>http://example.foo:8081/artifactory/libs-snapshot</url> 
    </repository> 
    </repositories> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>unpack</id> 
      <phase>prepare-package</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <artifactItems> 
       <artifactItem> 
        <groupId>com.foo</groupId> 
        <artifactId>project</artifactId> 
        <version>1.0</version> 
        <type>jar</type> 
        <includes>myFolder</includes> 
        <outputDirectory>${project.build.directory}/newFolder/js/gmoketest</outputDirectory> 
       </artifactItem> 
       </artifactItems> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

我只是得到:

未能执行目标 org.apache.maven.plugins:maven-dependency-plugin:2.8:在项目exampleApp上解压缩(解压) :无法找到工件。未能找到 com.foo:project:jar:1.0在 http://example.com:8081/artifactory/libs-snapshot在 本地仓库被缓存,分辨率将不会被重新尝试,直到快照的更新 间隔已过或更新被迫

如果我改变 http://example.foo:8081/artifactory/libs-snapshot

http://example.foo:8081/artifactory/libs-snapshot-local 然后我得到:

[错误]无法执行目标 org.apache.maven.plugins:maven-dependency-plugin:2.8:在项目exampleApp上解压缩(解压缩) :无法解析工件。无法将 工件com.foo:project:jar:1.0从/转移到快照 (http://example.com:8081/artifactory/libs-snapshot-local):未能转至 传输文件: http://example.com:8081/artifactory/libs-snapshot-local/com/foo/project/1.0/project-1.0.jar。 返回码是:409,ReasonPhrase:冲突。

我会继续现在,然后部署新的快照到同一项目1.0,并希望这个POM文件只包含最新的快照构建从artifactory的建筑时。

回答

0

答案是,因为我很快就想通了,该版本需要被指定为:

<version>1.0-SNAPSHOT</version> 
+2

你能澄清你在哪里正是失踪的版本记录? – enissay