java org.apache.maven.indexer:indexer-tool:7.1.1是如何工作的?

k4aesqcs  于 2024-01-05  发布在  Java
关注(0)|答案(1)|浏览(188)

我正在尝试为我的私人项目创建一个Maven索引,并且我正在尝试使用org.apache.maven.indexer:indexer-index:7.1.1来实现。然而,当调用jar时,我得到的只是一个错误消息:

  1. > java -jar /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar \
  2. --repository "${HOMEPAGE_DEPLOY}" \
  3. --index "${HOMEPAGE_DEPLOY}/.index" \
  4. --destination "${HOMEPAGE_DEPLOY}/.index" \
  5. --name "${PROJECT_NAME}"
  6. kein Hauptmanifestattribut, in /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar

字符串
是的,所有路径名都已检查,简化的调用也无法正常工作:

  1. >pushd /…/org/apache/maven/indexer/indexer-cli/7.1.1/
  2. >java -jar indexer-cli-7.1.1.jar
  3. kein Hauptmanifestattribut, in indexer-cli-7.1.1.jar


我发现的唯一一个documentation也使用java -jar,但那是5.1.1版的,所以我想知道是否有什么变化。
我知道nexus indexer,但是在我迁移到Java 11之后,它就停止工作了,我不想永远被Java 8卡住。(他们应该叫Java 9Java 2.0,因为它是一个市长和不兼容的升级)

更新一:

为了完整起见,我确实尝试了org.apache.maven.indexer:indexer-clock:5.1.1,实际上它像预期的那样工作。就像org.apache.maven.indexer:indexer-clock:6.2.2一样,但不是org.apache.maven.indexer:indexer-clock:7.0.4
这是版本7的变化。

更新二:

在@khmarbaise问题之后,我决定检查JAR文件的内容。文件内容看起来不错,并且存在MANIFEST.MF。

  1. >7z l /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
  2. 7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
  3. p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,16 CPUs x64)
  4. Scanning the drive for archives:
  5. 1 file, 22886 bytes (23 KiB)
  6. Listing archive: /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
  7. --
  8. Path = /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
  9. Type = zip
  10. Physical Size = 22886
  11. Date Time Attr Size Compressed Name
  12. ------------------- ----- ------------ ------------ ------------------------
  13. 2023-12-13 22:35:30 D.... 0 0 META-INF
  14. 2023-12-13 22:35:30 ..... 336 171 META-INF/MANIFEST.MF
  15. 2023-12-13 22:35:30 D.... 0 0 META-INF/sisu
  16. 2023-12-13 22:35:30 D.... 0 0 org
  17. 2023-12-13 22:35:30 D.... 0 0 org/apache
  18. 2023-12-13 22:35:30 D.... 0 0 org/apache/maven
  19. 2023-12-13 22:35:30 D.... 0 0 org/apache/maven/index
  20. 2023-12-13 22:35:30 D.... 0 0 org/apache/maven/index/cli
  21. 2023-12-13 22:35:30 D.... 0 0 META-INF/maven
  22. 2023-12-13 22:35:30 D.... 0 0 META-INF/maven/org.apache.maven.indexer
  23. 2023-12-13 22:35:30 D.... 0 0 META-INF/maven/org.apache.maven.indexer/indexer-cli
  24. 2023-12-13 22:35:30 ..... 6190 1331 META-INF/DEPENDENCIES
  25. 2023-12-13 22:35:30 ..... 11358 3949 META-INF/LICENSE
  26. 2023-12-13 22:35:30 ..... 175 130 META-INF/NOTICE
  27. 2023-12-13 22:35:30 ..... 38 40 META-INF/sisu/javax.inject.Named
  28. 2023-12-13 22:35:30 ..... 732 403 org/apache/maven/index/cli/Components.class
  29. 2023-12-13 22:35:30 ..... 1016 516 org/apache/maven/index/cli/NexusIndexerCli$1.class
  30. 2023-12-13 22:35:30 ..... 4316 2051 org/apache/maven/index/cli/NexusIndexerCli$IndexerListener.class
  31. 2023-12-13 22:35:30 ..... 17445 8267 org/apache/maven/index/cli/NexusIndexerCli.class
  32. 2023-12-13 22:35:30 ..... 2093 951 org/apache/maven/index/cli/PartialImplementation.class
  33. 2023-12-13 22:35:30 ..... 6685 1917 META-INF/maven/org.apache.maven.indexer/indexer-cli/pom.xml
  34. 2023-12-13 22:35:30 ..... 70 66 META-INF/maven/org.apache.maven.indexer/indexer-cli/pom.properties
  35. ------------------- ----- ------------ ------------ ------------------------
  36. 2023-12-13 22:35:30 50454 19792 12 files, 10 folders


我也检查了sha1校验和,并且也匹配。最后我检查了MANIFEST.MF,它确实缺少Main-Class:条目:

  1. >cat META-INF/MANIFEST.MF
  2. Manifest-Version: 1.0
  3. Created-By: Maven JAR Plugin 3.3.0
  4. Build-Jdk-Spec: 21
  5. Specification-Title: Maven :: Indexer CLI
  6. Specification-Version: 7.1
  7. Specification-Vendor: The Apache Software Foundation
  8. Implementation-Title: Maven :: Indexer CLI
  9. Implementation-Version: 7.1.1
  10. Implementation-Vendor: The Apache Software Foundation


