maven-2

Maven POM file for installing multiple 3rd party commercial libraries

倾然丶 夕夏残阳落幕 提交于 2019-12-20 09:00:00
问题 I have a bunch of projects which are dependant on a set of commercial 3rd party libraries. We currently don't have a company repository so I have to install the libraries in my own local repo. Running mvn install:installFile -Dpackaging=jar -Dfile=<file> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> for each file is rather tedious. Could create a bat file, but is there a way to do this using maven? I'm thinking a project for all the jars and a single pom file with all the

Setup Java 6 annotation processing configuration for eclipse compiler with maven

谁说我不能喝 提交于 2019-12-20 08:45:30
问题 What's the best way to setup the eclipse project compiler configuration for Java 6 annotation processors? My solution is to setup the org.eclipse.jdt.apt.core.prefs and factorypath files manually. This is a bit cumbersome: Reference the processor jar in the factorypath file Configure the eclipse annotation processor output directory (org.eclipse.jdt.apt.genSrcDir property in org.eclipse.jdt.apt.core.prefs ) Add the eclipse annotation processor output directory as source folder One problem is

Filtering Maven files into WEB-INF

安稳与你 提交于 2019-12-20 08:39:54
问题 I am trying to add some filtering to the application context file, which resides in the WEB-INF directory. I have the file which is to be filtered (xmlgateway-context.xml) in the folder /src/main/resources. I have the properties files (config-e05.properties) in the folder src/main/filters And I have the POM set up as follows: <!-- environment profiles --> <profiles> <profile> <id>e04</id> <properties> <targetenv>e04</targetenv> </properties> </profile> <profile> <id>e05</id> <properties>

How do I upgrade the version of a maven plugin?

怎甘沉沦 提交于 2019-12-20 08:26:27
问题 I am using the maven-ear-plugin version 2.3.1 - I know there is a new version available: http://maven.apache.org/plugins/maven-ear-plugin/ I can't work out how to upgrade to the latest version? 回答1: The default plugin versions are inherited from the Super POM, and you can check them with mvn help:effective-pom . If you want to override the version provided there, add this to your POM: <project> <build> <plugins> <plugin> <artifactId>maven-ear-plugin</artifactId> <version>2.3.1</version> <

Install parent POM without building Child modules

℡╲_俬逩灬. 提交于 2019-12-20 08:22:06
问题 I have a parent POM in a Maven project, with this structure: parent | --------------- | | child1 child2 I want to install the POM of the "parent" in the local REPO to allow child1 take some changes that I did in the dependencyManagement, but I cannot do a regular "clean install" because "child2" is broken and will not build. Which is the proper way to do this with maven (other than going to the parent pom and commenting the "child2" module). 回答1: Use the '-N' option in the mvn command. From

Which dependency do I need for this import in Maven

放肆的年华 提交于 2019-12-20 07:26:23
问题 I am trying to convert a Java project which uses Ant into a Maven project, but am having difficulties finding out which dependencies to include. How do I find out dependency settings for a particular import? 回答1: Provided you currently have the jars on your build-path, at least in Eclipse, when you CTRL + click an imported class, and you have selected "link with editor" on the package explorer, the bytecode outline is opened and the file is selected within the jar it is located. Then, having

log4j can't initialize with my log4j.properties

有些话、适合烂在心里 提交于 2019-12-20 06:14:41
问题 I have a simple log4j.property file and a simple program that use log4j. But when I run my jar I see only this log4j:WARN No appenders could be found for logger (package com.mycompany.hellolog4j). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Here is how I use logger: package com.mycompany.hellolog4j; import java.io.File; import java.io.IOException; import org.apache.log4j.*; public class

difference between keeping a plugin inside a project and inside a profile

女生的网名这么多〃 提交于 2019-12-20 05:24:29
问题 Can anyone please explain the functionality for below? A) Actually below code is working for me, BUT I didnt understood why we need to use below for maven-war-plugin <warSourceDirectory>src/main/webapp</warSourceDirectory> <webXml>src/main/webapp/WEB-INF/web.xml</webXml> B) whats the difference between keeping a plugin inside a project and inside a profile? ( say maven-surefire-plugin ) which way is better (assume I MUST use <profile> tag in my pom.xml) 回答1: Part A warSourceDirectory is

Unable to compile and create maven project for hibernate

谁都会走 提交于 2019-12-20 03:56:09
问题 I am trying to create a Eclipse project from Hibernate tutorials under path \hibernate-distribution-3.5.3-Final\project\tutorials\eg using command line mvn eclipse:eclipse . But i am getting this error Reason: POM 'org.jboss.maven.plugins:maven-jdocbook-style-plugin' not found in repository: Unable to download the artifact from any repository Can anyone faced this issue with the latest release of Hibernate? 回答1: I don't know what version of the plugin you need but JBoss has moved recently to

mvn package fails with Required Artifact Missing even though it exists in my Remote Repository

≡放荡痞女 提交于 2019-12-19 19:46:49
问题 I'm trying to run mvn clean package on my Maven project and it fails with the message: "required artifact is missing" for the artifact net.ezswitch:ResourcesComponent:jar:0.0.14 I've configured my settings.xml to include my Remote Repository and if I navigate, on my browser, I can actually find this Jar in my repository, but Maven can't, somehow. I've checked that the Maven version that I'm running is the one for which the settings.xml file that I've edited takes effect, because if I disable