maven-2

Maven Plugin Logger Compatibility

陌路散爱 提交于 2019-12-04 12:59:39
问题 I am writing a Maven plugin (Mojo) that imports a Jar library used by other projects. At least one of the classes in that library use Apache Log4j for logging, but Log4j is not going to be properly configured by the logger that Maven provides to the Mojo. Is there any simple way to bridge between these? Unfortunately, org.apache.log4j.Logger and org.apache.maven.logging.Log do not share a common superinterface or superclass, so I can't simply have a setLog() type function. Any suggestions

Replace a Source file in maven compile

放肆的年华 提交于 2019-12-04 12:57:26
I have to replace a Java source file during maven compile if a special profile is active. I thought about just excluding the file from the standard src/main/java/ and including it from another source directory like src/main/java2/ . But since the files have to have the same name and package the exclude always wins and the file from the other directory gets never included... Any known working way to do that? I would use the Maven Antrun Plugin to rename the "original" source file and copy the "special" source file from src/main/java2 to src/main/java before the compile phase. After compile ,

Maven jetty plugin - delay when starting in background mode

坚强是说给别人听的谎言 提交于 2019-12-04 12:55:46
I start a jetty server on linux using nohup mvn jetty:run & to run it in background and to stay when I quit from the console. Usually (mvn jetty:run) it starts in seconds, but in this case it takes about minute to start. What can be the cause of such a delay? Stack trace Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0-b16 mixed mode): "Attach Listener" daemon prio=10 tid=0x000000004bba8c00 nid=0x560a waiting on condition [0x0000000000000000..0x0000000000000000] java.lang.Thread.State: RUNNABLE "Timer-1" daemon prio=10 tid=0x00002aaac053d800 nid=0x55fb in Object.wait()

Collapsing parent POM into the child

♀尐吖头ヾ 提交于 2019-12-04 12:16:07
问题 Given a maven project with a parent POM - including mostly plugin and dependency versions - how can I generate a POM which takes the information from the parent, places it into the child and removes the reference to the parent? Ideally this would be done with the maven-assembly-plugin. Update : I need this done automatically, since manually it's boring and tedious. Update 2 : I'm preparing the source code for an external and want to deliver only one project, not the whole family. 回答1: I had a

maven install and deploy 3rd party dependencies with simple command line

僤鯓⒐⒋嵵緔 提交于 2019-12-04 12:00:21
问题 We have a number of third party dependencies that aren't hosted anywhere. For each of these we have a jar file that we'd like to be able to install and/or deploy to our repository. Some of the jar files have their own dependencies and we also need to declare these. We've made pom.xml files for each jar file that declare the groupId, artifactId, dependencies, etc. These pom.xml files all have a common parent pom that declares some of the common info (e.g. <repositories> and

Using native dependencies inside Maven

为君一笑 提交于 2019-12-04 11:38:06
A POM dependency contains native libraries (DLLs inside a JAR file). How do I programmatically look up the path of the downloaded JAR file so I can pass it into "java.library.path"? Answering my own question: http://web.archive.org/web/20120308042202/http://www.buildanddeploy.com/node/17 In short, you can use the maven-dependency-plugin:unpack goal to extract the libraries into a known path, and pass that into java.library.path : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>compile</phase>

How to: database versioning with maven2?

送分小仙女□ 提交于 2019-12-04 11:12:04
问题 I am finding any maven plugin for versioning database changes. 回答1: There are a few plugins that offer some support for this task: Maven LiquiBase Plugin Maven Database Migration Plugin DbMaintain Maven Plugin (a plugin for DbMaintain, the famous tool from Unitils) I don't have much experience with them, we currently use a custom tool to apply our change scripts. But the Maven Database Migration Plugin is a serious candidate to replace it. LiquiBase is pretty famous but also different,

Duplicate file when deploying apk

耗尽温柔 提交于 2019-12-04 11:11:49
This problem seems to come up for a few people, but I haven't been able to apply the solution suggested in other threads for one reason or another so... I am trying to build a simple android app with an embedded webserver. The server of choice if jetty. I am using maven to manage dependencies with the maven-android-plugin. I have added jetty-server v8.x as a dependency with the default scope. When I try and deploy my apk to the sandbox I get an error Found duplicate file for APK: about.html So the file in question is from the jetty package, or rather it is found in two jetty packages, one

Adobe BlazeDS 4 artifacts maven repository?

核能气质少年 提交于 2019-12-04 10:52:45
问题 Does anybody know if Adobe has a maven repository to download the latest BlazeDS artifacts from? I only can find the "older" versions of BlazeDS in the central mvn repository. The other option is to deploy the downloaded BlazeDS jar files from the Adobe website into my local repository but it would be nice when Adobe provides the artifacts via a maven repository. 回答1: No, Adobe does not have a maven repository for BlazeDS. This thread can help. You can find BlazeDS 4 in the Spring maven

unit-testing maven plugins

主宰稳场 提交于 2019-12-04 10:48:47
问题 I'm looking for information about how to write unit tests for Maven plugins. Although there's a page on the Maven site about this topic, there's only one example unit test, which does nothing useful. I also found this wiki page, but it hasn't been updated for more than 4 years, so I'm reluctant to invest any faith in it. I checked the book "The Definitive Guide to Maven", but it doesn't even mention the subject. I'd like to write my unit tests in either Groovy or Java, and would appreciate