【问题标题】:Missing artifact in pom.xml com.cardboardfish:http-sms:jar:1.0pom.xml com.cardboardfish:http-sms:jar:1.0 中缺少工件
【发布时间】:2018-08-19 09:39:37
【问题描述】:
<dependency>
    <groupId>com.cardboardfish</groupId>
    <artifactId>http-sms</artifactId>
    <version>1.0</version>
</dependency>

我有 jar 并且已经尝试通过 maven 命令安装但它失败了

mvn install:install-file -Dfile=cbfsms.jar -DgroupId=com.cardboardfish -DartifactId=http-sms -Dversion=1.0 -Dpackaging=jar

 [INFO] Scanning for projects... [INFO]
 ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
 ------------------------------------------------------------------------ [INFO] Total time: 0.125 s [INFO] Finished at:
 2018-03-11T11:18:07+05:30 [INFO] Final Memory: 4M/116M [INFO]
 ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there
 is no POM in this directory
 (C:\Users\test\.m2\repository\com\cardboardfish\http-sms\1.0). Please
 verify you invoked Maven from the correct directory. -> [Help 1]
 [ERROR] [ERROR] To see the full stack trace of the errors, re-run
 Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to
 enable full debug logging. [ERROR] [ERROR] For more information about
 the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

【问题讨论】:

    标签: spring maven


    【解决方案1】:

    经过大量任务.. 我发现由于 pom.xml 文件丢失它给出了异常,所以我为 cbfsms.jar 创建了一个 pom.xml,具有以下属性

    <?xml version="1.0" encoding="UTF-8"?>
    <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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.cardboardfish</groupId>
        <artifactId>http-sms</artifactId>
        <version>1.0</version>
        <name>cardboard_fish_sbf_sms_jar</name>
        <description>helpful jar for sms utilities</description>
    
        <dependencies>
        </dependencies>
    
    </project>
    

    比我使用 Maven 命令,它对我有用

    mvn install:install-file -Dfile=cbfsms.jar -DgroupId=com.cardboardfish -DartifactId=http-sms -Dversion=1.0 -Dpackaging=jar

    【讨论】:

      【解决方案2】:

      由于您提供的异常

      您指定的目标需要一个项目来执行,但没有 该目录下的POM

      您在 pom.xml 所在的另一个目录中运行 maven 命令。所以去你的 pom 所在的位置,然后运行你想要的 maven 命令。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-12
        • 2015-05-25
        • 2023-03-15
        • 2020-10-01
        相关资源
        最近更新 更多