Maven(二)初学问题

1、JRE默认为J2SE-1.5

1)修改setting文件,这种方法属于为通用设置

<profile>
	<id>jdk-1.7</id>
	<activation>
		<activeByDefault>true</activeByDefault>
		<jdk>1.7</jdk>
	</activation>
	<properties>  
		<maven.compiler.source>1.7</maven.compiler.source>  
		<maven.compiler.target>1.7</maven.compiler.target>  
 <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
	</properties>
</profile>

2)或者使用maven自带的插件,这种方法属于特定设置

<plugin>                                                                                                                                                                                                  
    <groupId>org.apache.maven.plugins</groupId>                                                                                               
    <artifactId>maven-compiler-plugin</artifactId>                                                                                            
    <version>3.1</version>                                                                                                                    
    <configuration>                                                                                                                                          
        <source>1.8</source> <!-- 源代码使用的JDK版本 -->                                                                                             
        <target>1.8</target> <!-- 需要生成的目标class文件的编译版本 -->                                                                                     
        <encoding>UTF-8</encoding><!-- 字符集编码 -->
        <skipTests>true</skipTests><!-- 跳过测试 -->                                                                                          
    </configuration>                                                                                                                          
</plugin>

2、The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

在这里插入图片描述

3、修改archetypeCatalog.xml提升maven打开速度

总结:
1)骨架的列表来源的配置文件。
2)通过指定范围在内置或者本地提升项目搭建速度。
在这里插入图片描述
Maven-Archetype Catalog
使用Intellij IDEA通过Maven搭建struts2的HelloWord

4、

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值