【maven打包普通java项目 pom.xml配置】教程文章相关的互联网学习教程文章

eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.4.3解决方案【代码】

Multiple annotations found at this line: - Execution default-testResources of goal org.apache.maven.plugins:maven-resources- plugin:2.4.3:testResources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 () (org.apache.maven.plugin...

02.基于IDEA+Spring+Maven搭建测试项目--配置logback.xml【代码】

1<?xml version="1.0" encoding="UTF-8"?> 2<configuration> 3<!-- 控制台日志打印,测试环境和调试使用,发布生产需注释 --> 4<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> 5<encoder charset="utf-8"><!-- encoder 可以指定字符集,对于中文输出有意义 --> 6<!-- %.-1level 只显示信息级别的首字母,%-5level 左对齐显示信息级别全称 --> 7<!-- 如需自定义关键字,用 %mdc{键名} 表示,程序中用MDC.put(...

Maven打可执行包的pom.xml配置【代码】

单独打出可执行包,然后将依赖包打入lib文件价中<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>2.6</version><configuration><archive><manifest><addClasspath>true</addClasspath><classpathPrefix>lib/</classpathPrefix><mainClass>com.fxust.appmain.BatchMainFrame</mainClass></manifest></archive></configuration></plugin><plugin><groupId>o...

idea的maven项目不知道为啥下载不下来jar包,看本地仓库只是下载了一下xml文件,没有jar包问题【代码】【图】

确认了私服上的jar包能直接下载下来,而且jar包是正常的;但是就是不能通过idea下载,通过idea下载到本地仓库的只生成了.lastUpdated文件,检查了setting.xml文件、网络,私服,均无问题下载到本地仓库的点击了download source重新下载依旧不可行。  然后,在网上找到了一种解决的方法,在idea中打开Terminal窗口,在所要更新的pom.xml文件目录下执行:mvn dependency:sources  命令jar包被下载下来 点击执行mav的命令窗...

Maven系列一pom.xml 配置详解【代码】

<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"><!--父项目的坐标。如果项目中没有规定某个元素的值,那么父项目中的对应值即为项目的默认值。 坐标包括group ID,artifact ID和 version。--><parent><!--被继承的父项目的构件标识符--><artifactId/><!...

【maven】maven创建web项目-pom文件提示web.xml is missing and <failOnMissingWebXml> is set to true【图】

使用maven创建web项目,选择war类型后,pom文件红叉提示web.xml is missing and <failOnMissingWebXml> is set to true也有可能:初始创建了本项目为web项目,然后虽然把web.xml文件放在了WEB_INF下,这两个文件夹虽然放在webapp下了,但是还是报错 解决方法:这时候需要右击项目——>Java EE Tools——>Generate Deployment Descriptor Stub.然后系统会在src/main/webapp/WEB_INF文件加下创建web.xml文件。错误解决! is set to t...

【小技巧】Eclipse 中创建Maven项目后没有WEB-INF文件夹以及web.xml文件【图】

懒得截图了,一张图配下面步骤搞定。1、右键项目,选择propertities后选择图中①(被遮住了);2、先不②勾选去掉,点击Apply;然后在把②处勾选上。此时④位置会出现东东,点击蓝色超链接。填入WEB-INF创建的路径。maven项目填写src/main/webapp 记得勾选下面自动创建web.xml的选项,然后点击确定即可。补充:在步骤2中,④位置可能没有出现应该出现的结果,博主自己遇到的是版本不支持的错误提示。此时你要修改③位置处的版本。博主...

maven POM.xml内的标签大全详解【代码】

<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.0http://maven.apache.org/maven-v4_0_0.xsd"><!--父项目的坐标。如果项目中没有规定某个元素的值,那么父项目中的对应值即为项目的默认值。 坐标包括group ID,artifact ID和 version。 --><parent><!--被继承的父项目的构件标识符 --><artifactId /><!--被继承的...

Maven - 配置setting.xml【代码】

1、配置本地库路径<localRepository>C:/fyliu/mvn/repo</localRepository>2、配置中央仓库 <mirror><id>alimaven</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url></mirror><mirror><id>nexus</id><name>internal nexus repository</name><url>http://repo.maven.apache.org/maven2</url><mirrorOf>central</mirrorOf></mi...

关于项目既要使用ant脚本又要使用maven pom.xml文件的问题【图】

背景:项目使用的是ant脚本打包,但又需要maven去执行sonar代码扫描。所以项目中既有build.xml又有pom.xmlbuild.xml设置的打包后产物文件夹为target,maven运行后也会默认生成target文件夹,这样就会存在覆盖的问题,因为maven打包默认生成target文件夹,所以只能修改ant打包存放产物的文件夹,不和maven文件夹重名。 原文:http://www.cnblogs.com/shuaiqing/p/5659557.html

maven镜像设置 settings.xml【代码】

<?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 Licens...

在maven项目中的java文件中的xml/properties或者其他文件无法导出【代码】【图】

Maven项目下的java中的properties无法导出到classes中 解决方案 在本moudle中的pom.xml加入(有需要可以在总的项目中的pom.xml添加)<build><resources><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>true</filtering></resource><resource><directory>src/main/java</directory><includes><include>**/*.properties</inclu...

Maven项目pom.xml文件报:xxx\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF (系统找不到指定的路径。) 问题【图】

1、问题现象:  在Maven项目中的pom.xml文件的第一行:D:\learn\Java\eclipse-jee-mars-2-win32_x64\eclipse-workspace\taotao\taotao-manager-web\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF (系统找不到指定的路径。),如下图所示:2、原因分析  Maven刷新没有完成3、处理步骤  方法1:  1)找到eclipse的 Project 菜单选择 clean... 选项  2)选择 Clean all projects 或者 Clean projects selectd blow (选...

Maven之setting.xml 配置详解【代码】

文件存放位置全局配置: ${M2_HOME}/conf/settings.xml用户配置: ${user.home}/.m2/settings.xmlnote:用户配置优先于全局配置。${user.home} 和和所有其他系统属性只能在3.0+版本上使用。请注意windows和Linux使用变量的区别。 settings.xml详解声明规范<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="h...

利用mybatis generator插件反向生成Dao、Mapper.xml、pojo(通过maven)【代码】

直接进入主题,由于项目选择的利用maven构建,所以选择了利用maven的生成方式。(还有一种可自行百度)一、在pom.xml中添加插件<plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.2</version><configuration><!--配置文件的位置--><configurationFile>src/main/resources/Personal-GeneratorConfig.xml</configurationFile><verbose>true</verbose><overwrit...