为什么在MANIFEST.MF中缺少Main-Class:的@khmarbaise工作?

更新三:

安装java 21并再次尝试。Oracle Java和openjdk的结果相同:

  1. >JDK_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home \
  2. >JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home \
  3. >/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/java -jar indexer-cli-7.1.1.jar
  4. kein Hauptmanifestattribut, in indexer-cli-7.1.1.jar
  5. >JDK_HOME=/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home \
  6. >JAVA_HOME=/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home \
  7. >/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/bin/java -jar indexer-cli-7.1.1.jar
  8. kein Hauptmanifestattribut, in indexer-cli-7.1.1.jar

i1icjdpr

i1icjdpr1#

再次重复我自己的问题。在版本7及以后,indexer-encrypt包的文件结构发生了变化。比较一下:

Version 6.2.2

  1. org/apache/maven/indexer/indexer-cli/6.2.2
  2. ../
  3. indexer-cli-6.2.2-javadoc.jar 2022-07-16 15:47 136897
  4. indexer-cli-6.2.2-javadoc.jar.asc 2022-07-16 15:47 833
  5. indexer-cli-6.2.2-javadoc.jar.md5 2022-07-16 15:47 32
  6. indexer-cli-6.2.2-javadoc.jar.sha1 2022-07-16 15:47 40
  7. indexer-cli-6.2.2-sources.jar 2022-07-16 15:47 15752
  8. indexer-cli-6.2.2-sources.jar.asc 2022-07-16 15:47 833
  9. indexer-cli-6.2.2-sources.jar.md5 2022-07-16 15:47 32
  10. indexer-cli-6.2.2-sources.jar.sha1 2022-07-16 15:47 40
  11. indexer-cli-6.2.2.jar 2022-07-16 15:47 12672807
  12. indexer-cli-6.2.2.jar.asc 2022-07-16 15:47 833
  13. indexer-cli-6.2.2.jar.md5 2022-07-16 15:47 32
  14. indexer-cli-6.2.2.jar.sha1 2022-07-16 15:47 40
  15. indexer-cli-6.2.2.pom 2022-07-16 15:47 6599
  16. indexer-cli-6.2.2.pom.asc 2022-07-16 15:47 833
  17. indexer-cli-6.2.2.pom.md5 2022-07-16 15:47 32
  18. indexer-cli-6.2.2.pom.sha1 2022-07-16 15:47 40

字符串

Version 7.1.1

  1. org/apache/maven/indexer/indexer-cli/7.1.1
  2. ../
  3. indexer-cli-7.1.1-cli.jar 2023-12-13 22:39 13617488
  4. indexer-cli-7.1.1-cli.jar.asc 2023-12-13 22:39 833
  5. indexer-cli-7.1.1-cli.jar.md5 2023-12-13 22:39 32
  6. indexer-cli-7.1.1-cli.jar.sha1 2023-12-13 22:39 40
  7. indexer-cli-7.1.1-cyclonedx.json 2023-12-13 22:39 78614
  8. indexer-cli-7.1.1-cyclonedx.json.asc 2023-12-13 22:39 833
  9. indexer-cli-7.1.1-cyclonedx.json.md5 2023-12-13 22:39 32
  10. indexer-cli-7.1.1-cyclonedx.json.sha1 2023-12-13 22:39 40
  11. indexer-cli-7.1.1-cyclonedx.xml 2023-12-13 22:39 66952
  12. indexer-cli-7.1.1-cyclonedx.xml.asc 2023-12-13 22:39 833
  13. indexer-cli-7.1.1-cyclonedx.xml.md5 2023-12-13 22:39 32
  14. indexer-cli-7.1.1-cyclonedx.xml.sha1 2023-12-13 22:39 40
  15. indexer-cli-7.1.1-javadoc.jar 2023-12-13 22:39 114999
  16. indexer-cli-7.1.1-javadoc.jar.asc 2023-12-13 22:39 833
  17. indexer-cli-7.1.1-javadoc.jar.md5 2023-12-13 22:39 32
  18. indexer-cli-7.1.1-javadoc.jar.sha1 2023-12-13 22:39 40
  19. indexer-cli-7.1.1-sources.jar 2023-12-13 22:39 17046
  20. indexer-cli-7.1.1-sources.jar.asc 2023-12-13 22:39 833
  21. indexer-cli-7.1.1-sources.jar.md5 2023-12-13 22:39 32
  22. indexer-cli-7.1.1-sources.jar.sha1 2023-12-13 22:39 40
  23. indexer-cli-7.1.1.jar 2023-12-13 22:39 22886
  24. indexer-cli-7.1.1.jar.asc 2023-12-13 22:39 833
  25. indexer-cli-7.1.1.jar.md5 2023-12-13 22:39 32
  26. indexer-cli-7.1.1.jar.sha1 2023-12-13 22:39 40
  27. indexer-cli-7.1.1.pom 2023-12-13 22:39 6685
  28. indexer-cli-7.1.1.pom.asc 2023-12-13 22:39 833
  29. indexer-cli-7.1.1.pom.md5 2023-12-13 22:39 32
  30. indexer-cli-7.1.1.pom.sha1 2023-12-13 22:39 40


现在有比以前更多的文件,实际可执行文件的名称已从indexer-cli-6.2.2.jar更改为indexer-cli-7.1.1-cli.jar

展开查看全部

相关问题