我正在尝试为我的私人项目创建一个Maven索引,并且我正在尝试使用org.apache.maven.indexer:indexer-index:7.1.1来实现。然而,当调用jar时,我得到的只是一个错误消息:
> java -jar /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar \
--repository "${HOMEPAGE_DEPLOY}" \
--index "${HOMEPAGE_DEPLOY}/.index" \
--destination "${HOMEPAGE_DEPLOY}/.index" \
--name "${PROJECT_NAME}"
kein Hauptmanifestattribut, in /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
字符串
是的,所有路径名都已检查,简化的调用也无法正常工作:
>pushd /…/org/apache/maven/indexer/indexer-cli/7.1.1/
>java -jar indexer-cli-7.1.1.jar
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。
>7z l /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.05 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,16 CPUs x64)
Scanning the drive for archives:
1 file, 22886 bytes (23 KiB)
Listing archive: /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
--
Path = /…/org/apache/maven/indexer/indexer-cli/7.1.1/indexer-cli-7.1.1.jar
Type = zip
Physical Size = 22886
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2023-12-13 22:35:30 D.... 0 0 META-INF
2023-12-13 22:35:30 ..... 336 171 META-INF/MANIFEST.MF
2023-12-13 22:35:30 D.... 0 0 META-INF/sisu
2023-12-13 22:35:30 D.... 0 0 org
2023-12-13 22:35:30 D.... 0 0 org/apache
2023-12-13 22:35:30 D.... 0 0 org/apache/maven
2023-12-13 22:35:30 D.... 0 0 org/apache/maven/index
2023-12-13 22:35:30 D.... 0 0 org/apache/maven/index/cli
2023-12-13 22:35:30 D.... 0 0 META-INF/maven
2023-12-13 22:35:30 D.... 0 0 META-INF/maven/org.apache.maven.indexer
2023-12-13 22:35:30 D.... 0 0 META-INF/maven/org.apache.maven.indexer/indexer-cli
2023-12-13 22:35:30 ..... 6190 1331 META-INF/DEPENDENCIES
2023-12-13 22:35:30 ..... 11358 3949 META-INF/LICENSE
2023-12-13 22:35:30 ..... 175 130 META-INF/NOTICE
2023-12-13 22:35:30 ..... 38 40 META-INF/sisu/javax.inject.Named
2023-12-13 22:35:30 ..... 732 403 org/apache/maven/index/cli/Components.class
2023-12-13 22:35:30 ..... 1016 516 org/apache/maven/index/cli/NexusIndexerCli$1.class
2023-12-13 22:35:30 ..... 4316 2051 org/apache/maven/index/cli/NexusIndexerCli$IndexerListener.class
2023-12-13 22:35:30 ..... 17445 8267 org/apache/maven/index/cli/NexusIndexerCli.class
2023-12-13 22:35:30 ..... 2093 951 org/apache/maven/index/cli/PartialImplementation.class
2023-12-13 22:35:30 ..... 6685 1917 META-INF/maven/org.apache.maven.indexer/indexer-cli/pom.xml
2023-12-13 22:35:30 ..... 70 66 META-INF/maven/org.apache.maven.indexer/indexer-cli/pom.properties
------------------- ----- ------------ ------------ ------------------------
2023-12-13 22:35:30 50454 19792 12 files, 10 folders
型
我也检查了sha1校验和,并且也匹配。最后我检查了MANIFEST.MF
,它确实缺少Main-Class:
条目:
>cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.3.0
Build-Jdk-Spec: 21
Specification-Title: Maven :: Indexer CLI
Specification-Version: 7.1
Specification-Vendor: The Apache Software Foundation
Implementation-Title: Maven :: Indexer CLI
Implementation-Version: 7.1.1
Implementation-Vendor: The Apache Software Foundation
型
为什么在MANIFEST.MF
中缺少Main-Class:
的@khmarbaise工作?
更新三:
安装java 21并再次尝试。Oracle Java和openjdk的结果相同:
>JDK_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home \
>JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home \
>/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/java -jar indexer-cli-7.1.1.jar
kein Hauptmanifestattribut, in indexer-cli-7.1.1.jar
>JDK_HOME=/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home \
>JAVA_HOME=/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home \
>/usr/local/Cellar/openjdk/21.0.1/libexec/openjdk.jdk/Contents/Home/bin/java -jar indexer-cli-7.1.1.jar
kein Hauptmanifestattribut, in indexer-cli-7.1.1.jar
型
1条答案
按热度按时间i1icjdpr1#
再次重复我自己的问题。在版本7及以后,indexer-encrypt包的文件结构发生了变化。比较一下:
Version 6.2.2:
字符串
Version 7.1.1:
型
现在有比以前更多的文件,实际可执行文件的名称已从
indexer-cli-6.2.2.jar
更改为indexer-cli-7.1.1-cli.jar