Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法运行Maven命令_Java_Maven_Terminal_Maven 2_War - Fatal编程技术网

Java 无法运行Maven命令

Java 无法运行Maven命令,java,maven,terminal,maven-2,war,Java,Maven,Terminal,Maven 2,War,我不是一个专业的程序员。我在运行“mvn干净安装”时遇到了这个错误。如果有人能解释我改正这个错误,那就太好了 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building erp-web Maven Webapp [INFO] task-segment: [clean, install] [INFO

我不是一个专业的程序员。我在运行“mvn干净安装”时遇到了这个错误。如果有人能解释我改正这个错误,那就太好了

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building erp-web Maven Webapp
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /home/server/Desktop/Hospital project/Healthcare/Source/erp-web/target (included: [**], excluded: [])
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.erp:erp:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.erp -DartifactId=erp -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.erp -DartifactId=erp -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) com.erp:erp-web:war:1.0-SNAPSHOT
    2) com.erp:erp:jar:1.0-SNAPSHOT

----------
1 required artifact is missing.

for artifact: 
  com.erp:erp-web:war:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)
这是我的POM文件内容。。我从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.erp</groupId>
    <artifactId>erp-web</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>erp-web Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <!-- Shared version number properties -->
    <properties>
        <org.springframework.version>3.0.5.RELEASE</org.springframework.version>
    </properties>

    <dependencies>
        <!-- Backend API project -->
        <dependency>
            <groupId>com.erp</groupId>
            <artifactId>erp</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>2.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-servlet</artifactId>
            <version>2.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-extras</artifactId>
            <version>2.2.2</version>
        </dependency>

        <!-- Web application development utilities applicable to both Servlet and 
            Portlet Environments (depends on spring-core, spring-beans, spring-context) 
            Define this if you use Spring MVC, or wish to use Struts, JSF, or another 
            web framework with Spring (org.springframework.web.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>

        <!-- Spring MVC for Servlet Environments (depends on spring-core, spring-beans, 
            spring-context, spring-web) Define this if you use Spring MVC with a Servlet 
            Container such as Apache Tomcat (org.springframework.web.servlet.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>

        <!-- Spring MVC for Portlet Environments (depends on spring-core, spring-beans, 
            spring-context, spring-web) Define this if you use Spring MVC with a Portlet 
            Container (org.springframework.web.portlet.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc-portlet</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>3.1.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.1.2</version>
        </dependency>

        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.0</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.4.3</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>mycode</finalName>

    </build>
</project>

4.0.0
com.erp
erp网络
战争
1.0-快照
erp web Maven Webapp
http://maven.apache.org
3.0.5.1发布
com.erp
企业资源计划
1.0-快照
javax.servlet
javax.servlet-api
3.0.1
假如
org.apache.tiles
平铺jsp
2.2.2
org.apache.tiles
瓦片servlet
2.2.2
org.apache.tiles
附加瓷砖
2.2.2
org.springframework
弹簧网
${org.springframework.version}
org.springframework
SpringWebMVC
${org.springframework.version}
org.springframework
SpringWebMVCPortlet
${org.springframework.version}
org.springframework.security
spring安全网
3.1.0.1发布
org.springframework.security
spring安全配置
3.1.0.1发布
org.springframework.security
spring安全标记库
3.1.0.1发布
org.apache.httpcomponents
httpclient
4.1.2
commons httpclient
commons httpclient
3
通用编解码器
通用编解码器
javax.servlet
jstl
1.2
文件上传
文件上传
1.2.1
公用记录
公用记录
公地io
公地io
1.4
org.slf4j
slf4j-log4j12
1.4.3
麦可德

您的工件
com.erp:erp:jar:1.0-SNAPSHOT
未在所有注册的存储库中找到。因此,注册一个为您的JAR服务的额外存储库(如果已经有)

如果尚未有存储库为您的LIB提供服务,请使用以下解决方案之一:

  • 如上面Maven评论中所述,在本地存储库中安装LIB:
    mvn安装:安装文件…
    。请查找有关
    install:install file
    的更多信息
  • 使用(或首先安装)公司范围的远程存储库,如上面Maven评论中所述,并使用以下命令将JAR放入其中:
    mvn deploy:deploy file…
    。请查找有关
    deploy:deploy file
    的更多信息

在上查找有关存储库的更多信息

你能附上你的pom文件吗?看起来缺少了一些依赖项,您使用的插件是什么?可能erp jar模块不在Maven项目的依赖项管理中,因此war模块目前无法解决它。您好,谢谢您的回复。。我有复制粘贴我的POM文件内容请看一看。