ITeye博客

maven

共 15 篇文章

maven项目src源代码下的资源文件不自动复制到classes文件夹的解决方法

POM文件 <build><resources><resource><directory>src/main/java</directory><excludes><exclude>**/*.java</exclude></excludes></resource></resources></build> maven配置文件默认路径都在resources下,pom里的默认配置为: <build> <finalName>springmvc</finalName> <!-- 默认源代码和资源文件目录配置 --> <sourceDirectory>src/main/java </sourceDirect…

2018-07-01 23:34 · eclipse · java · maven

解决IntelliJ IDEA无法读取配置文件的问题

最近在学Mybatis,按照视频的讲解在项目的某个包里建立配置文件,然后读取配置文件,但是一直提示异常。 读取配置文件的为官方代码: String resource = "mybatis-config.xml"; InputStream inputStream = Resources.getResourceAsStream(resource); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); SqlSession session = sqlSessionFacto…

2018-04-24 11:25 · intellij idea · maven · intellij

maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.

出现这种错误,通常是由于您已启动了另一个tomcat 进程或者运行的javaw.exe进程,导致报错。 关闭运行的tomcat,重新clean,compile,启动tomcat就可以了。

2017-05-23 21:58 · bug · intellij idea · maven

Unable to find a single main class from the following candidates

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.2.7.RELEASE:repackage (default) on project kline-provider: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.2.7.RELEASE:repackage failed: Unable to find a single main class from the follo…

2017-05-20 15:12 · bug · maven · springboot

编译失败

命令行mvn clean package -Plocal没有问题 用intellij idea编译不行,原来profile可以点三次,选中状态有两种,不虚的选中编译就过了。如图

2017-05-16 10:35 · intellij idea · maven

maven替换静态资源文件

网站dev,uat,pdt环境的域名不同,在页面写死? java里面可以通过maven的profile->properties文件->spring注入@Value("${basePath}") private String basePath; 但是静态资源怎么替换呢? maven:把webapp拷贝到resource目录下,编译时候直接就替换了 <profile> <id>pdt</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <ds.driverClass>com.my…

2017-05-10 17:02 · intellij idea · maven

配置文件没有编译

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from file [F:\NetStone-Aggregation\StoneWebService\target\ROOT\WEB-INF\classes\applicationContext-cache.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 11…

2017-05-09 15:30 · intellij idea · maven

maven 打包时mapper.xml打不进去问题

首先,来看下MAVENx项目标准的目录结构: <iframe id="iframe_0.6057847872536948" style="margin: 0px; padding: 0px; border-width: initial; border-style: none; width: 730px; height: 343px;" src="data:text/html;charset=utf8,%3Cstyle%3Ebody%7Bmargin:0;padding:0%7D%3C/style%3E%3Cimg%20id=%22img%22%20src=%22http://dl2.itey…

2017-04-26 13:22 · maven

maven替换本地repository里的jar包

系统升级或迁移,有一些jar包下载不到,这时对方传来一个zip包,里面有所需的jar包,手动更新某些下载不到的包到本地仓库,命令如下: mvn install:install-file -Dfile=C:\Users\Administrator\Desktop\lib\jcaptcha-1.0-all.jar -DgroupId=com.octo.captcha -DartifactId=jcaptcha -Dversion=1.0-all -Dpackaging=jar

2017-04-21 11:13 · intellij idea · maven

IDEA中,Maven项目POM文件中的依赖未报错(出现红色波浪线),但Maven Projects中的模块的Dependencies中的依赖却报错

依赖文件版本不对,修改pom文件中的版本号。

2017-03-29 14:56 · intellij idea · maven

解决IntelliJ IDEA无法读取配置文件的问题

1. 在project structure里面设置resources和source文件夹。 2. reimport一下maven文件 3. 重新clean package一下 再重启tomcat,应该就可以打包进去了。

2017-03-29 11:03 · intellij idea · maven

maven命令-P 参数

序言: maven 命令:clean package -Dmaven.test.skip=true -P product 1.命令很简单是:清class文件,打包构建,跳过 测试 ,注意最后一个 -P product,-P maven 会激活项目下的pom.xml配置的<profiles>标签下id为product [html] view plain copy <profiles> <profile> <id>product</id> <properties> <env>product</env> </properties> </profile> </profiles> 2.使用占位符上面配…

2017-03-22 09:12 · maven

Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing Embedd

spring boot启动时报错: Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean 但是用命令mvn clean package spring-boot:run -Plocal 可以启动。 则需要配置程序启动参数,如图所示。

2017-03-22 08:51 · intellij idea · maven

intellij新maven工程有问题,处理方法

1.检查maven下的settings.xml文件路径 2.project structure,看dependencies是否有问题如:maven library has broken path 3. 右键pom.xml文件,maven->reimport

2017-03-21 10:18 · intellij idea · maven

resource下加载resource bundle文件

今天用intellij idea maven项目加载resource/META下面的resource bundle文件。一直提示找不到,于是想把META加到classpath中,可是每次compile之后都需要手动加,很麻烦,换个思路,因为resource在classpath中,所以ResourceBundle rb = ResourceBundle.getBundle("META-INF/global");就搞定了 ,归到路径问题,思维不能定势啊。

2017-03-17 11:10 · maven