maven-2

how to get the super pom basedir in a child module pom?

五迷三道 提交于 2019-12-03 05:25:51
I want to define a local repository in my maven project. I've got a super pom and several child modules. My file structure is : /root /repository /child pom.xml pom.xml in my super pom I define : <repository> <id>my-local-repo</id> <url>file://${basedir}/repository</url> </repository> The problem is that in my child pom, the repository defined in my super pom refers to /root/child/repository and so, dependencies cannot be found... Is there a way to define a path always relative to the super pom ? If not, what's the best way to solve the problem ? Ricardo Silva In this case, at first you could

Where is log output written to when using Robolectric + Roboguice?

五迷三道 提交于 2019-12-03 05:25:38
问题 I'm using Robolectric to test Android. I'm running my tests via maven, e.g. mvn -Dtest=LogTest test If I have code that writes to the logs, such as Log.d("TAG", "blah"); or using Roboguice's Ln Ln.d("blah"); I don't see any output in maven's surefire logs (text files). Ideally, I actually want simple log statements to go to the console. I can write to the console by using System.out.println("blah") , but of course I'd rather use the supported logging APIs. So my question is, why am I not

Eclipse m2eclipse getting dependencies from local repository

那年仲夏 提交于 2019-12-03 05:15:49
I have dependencies installed local on my machine (~/.m2/repository/blah/blah/blah) and m2eclipse is not recognizing them as there - I think m2eclipse is using its own maven instance. Is there any way to force m2eclipse to use the local maven installation in osx? I had the same problem, and this is what worked for me. Using Eclipse Indigo: Windows->Show View->Other In the pop-up: Maven->Maven Repositories Once the view is displayed, right click on the appropriate repo, and select "Rebuild Index" Wait a few seconds and done! I have dependencies installed local on my machine (~/.m2/repository

How to instruct Maven to ignore my main/resources/persistence.xml in favor of test/…?

痞子三分冷 提交于 2019-12-03 05:15:05
I have two persistence.xml files, for the sake of testing: src/main/resources/META-INF/persistence.xml src/test/resources/META-INF/persistence.xml How to instruct Maven to ignore the first file during testing? Now it is not ignored since OpenEJB says: ERROR - FAIL ... Finder: @PersistenceContext unitName has multiple matches: unitName "abc" has 2 possible matches. Check out the alternate descriptors functionality which is aimed at what you're trying to do. Try this setup: src/main/resources/META-INF/persistence.xml src/main/resources/META-INF/test.persistence.xml Then you can construct OpenEJB

Maven String Replace of Text Web Resources

别等时光非礼了梦想. 提交于 2019-12-03 05:14:42
I have a Maven web application with text files in src/main/webapp/textfilesdir As I understand it, during the package phase this textfilesdir directory will be copied into the target/project-1.0-SNAPSHOT directory, which is then zipped up into a target/project-1.0-SNAPSHOT.war Problem Now, I need to do a string replacement on the contents of the text files in target/project-1.0-SNAPSHOT/textfilesdir. This must then be done after the textfilesdir is copied into target/project-1.0-SNAPSHOT, but prior to the target/project-1.0-SNAPSHOT.war file being created. I believe this is all done during the

Maven Proxy settings.xml ignored

℡╲_俬逩灬. 提交于 2019-12-03 05:13:37
Maybe someone can help me with the following Problem: I have declared a proxy in M as described at maven - Configuring a proxy . For some reason the proxy is ignored, although the proxy itself works correctly with maven when setting the proxy via command line. When calling the maven goal like this, it works: mvn -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 eclipse:eclipse Any suggestions for this problem? VonC When settings.xml is ignored, I tend to check first if the environment variable M2_HOME : exists in the current shell session refers to the parent directory of said settings

Adding Hibernate 3.5.x to a maven pom.xml build

旧城冷巷雨未停 提交于 2019-12-03 05:12:33
I added the JBoss Maven repo to my pom.xml file like this... <repositories> <repository> <id>jboss</id> <url>http://repository.jboss.org/maven2/</url> </repository> </repositories> And I added Hibernate itself like this... <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.5.1-Final</version> </dependency> But when I try to build my application I see this error.... Downloading: http://repository.jboss.org/maven2//org/hibernate/hibernate/3.5.1-Final/hibernate-3.5.1-Final.jar [INFO] Unable to find resource 'org.hibernate:hibernate:jar:3.5.1-Final' in

How can I execute several maven plugins within a single phase and set their respective execution order?

吃可爱长大的小学妹 提交于 2019-12-03 05:04:00
I would like to breakup certain phases in the maven life cycle into sub phases. I would like to control the execution flow from one sub-phase to another, sort of like with ant dependencies. For example, I would like to use the NSIS plugin in order to package up my project into an installer at the package stage, AFTER my project had been packaged into a war file. I would like to do all that at the package phase. Is that possible? Thanks Plugins bound to the same phase should be executed in the same order as they are listed in the POM. Under certain circumstances (e.g. if you bind the same

Nexus supports Mass upload of artifacts?

陌路散爱 提交于 2019-12-03 04:55:49
问题 I wanted to know if we can have mass upload of artifacts to the repository in Nexus. 回答1: You can do it in a variety of ways: Use the Nexus artifact upload page (note this only works for multiple artifacts with the same groupId and artifactId). Set up a script, with multiple invocations of the maven-deploy-plugin's deploy-file goal, one for each artifact. If you have access to the file system, you can copy the files directly into [sonatype-work]/storage/[repository-name] . If you do this, set

How do I suppress maven assembly plugin skipping files that are already added? Or allow overwrite?

陌路散爱 提交于 2019-12-03 04:50:17
For weeks, I've been wrestling with maven, getting it to deploy our project "properly." I'm almost done but I have one stubborn little problem: When I use the maven assembly plugin with the "directory" goal as in mvn assembly:directory I get LOTS of console output like the following: [INFO] tomcat/conf already added, skipping [INFO] tomcat/conf/Catalina already added, skipping [INFO] tomcat/conf/Catalina/localhost already added, skipping [INFO] tomcat/webapps already added, skipping I've written my own assembly descriptor that basically copies several FileSets into various sub-directories