maven-2

In Maven 2, how do I know from which dependency comes a transitive dependency?

时间秒杀一切 提交于 2019-12-18 09:56:46
问题 I would like to know which dependency described in my pom.xml brings a transitive dependency in my target directory. To be more precise, I have the library "poi-2.5.1-final-20040804.jar" in my WEB-INF/lib directory and I would like to know which dependency in my pom.xml brings that. 回答1: To add to @David Crow, here's a dependency:tree example from the Maven site: mvn dependency:tree -Dincludes=velocity:velocity might output [INFO] [dependency:tree] [INFO] org.apache.maven.plugins:maven

Activate different Maven profiles depending on current module?

谁都会走 提交于 2019-12-18 07:09:28
问题 We have a multi module build with modules using different technologies, like Java and Flex. Is it somehow possible to activate different profiles based on the module that is compiled currently? I tried it with an activation like <profile> <id>flex</id> <activation> <file> <exists>${basedir}/src/main/flex</exists> </file> </activation> ... </profile But it didn't work, although the use of ${basedir} is documented in the Maven documentation (this is a bug in Maven). Is there a different

How to activate a Maven profile in a dependent module?

爱⌒轻易说出口 提交于 2019-12-18 05:45:19
问题 Suppose I have a module A:jar , whose runtime and compilation set of dependencies depends on the JDK version. In my example, I have a pre-jdk6-profile for JAXB API: prior to JDK 1.6.0 I need to include jaxb-api-nnn.jar as a compile dependency. This profile is placed to A.pom . I also have module B:war , which depends on A:jar . I want to be able to activate this profile on a build server to build the JDK 1.5.x deliverable. When I execute Maven with a given profile activated, I get the message

java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project

∥☆過路亽.° 提交于 2019-12-18 05:43:33
问题 hi guys i have maven 2 installed, when i use mvn clean or mvn install in the app root it works fine but when trying to use maven install inside a bash script i got the above exception: this is my script: #!/bin/sh #dirname='/home/myuser/workspace/myapp' DIRECTORY=$(cd `dirname $0` && pwd) cd $DIRECTORY mvn install -s resources/settings.xml $1 it was working fine with maven 3, but after i installed maven 2 and configured it, it stopped working and gave me above exception, i don't know what is

Maven - pass argument to use in exec-maven-plugin

最后都变了- 提交于 2019-12-18 05:02:32
问题 in my pom I've added the exec-maven-plugin to call a java class which will generate a file. This class requires some parameters to be passed to the main method, one of those is the location of an input file (outside the project). Until now I've been using a relative path for this which works fine: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <phase>test</phase> <goals> <goal>java</goal> </goals> </execution> </executions>

Maven. How to include specific folder or file when assemblying project depending on is it dev build or production?

坚强是说给别人听的谎言 提交于 2019-12-18 04:54:25
问题 Using maven-assembly-plugin <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.1</version> <configuration> <descriptors> <descriptor>descriptor.xml</descriptor> </descriptors> <finalName>xxx-impl-${pom.version}</finalName> <outputDirectory>target/assembly</outputDirectory> <workDirectory>target/assembly/work</workDirectory> </configuration> in descriptor.xml file we can specify <fileSets> <fileSet> <directory>src/install</directory> <outputDirectory>/</outputDirectory> <

Caching the repository index in m2eclipse

☆樱花仙子☆ 提交于 2019-12-18 04:48:09
问题 everytime i start with a fresh new workspace, m2eclipse downloads nexus-maven-repository-index.gz from the maven central repository. this is good. but, some times, i just want to start a new workspace, and not wait for it to download, it tried copying the whole .metadata directory from an old workspace to the new one, but the list of maven artifacts are still empty. is there a way i can cache it? or at least download the file once, and the copy/extract/repackage it so that m2eclipse thinks it

Could not calculate build plan :artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository

谁说我不能喝 提交于 2019-12-18 04:47:09
问题 I have a spring maven 2 project. I built it in terminal and everything is ok, I got build success, but when trying to import it to eclipse I got this error: Could not calculate build plan: The repository system is offline but the artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 is not available in the local repository. although I am getting build success in terminal and projects run fine. I made maven offline in eclipse, and disabled download index on startup any ideas why I

How to use maven resources also as test resources

五迷三道 提交于 2019-12-18 04:38:15
问题 I have a maven project that loads an xslt file and executes the transformation along with other processing on the result. Normally when the user runs the application, the user provides the xslt file path to be loaded. But I include some default xslt files bundled inside my application that the user can use without loading any external xslt file. I do this by adding them to src/main/resources/xslt. My problem is that I want to run tests against those xslt files in testing phase. How can I

Maven 2 - define dependency version from transitive dependency version

白昼怎懂夜的黑 提交于 2019-12-18 04:19:11
问题 I'll explain the question with my real situation. I use logback 1.0.1 for logging, and it includes SLF4J 1.6.4 as a dependency. I also use the SLF4J API bridges for legacy logging API's (java.util.logging, log4j and commons-logging), which are not explicit dependencies. These must also (preferrably) be version 1.6.4. Trying to make my pom.xml as neat and error-free as possible, I'd like to enforce that these API bridges be the same version as SLF4J. The only way I know is to manually define