maven-3

Why Maven assembly works when SBT assembly find conflicts

非 Y 不嫁゛ 提交于 2020-01-22 13:56:08
问题 The title could also be: What are the differences between Maven and SBT assembly plugins. I have found this to be an issue, while migrating a project from Maven to SBT. To describe the problem I have created an example project with dependencies that I found to behave differently, depending on the build tool. https://github.com/atais/mvn-sbt-assembly The only dependencies are (sbt style) "com.netflix.astyanax" % "astyanax-cassandra" % "3.9.0", "org.apache.cassandra" % "cassandra-all" % "3.4",

Find classpath maven is using for running testng testcase

空扰寡人 提交于 2020-01-22 13:40:06
问题 what options to maven can I use to determine what classpath maven is running a testng test case with? 回答1: You didn't provide the Maven version, but at least in 3.x (and maybe also 2.x) you can run commands with the -X (debug) option. That way the Test Classpath is printed out before tests are run. mvn test -X 回答2: In general you can find the classpath that maven is using by using the built-in maven dependency plugin and its build-classpath goal. If you want the classpath uses for compiling

How to create maven uber jar which includes dependencies with scope provided

你说的曾经没有我的故事 提交于 2020-01-21 15:27:06
问题 <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifest> <mainClass>com.XXXX.XXXXOfflineApp</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> I have the above code piece to create an jar with dependencies, but in my pom i also have some

How does Maven resolve version conflicts of transitive dependencies ? nearest-wins strategy

白昼怎懂夜的黑 提交于 2020-01-21 02:36:08
问题 I just finally got used to not having any Used undeclared or Unused declared dependencies in my projects. Although it is very hard to track Unused declared runtime/test dependencies that are listed in dependency:analyze... One just must write comments to them in pom.xml or otherwise manage them to know that they are needed for testing or runtime. But the way of resolving version conflict is still unclear to me. Regarding transitive dependencies. How does the nearest-wins strategy work exactly

Creating the most basic Scala project with Maven?

不羁的心 提交于 2020-01-20 18:47:11
问题 I use Maven 3 to create a new Scala project. As far as I understand, the way to create a new project with Maven is by: mvn archetype:generate Maybe I'm missing out something, but I couldn't find even one option that offers the simplest Scala project (like the one received by lein new app ... for Clojure, for example). Any help here? 回答1: You should be able to use mvn archetype:generate . You can choose, e.g., org.scala-tools.archetypes:scala-archetype-simple . You need to put in the number

Preventing overriding dependency version in Maven child pom

江枫思渺然 提交于 2020-01-20 17:58:33
问题 I have a dependencyManagement section in parent pom like <dependencyManagement> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.2.1</version> </dependency> </dependencyManagement> and a child pom, having it <dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.0</version> </dependency> </dependencies> I've tried to prevent this kind of overriding in child poms using

Preventing overriding dependency version in Maven child pom

我与影子孤独终老i 提交于 2020-01-20 17:55:17
问题 I have a dependencyManagement section in parent pom like <dependencyManagement> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.2.1</version> </dependency> </dependencyManagement> and a child pom, having it <dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.0</version> </dependency> </dependencies> I've tried to prevent this kind of overriding in child poms using

What are all of the Maven Command Line Options?

ぐ巨炮叔叔 提交于 2020-01-20 13:57:45
问题 I'm looking for the list of options for Maven 2.2 but cannot find it. If someone knows the location please post it. Thank you. I found the following but I don't know enough of Maven to know which are and are not in 2.2. Version Maven 3.3.3 CLI Options Reference 回答1: Found this page today. Maven CLI Options Reference. Text version to make it easy to copy/paste Maven CLI Options Reference Options >> Description -am,--also-make >> If project list is specified, also build projects required by the

What are all of the Maven Command Line Options?

假装没事ソ 提交于 2020-01-20 13:57:31
问题 I'm looking for the list of options for Maven 2.2 but cannot find it. If someone knows the location please post it. Thank you. I found the following but I don't know enough of Maven to know which are and are not in 2.2. Version Maven 3.3.3 CLI Options Reference 回答1: Found this page today. Maven CLI Options Reference. Text version to make it easy to copy/paste Maven CLI Options Reference Options >> Description -am,--also-make >> If project list is specified, also build projects required by the

Maven build of annotated JAXB 2.2.4-1 Web Service fails with JDK 1.6

非 Y 不嫁゛ 提交于 2020-01-17 05:16:27
问题 Using Maven 3.0.3 to build a web service using JAXB (2.2.4-1) and CXF 2.4.2 fails with the following error: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project cxfmaventest: Compilation failure /Users/ksuda/Documents/workspace/cxfmaventest/src/main/java/cxfmaventest/CXFMavenTest.java:[18,83] annotation type not applicable to this kind of declaration The line that fails contains