maven-plugin

Which sonar-maven-plugin version to use?

血红的双手。 提交于 2019-11-29 03:01:39
I am wondering which sonar-maven-plugin in which version I should use. As far as I know there is a org.codehaus.mojo version and two org.codehaus.sonar versions ( sonar-maven3-plugin , sonar-maven-plugin ). As far as I understand the sonar-maven3-plugin is now deprecated and the org.codehaus.sonar:sonar-maven-plugin should be used instead. However those org.codehaus.sonar version are tied to a certain version of the sonar server, therefore it makes probably no sense to use them directly. To be able to deal with this there is the org.codehaus. mojo :sonar-maven-plugin which checks which sonar

component lookup exception with org.apache.maven.repository.RepositorySystem in Maven plugin testing

主宰稳场 提交于 2019-11-29 02:56:14
I'm trying to use maven-plugin-testing-harness version 2.1 with the following test case: public class FooTest extends AbstractMojoTestCase { @Override protected void setUp() throws Exception { super.setUp(); } public void testSomething() throws Exception { // todo } } The test fails at the setUp() call: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException role: org.apache.maven.repository.RepositorySystem roleHint: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:257) at org.codehaus.plexus

now getting 401 unauthorized in jenkins when deploying artifact to archiva maven repo

一世执手 提交于 2019-11-29 02:34:34
This used to work before I upgraded Jenkins to 1.494. Now I get this error in Jenkins when using the build promotion plugin to copy the war artifact to the snapshot repo: ERROR: Failed to deploy artifacts: Could not transfer artifact com.blah.data:RestWebServices:war:1.0-20121224.163825-2 from/to archiva.apache.snapshots (http://10.31.31.64:8080/archiva/repository/snapshots): Failed to transfer file: http://10.31.31.64:8080/archiva/repository/snapshots/com/blah/data/RestWebServices/1.0-SNAPSHOT/RestWebServices-1.0-20121224.163825-2.war. Return code is: 401, ReasonPhrase:Unauthorized. org

Merge properties files with Maven assembly

旧时模样 提交于 2019-11-29 01:52:10
I have a problem with maven assembly plugin. I have a maven project which use several jars. Each jar contains configuration files. With another project, I use maven assembly plugin to assemble all configurations in unique jar. All work fine but unfortunately, two files are the same name and the second overwrites the first. I don't achieve to tell maven to merge the two files instead of overwrite. Someone knows how to do that ? Thanks. It is not exactly what you are looking for, but I would use http://maven.apache.org/plugins/maven-antrun-plugin/ plugin to run ant concat task http://ant.apache

Downloading complete maven remote repository to Local repository?

江枫思渺然 提交于 2019-11-29 01:25:56
Is there any to get the entire remote repository, say from http://repo1.maven.org/maven2/ , to my local repository (to %USERPROFILE% )? From http://maven.apache.org/community.html : Being a Good Maven Citizen The concept of a public repository built into the core architecture of Maven makes it necessarily community-centric. There are a few simple things that Maven users may do to help keep that community thriving. Be a Kind Public Repository User The best thing that a user can do is to set up their own remote repository mirror containing the projects needed. There are several tools to make

Minimize an Uber Jar correctly, Using Shade-Plugin

十年热恋 提交于 2019-11-29 01:07:27
I am using the Maven-Shade-Plugin to create a runnable Uber-jar. According to the last frame on this page , the size of the jar can be minimized by using: <configuration> <minimizeJar>true</minimizeJar> </configuration> But this feature does not take into consideration the classes that are declared in the log4j.properties file. Hence, e.g. org.apache.log4j.appender.TimeAndSizeRollingAppender is not included in the Uber-jar, even though it’s declared in the log4j.properties file. I believe I will face the same problem with Spring. If my code only refers to interface A and my Spring file

Excluding “provided” dependencies from Maven assembly

北慕城南 提交于 2019-11-28 22:29:33
问题 I am trying to use the Maven assembly plugin to build a jar-with-dependencies, except those that have provided scope. I have copied the jar-with-dependencies into an assembly.xml file and configured its use in my pom. Here it is for reference: <?xml version="1.0" encoding="UTF-8"?> <assembly> <id>injectable-jar</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <unpack>true</unpack> <scope>runtime</scope> <

Can I set the project version with a buildnumber-maven-plugin?

我怕爱的太早我们不能终老 提交于 2019-11-28 20:46:33
I'm trying to add the svn.revision to project version as a build number and can't seem to do so. My jar has the correct name durin packaging, but its installed in the my local repository it is as if ${buildNumber} is/was undefined when the version was set. I get foo-1.0.0-SNAPSHOT- ${buildNumber} instead of foo-1.0.0-SNAPSHOT- 304 Any idea what I'm doing wrong or is adding a revision to the project version a bad idea? Thanks for the help. <project> ... <version>1.0.0-${release.identifier}-${buildNumber}</version> <properties> <release.identifier>SNAPSHOT</release.identifier> </properties> ...

How can I download Maven artifacts within a plugin?

不打扰是莪最后的温柔 提交于 2019-11-28 20:20:30
问题 I have a Maven plugin that takes a groupId, artifactId, and version in its confiugration. I want to be able to download that artifact from the remote repositories and copy the file into the project. I can't figure out how to download the artifact though. I understand that I can resolve dependencies using the dependency plugin, but I need it to happen inside my plugin. How can I do this? 回答1: Your plugin needs to create an Artifact using the ArtifactFactory and the groupId, artifactId and

Maven 2.1.0 not passing on system properties to Java virtual machine

坚强是说给别人听的谎言 提交于 2019-11-28 18:38:20
问题 We use the command line to pass on system properties to the Java virtual machine when running our Hudson builds on a Linux box. It used to work quite well in 2.0.9 by since we upgraded to 2.1.0 it has stopped working altogether. The system properties just never make it to the Java virtual machine. I have created a small test project and indeed it does not work at all. This should work just fine with Maven 2.0.9: mvn2.0.9 -Dsystem.test.property=test test But this will fail: mvn2.1 -Dsystem