Spring integration spring集成kafka Maven构建错误:Can';找不到spring集成kafka:jar:1.2.2.BUILD-SNAPSHOT

Spring integration spring集成kafka Maven构建错误:Can';找不到spring集成kafka:jar:1.2.2.BUILD-SNAPSHOT,spring-integration,apache-kafka,Spring Integration,Apache Kafka,我正在尝试编译(使用Maven)我在这里找到的简单卡夫卡参考项目: 然而,当我运行mvn安装-U时,我反复遇到这个错误 [ERROR] Failed to execute goal on project kafka: Could not resolve dependencies for project org.springframework.integration.samples:kafka:jar:4.1.0.BUILD-SNAPSHOT: Could not find artifact o

我正在尝试编译(使用Maven)我在这里找到的简单卡夫卡参考项目:

然而,当我运行mvn安装-U时,我反复遇到这个错误

[ERROR] Failed to execute goal on project kafka: Could not resolve dependencies for project org.springframework.integration.samples:kafka:jar:4.1.0.BUILD-SNAPSHOT: Could not find artifact org.springframework.integration:spring-integration-kafka:jar:1.2.2.BUILD-SNAPSHOT in repo.spring.io.milestone (https://repo.spring.io/libs-milestone) -> [Help 1]
当我去查看时,我可以看到我的.m2文件夹中的jar文件——就在我认为应该在的地方——在org/springframework/integration/springintegration-kafka/1.2.2.BUILD.SNAPSHOT下。但是,它不是以.jar结尾,而是以.jar.lastUpdated结尾

我尝试将该项目作为maven项目加载到Spring工具套件中,并尝试清理该项目。。。但在这种情况下,我会得到错误“无法读取项目“kafka”中所需库的存档……或者该文件不是有效的ZIP文件

我被难住了-不知道从这里去哪里-我已经吹走了目录,并替换为原来的项目下载了好几次。仍然没有乐趣

哦,我还尝试重命名该文件,希望它是一个有效的zip/jar,但显然它不是

如有任何建议,将不胜感激

============谢谢你,加里===========

我擦除了“kafka”目录,并从下载的zip文件中重新添加了它-然后我尝试将该条目添加到POM中,并出现以下错误:

ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'repositories.repository.id' must be unique: repo.spring.io.milestone -> https://repo.spring.io/libs-milestone vs https://repo.spring.io/libs-snapshot @ line 114, column 8
然后,我更改了存储库的名称,使其不同,因此:

<repository>
  <id>repo.spring.io.snapshot</id>
  <name>Spring Framework Maven Snapshot Repository</name>
  <url>https://repo.spring.io/libs-snapshot</url>
</repository>
如果有帮助的话(或者如果我的手指发胖的话),这里有一份POM…再次感谢

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.0.M5</version>
  </parent>
  <groupId>org.springframework.integration.samples</groupId>
  <artifactId>kafka</artifactId>
  <version>4.1.0.BUILD-SNAPSHOT</version>
  <name>Apache Kafka Sample</name>
  <description>Apache Kafka Sample</description>
  <url>http://projects.spring.io/spring-integration</url>
  <organization>
    <name>SpringIO</name>
    <url>https://spring.io</url>
  </organization>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>garyrussell</id>
      <name>Gary Russell</name>
      <email>grussell@pivotal.io</email>
      <roles>
        <role>project lead</role>
      </roles>
    </developer>
    <developer>
      <id>markfisher</id>
      <name>Mark Fisher</name>
      <email>mfisher@pivotal.io</email>
      <roles>
        <role>project founder and lead emeritus</role>
      </roles>
    </developer>
    <developer>
      <id>ghillert</id>
      <name>Gunnar Hillert</name>
      <email>ghillert@pivotal.io</email>
    </developer>
    <developer>
      <id>abilan</id>
      <name>Artem Bilan</name>
      <email>abilan@pivotal.io</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:scm:git:git://github.com/spring-projects/spring-integration-samples.git</connection>
    <developerConnection>scm:git:scm:git:ssh://git@github.com:spring-projects/spring-integration-samples.git</developerConnection>
    <url>https://github.com/spring-projects/spring-integration-samples</url>
  </scm>
  <dependencies>
    <dependency>
      <groupId>org.springframework.integration</groupId>
      <artifactId>spring-integration-core</artifactId>
      <version>4.2.0.RELEASE</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-integration</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.integration</groupId>
      <artifactId>spring-integration-kafka</artifactId>
      <version>1.2.2.BUILD-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>4.2.0.RELEASE</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>repo.spring.io.milestone</id>
      <name>Spring Framework Maven Milestone Repository</name>
      <url>https://repo.spring.io/libs-milestone</url>
    </repository>
    <repository>
      <id>repo.spring.io.snapshot</id>
      <name>Spring Framework Maven Snapshot Repository</name>
      <url>https://repo.spring.io/libs-snapshot</url>
    </repository>
  </repositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>

4.0.0
org.springframework.boot
spring启动程序父级
1.3.0.M5
org.springframework.integration.samples
卡夫卡
4.1.0.1构建快照
ApacheKafka示例
ApacheKafka示例
http://projects.spring.io/spring-integration
斯普林尼奥
https://spring.io
Apache软件许可证,版本2.0
http://www.apache.org/licenses/LICENSE-2.0.txt
回购
加里鲁塞尔
加里·拉塞尔
grussell@pivotal.io
项目负责人
markfisher
马克·费舍尔
mfisher@pivotal.io
项目创始人和退休领导
吉勒特
冈纳·希勒特
ghillert@pivotal.io
阿比兰
阿特姆比兰
abilan@pivotal.io
scm:git:scm:git:git://github.com/spring-projects/spring-integration-samples.git
scm:git:scm:git:ssh://git@github.com:spring项目/spring-integration-samples.git
https://github.com/spring-projects/spring-integration-samples
org.springframework.integration
spring集成核心
4.2.0.1发布
编写
朱尼特
朱尼特
4.11
测验
org.hamcrest
汉克雷斯特酒店
1.3
测验
org.springframework.boot
弹簧起动试验
测验
org.springframework.boot
spring boot启动器集成
编写
org.springframework.integration
卡夫卡之春
1.2.2.构建快照
编写
org.springframework
弹簧试验
4.2.0.1发布
测验
org.mockito
莫基托磁芯
1.9.5
测验
repo.spring.io.milestone
Spring框架Maven里程碑存储库
https://repo.spring.io/libs-milestone
repo.spring.io.snapshot
Spring框架Maven快照存储库
https://repo.spring.io/libs-snapshot
org.springframework.boot
springbootmaven插件

POM中有一个bug;添加

<repository>
  <id>repo.spring.io.snapshot</id>
  <name>Spring Framework Maven Snapshot Repository</name>
  <url>https://repo.spring.io/libs-snapshot</url>
</repository>

repo.spring.io.snapshot
Spring框架Maven快照存储库
https://repo.spring.io/libs-snapshot

到存储库部分。

我开始怀疑尝试使用Maven来构建它是一个坏主意。我不断地陷入错误中。我有点想,如果有POM文件,那么“mvn安装”它应该是一件简单的事情……除非有人有一点洞察力,否则我将放弃Maven的东西。老实说老实说,我们不是从pom生成的(因此出现了错误),我们是从gradle生成pom的。我只是手动修复了pom,它现在可以为我生成了;我还在测试中修复了一个包名。如果你使用最新的主程序,你应该可以开始了。
mvn package
然后
java-jar target/target/kafka-4.1.0.build-SNAPSHOT.jar
<repository>
  <id>repo.spring.io.snapshot</id>
  <name>Spring Framework Maven Snapshot Repository</name>
  <url>https://repo.spring.io/libs-snapshot</url>
</repository>