Maven使用中的问题(依赖Missing)

Maven的依赖问题

在聚合模块时候,发现在父工程目录中的依赖存在一些问题。
这里写图片描述

依赖添加失败

* 在父工程的jar包依赖在子工程中无法进行添加报错*
Missing artifact com.github.pagehelper:pagehelper:jar:3.4.2-fix

原因

这里写图片描述
在父工程中已经确定jar的version,但是jar下载不下来,可能存在两种情况
1. 该jar包非免费,需要付费,所以下载不下来
2. 网络原因,连接不到国外的服务器

解决方案

1.去网上下载该jar包,手动导入Maven仓库中。
2.更换版本尝试,有可能行。
这里写图片描述

项目打包成war包失败(缺少web.xml)

web.xml is missing and () is set to true
* 解决方案
* : 右击项目名称 -> java EE Tools -> Generate Deployment Descriptor Stub
* 手动添加WEN-INF文件夹 和web.xml文件

添加Java编译器

<!-- java编译插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

配置Tomact

<pluginManagement>
            <plugins>
                <!-- 配置Tomcat插件 -->
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <path>/</path> <!--路径 -->
                        <port>8080</port>  <!--端口 -->
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

资源文件拷贝

<!-- 资源文件拷贝插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

Maven用命令启动tomact

这里写图片描述

总结

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值