maven-2

How to exclude dependency in a Maven plugin?

眉间皱痕 提交于 2019-12-17 07:25:36
问题 I have a project that needs the following Maven jibx plugin: <build> <plugins> <plugin> <groupId>org.jibx</groupId> <artifactId>maven-jibx-plugin</artifactId> <version>1.2.2</version> ... </plugin> </plugins> </build> Inside the jibx plugin pom, there is a xpp3 dependency which I want to exclude from my project build process (due to some reason I cannot have it inside my private repository). Is there a way to config my pom.xml (not the plugin pom) to exclude that dependency? EDIT : I tried to

maven-archetype-webapp eclipse problem

旧街凉风 提交于 2019-12-17 07:09:31
问题 I'm trying to create a very simple webapp with maven and eclipse, but I'm having no joy at all, in fact the reverse of joy. I go to File -> New Project, select Maven Project, and select the maven-archetype-webapp. When I finish the wizard, a webapp structure gets generated but with no 'java' directory under main, just resources and webapp. So I right click on main and select new Class. The class gets created under resources (?!), and furthermore, there seems to be no compilation of it by java

Maven assembly : add different version of the same artifact

本秂侑毒 提交于 2019-12-17 06:46:54
问题 I create my application archive with the maven assembly plugin. All the dependency present in my pom are included without any problem. Now I need to include two or more version of the same artifact. If in my pom I put <dependencies> [...] <dependency> <groupId>db.test</groupId> <artifactId>my-model</artifactId> <version>1.0.3</version> </dependency> <dependency> <groupId>db.test</groupId> <artifactId>my-model</artifactId> <version>1.1.0</version> </dependency> </dependencies> Of source the

Maven : Should I keep or remove declared dependencies that are also transitives dependencies?

十年热恋 提交于 2019-12-17 06:37:18
问题 Do you think it is a good practice to remove every transitive dependencies that can be found in a maven pom? Example: My project depends on A and B. B is also a transitive dependency of A. Should I keep B in my pom or remove it ? What is the best: having all known jars, even transitive one, declared on the pom or keeping only the top level jars ? This is a little bit subjective, but I am trying to clean some huge poms (parent and children) with a lot of transitive dependencies. I want to keep

Maven classpath order issues

给你一囗甜甜゛ 提交于 2019-12-17 06:05:27
问题 Does anyone know of a way to set a specific classpath order in Maven2, rather than the random ordering I appear to experience at the moment? There are a number of legitimate reasons for wanting to do this: A vendor has supplied a patch jar, which contains overriding classes for a previously released jar and therefore the patch jar must appear first in the classpath ordering. Two jar's found on the classpath discovered by traversing pom dependencies contain the same class in the same package

How to update maven repository in Eclipse?

纵然是瞬间 提交于 2019-12-17 05:41:27
问题 Assuming you're already using the m2eclipse plugin, what can you do when it doesn't update the dependencies to the latest in your repo? For example, on the command line, you can just add the -U flag as in mvn clean install -U …to force the dependencies to be updated. Is there something like this within Eclipse? (It doesn't always seem to pick up the latest updates.) 回答1: You can right-click on your project then Maven > Update Snapshots . 回答2: In newer versions of Eclipse that use the M2E

How can I tell jaxb / Maven to generate multiple schema packages?

老子叫甜甜 提交于 2019-12-17 05:39:11
问题 Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>src/main/resources/dir1</schemaDirectory> <schemaIncludes> <include>schema1.xsd</include> </schemaIncludes> <generatePackage>schema1.package</generatePackage> </configuration> </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2<

Disable a Maven plugin defined in a parent POM

一个人想着一个人 提交于 2019-12-17 04:44:11
问题 I am using a parent POM that defines a plugin that I do not want to be run in a child POM. How can I disable the plugin in the child pom completely? Constraint: I cannot change the parent POM itself. 回答1: The following works for me when disabling Findbugs in a child POM: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <executions> <execution> <phase>none</phase> </execution> </executions> </plugin> Note: the full definition of the Findbugs plugin

Use public maven repository with ivy

偶尔善良 提交于 2019-12-17 03:35:59
问题 I have an ivy.xml containing <dependencies> <dependency org="commons-lang" name="commons-lang" rev="2.4"/> <dependency org="foo-bar" name="superwidgets" rev="1.5"/> </dependencies> The whole superwidget stuff is hosted in a maven repository at http://example.com/m2/. The ivy documentation mentions resolvers, but it seems to assume an ivy repository. How can I add a single unofficial maven repository to my ivy settings to be used only by a single module? (Or put another way, what corresponds

How do I get my Maven Integration tests to run

你离开我真会死。 提交于 2019-12-17 03:22:12
问题 I have a maven2 multi-module project and in each of my child modules I have JUnit tests that are named Test.java and Integration.java for unit tests and integration tests respectively. When I execute: mvn test all of the JUnit tests *Test.java within the child modules are executed. When I execute mvn test -Dtest=**/*Integration none of the Integration.java tests get execute within the child modules. These seem like the exact same command to me but the one with the -Dtest= /*Integration** does