mac_05185 2022-07-20 11:17 采纳率: 67.1%
浏览 39
已结题

idea的maven web项目运行报错,提示资源问题?

img

错误提示:
Webapp source directory D:\360安全浏览器下载\AndroidTimeDialog\webappDemo\target\webappDemo-1.0-SNAPSHOT does not exist
下面是我的pom配置:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<!-- $Id: pom.xml 642118 2008-03-28 08:04:16Z reinhard $ -->
<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>
    <packaging>war</packaging>

    <name>webappDemo</name>
    <groupId>org.mac</groupId>
    <artifactId>webappDemo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <!--jetty轻量级服务器-->
                <artifactId>maven-jetty-plugin</artifactId>
                <version>6.1.7</version>
                <configuration>
                    <!--热部署-->
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <!--指定站点名称-->
                    <contextPath>/webappDemo</contextPath>
                    <connectors>
                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                            <port>8888</port>
                            <maxIdleTime>30000</maxIdleTime>
                        </connector>
                    </connectors>
                    <webAppSourceDirectory>${project.build.directory}/${pom.artifactId}-${pom.version}
                    </webAppSourceDirectory>
                    <contextPath>/</contextPath>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <port>8080</port>
                    <path>/webappDemo</path>
                    <uriEncoding>UTF-8</uriEncoding>
                    <server>tomcat7</server>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!--dependency>
          <groupId>org.mac</groupId>
          <artifactId>[the artifact id of the block to be mounted]</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency-->
    </dependencies>

</project>
  • 写回答

2条回答 默认 最新

  • 善良勤劳勇敢而又聪明的老杨 优质创作者: Java技术领域 2022-07-20 11:25
    关注

    你看一下在你电脑的这个D:\360安全浏览器下载\AndroidTimeDialog\webappDemo\target\ 路径下,有webappDemo-1.0-SNAPSHOT名称的jar包或war包吗?
    目前错误提示,就是找不到这个包!

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 7月20日
  • 创建了问题 7月20日