maven-2

maven2: how to share a plugin configuration between parent and children pom?

大憨熊 提交于 2019-12-06 19:09:15
问题 I'm trying to reduce copy/pasting in our maven pom files. We have one master pom and many children projects pom inheriting from the master. I want to share a complex plugin definition looking like: <plugins> ... <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>appassembler-maven-plugin</artifactId> <configuration> <!-- many xml lines here --> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>assemble</goal> <goal>generate-daemons</goal> <goal>create

Unit Test in Maven requires access to the src/main/webapp Directory

佐手、 提交于 2019-12-06 18:46:38
问题 I am trying to unit test a webapp that I am developing in Maven/Eclipse. It is a Spring MVC webapp, and I need some unit tests to test my model controller. To do this, I need to use my webapp config .xml files to inject the controller, however, all my configuration (and other associated files that the configs reference) are in the src/main/webapp directory (as per Maven convention) - there are a lot of files in here that i need to reference in my tests, but they are not available when running

Maven 2 - different dependency versions in test and compile

爱⌒轻易说出口 提交于 2019-12-06 18:44:44
问题 I have project that depends on commons-httpclient [2.0] (compile). I would like to write some jbehave tests - jbehave-core 3.4.5 (test). Both this dependencies depend on commons-lang but in different versions - 1.0.1 and 2.5. When I execute mvn package I get [BUID FAILURE] in tests section. There is an exception for my testcase in surefire-plugin output: java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.substringBeforeLast(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

How do I get verbose output from Maven in the Eclipse console?

末鹿安然 提交于 2019-12-06 18:43:32
问题 I am trying to figure out why a maven project is not packaging a jar. This is a builds successfully on my coworkers computers. There are no errors when I build, but the jar is not in the destination folder. I was hoping that by getting more verbose output from the maven process, that I could determine the differences between what is happening on my installation, and on other peoples installations. 回答1: Choose "Run As" -> "Maven build.." or open your Run/Debug configuration There you can

A Unicode Maven ArtifactId

馋奶兔 提交于 2019-12-06 17:27:35
问题 I just tried creating a project in Maven whose artifactId is made up entirely of non-English characters ("日本国"). I get the following feedback from Maven: ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: com.worldevolved:日本国 POM Location: /tmp/日本国910145040748591900/pom.xml Validation Messages: [0] 'artifactId' with value '日本国' does not match a valid id pattern. Is there

How can I get the list of artifacts in my Maven repository?

孤者浪人 提交于 2019-12-06 17:11:15
问题 Is there a Maven goal to list the artifacts that are stored in my local Maven repository? 回答1: I'm not aware of any plugin doing that and, to be honest, I don't get the point. Maybe you could just use your OS file search feature to achieve your goal. If really you want to do this from Maven, then execute this command using the maven-exec-plugin. Another option would be to use the maven-antrun-plugin if you can find an Ant task allowing to find files. But, as I said, I don't get the point of

Junit maven Error occured in starting fork, check output in log [closed]

邮差的信 提交于 2019-12-06 16:34:51
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . BUILD ERROR Error occured in starting fork, check output in log with using maven 2.2.1 and surefire plugin 2.11 while running junit test-cases 回答1: You

Unable to resolve ${project.version} in child pom.xml from parent pom.xml

两盒软妹~` 提交于 2019-12-06 15:35:31
I have a project hierarchy as : A - pom.xml |__ B - pom.xml |__ C - pom.xml The property project.version is defined in pom.xml defined in A. Other two pom's specify the parent tag and the corresponding relative path to the respective parent pom's. <parent> <groupId>com.GRP.id</groupId> <artifactId>ARTIFACT_ID</artifactId> <version>${project.version}</version> <relativePath>../pom.xml</relativePath> </parent> The issue here is that maven is not able to resolve ${project.version} and is using it as is. This is throwing the following exception when executed from A/B/C: [ERROR] The build could not

Specifiy classpath for maven

喜你入骨 提交于 2019-12-06 15:25:30
Quite new to maven here so let me explain first what I am trying to do: We have certain JAR files which will not be added to the repo. This is because they are specific to Oracle ADF and are already placed on our application server. There is only 1 version to be used for all apps at anyone time. In order to compile though, we need to have these on the class path. There are a LOT of these JARS, so if we were to upgrade to a newer version of ADF, we would have to go into every application and redefine some pretty redundant dependencies. So again, my goal is to just add these JARs to the

Jacoco code coverage show 0% coverage on Jenkins

久未见 提交于 2019-12-06 13:50:15
问题 I have read most of the answers available for similar questions but none of those fit to answer my question. My profile in pom file looks like this: <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.7.201606060606</version> <executions> <!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven the Surefire plugin is executed. --> <execution> <id>pre-unit-test</id> <goals> <goal>prepare