maven-2

Maven: how to filter the same resource multiple times with different property values?

霸气de小男生 提交于 2019-12-02 20:40:57
Our project uses Log4J, configured via log4j.properties file. We have multiple production servers, which log to different log files, so that the logs can be differentiated. So log4j.properties for node 1 looks like this: ... log4j.appender.Application.File=D:/logs/application_1.log ... log4j.appender.tx_info.File=D:/logs/tx_info_1.log ... while the log4j.properties for node 2 looks like ... log4j.appender.Application.File=D:/logs/application_2.log ... log4j.appender.tx_info.File=D:/logs/tx_info_2.log ... We already use Maven profiles for generating our server configuration. Up to now it

Converting Ant Web Application Project to Maven Project

人盡茶涼 提交于 2019-12-02 20:40:23
问题 Hi I have a running code project build using Ant now what i need is to convert it to maven , i browse for the solution and what i done is simply creating a new maven web project and added all my src files to src/main/java and all the xml files (e.g security.xml,tiles-config.xml,web.xml,properties files,jsp folder etc) to webapp/web-inf/ folder. Is that correct so far ?? The main question how to create a pom file , I mean as I used a lot of jar to support the code , how to mention that in my

Maven Buildnumber plugin - Git

徘徊边缘 提交于 2019-12-02 20:37:29
The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a workaround for the time being? I recently switched from SVN to GIT and have found it to be an easy transition, but this is the only thing that I don't have working presently. Walter Pascal Thivent Well, there is MOJO-1199 about the buildnumber plugin and GIT support but the patches haven't been applied yet. However, it seems that Antony Stubbs did some work around this and made it available in this git mirror . Have a look at it. I use this Maven plugin: https://github.com/ktoso/maven-git-commit-id-plugin and have it

IntelliJ IDEA debugger skips breakpoints when debugging Maven tests

杀马特。学长 韩版系。学妹 提交于 2019-12-02 20:35:08
I am trying to debug Maven tests in IntelliJ IDEA. When I open IDEA's Maven Projects view and right-click on test goal, I get an option to debug it. Clicking it executes this goal but the execution never stops at any breakpoints. What am I missing? Thanks. milan One solution would be to use remote debugging: configure the surefire plugin: <debugForkedProcess>true</debugForkedProcess> ; run the test (will wait for a remote debugger to connect) create and run a remote debug configuration in IntelliJ (will hit your breakpoint); the port to connect to is 5005. Just disable the forked mode -

Accessing an Artifactory/Maven Repo that requires basic-auth

一世执手 提交于 2019-12-02 20:33:14
I have an Artifactory repo that sits behind basic authentication. How would I configure the settings.xml to allow access? <mirrors> <mirror> <id>artifactory</id> <mirrorOf>*</mirrorOf> <url>https://myserver.example.com/artifactory/repo</url> <name>Artifactory</name> </mirror> </mirrors> <servers> <!-- This server configuration gives your personal username/password for artifactory. Note that the server id must match that given in the mirrors section. --> <server> <id>Artifactory</id> <username>someArtifactoryUser</username> <password>someArtifactoryPassword</password> </server> So server tag is

How to put maven project version in war file manifest?

蹲街弑〆低调 提交于 2019-12-02 20:25:11
I need to have Maven insert the version number from the POM file into the manifest located in the WAR file under /WEB-INF/manifest.mf. How do I do this? I was able to easily file documentation for doing this in a JAR file using the maven-jar-plugin, but that does not work on a WAR file. Thanks for the help! Figured it out using the maven-war-plugin. See the configuration below: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <archive> <manifestEntries> <version>${project.version}</version> </manifestEntries

Best way to create a maven artifact from existing jar

£可爱£侵袭症+ 提交于 2019-12-02 20:13:05
I'm mavenizing some projects. These projects all depend on a number of libraries, most of them are available in the maven repo. For the other libraries, I'd like to create a maven artifact, so I can use it as an dependency. The problem is, I only have jar files of these libraries. What is the best way to create artifacts from existing jar files? If you're not using a remote repository (which is a common situation for personal development), simply install these artifacts in your local repository using the install:install-file mojo: mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group

java.net maven repo - JMS artifact missing

送分小仙女□ 提交于 2019-12-02 20:12:23
I just created a new Maven project using the default archetype and added the following dependency to my POM file. <dependencies> <dependency> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> <version>1.1</version> <scope>compile</scope> </dependency> </dependencies> Realizing that the Sun's JARs are not on Maven central due to licensing issues, I added the following Maven repo to my POM (I know this is bad practice though and that it needs to be added to a settings.xml) <repositories> <repository> <id>Repo ID</id> <layout>default</layout> <name>Java.net Maven repo</name> <releases>

What's the minimum classpath for an Axis2 client?

◇◆丶佛笑我妖孽 提交于 2019-12-02 20:05:19
I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB? ( Note: This response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.) In maven2, the minimum dependency set to make an ADB client work ("ADB" as in the way you created the Java classes from the WSDL) is this: <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-kernel</artifactId>

How can I display a message in Maven

回眸只為那壹抹淺笑 提交于 2019-12-02 19:56:04
How can I display a message in Maven? In ant, we do have "echo" to display a message, but in maven, how can I do that? You can use the antrun plugin: <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>generate-resources</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <echo>Hello world!</echo> </tasks> </configuration> </execution> </executions> </plugin> One issue though is that you have to choose what phase of the build lifecycle to bind this to (my example has the plugin bound to generate-resources ). Unlike Ant, you aren't controlling the