Maven篇

作者: 业余的猫 | 来源:发表于2017-03-24 12:51 被阅读11次
1.修改mirror
<!--由于中心仓库速度太慢,需要更换为阿里云的仓库-->
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<!-- 一些最新版本的资源有可能在阿里云仓库找不到,所以还得换会中心仓库 -->
<mirror>
    <id>mirrorId</id>
    <mirrorOf>repositoryId</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://my.repository.com/repo/path</url>
</mirror>
2.修改Jdk
<!-- 修改默认jdk版本-->
<profile>
    <id>jdk-1.8</id>
    <activation>
        <activeByDefault>true</activeByDefault>
        <jdk>1.8</jdk>
    </activation>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    </properties>
</profile>
3.Classpath entryorg.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
右键项目properties>Deployment Assembly>Add>Java  Build Path Entries>Next>
Maven Dependencies>Finish
4.web.xml is missing and <failOnMissingWebXml> is set to true
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>
<!-- 也可以右键项目>Java EE tools>Generate Deployment Descriptor stub即可生成web.xml文件 -->
5.新建Maven Web项目导致EL表达式不能被解析

这是因为Web.xml版本在2.3以前是忽略EL表达式的,可以在Jsp页面Page指令中加入isELIgnored="false",也可以修改Web.xml版本如下:

<?xml version="1.0" encoding="UTF-8"?>  
<web-app version="2.5"   
xmlns="http://java.sun.com/xml/ns/javaee"   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">  
</web>

相关文章

网友评论

    本文标题:Maven篇

    本文链接:https://www.haomeiwen.com/subject/wrgxottx.html