maven-3

Exclude servlet-api from test scope Maven

拥有回忆 提交于 2020-01-12 06:47:11
问题 I have the following dependency in my pom.xml so that my IDE (IntelliJ) has the servlet-api classes available during compilation, but not provided in the build. <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0-alpha-1</version> <scope>provided</scope> </dependency> But provided scope adds the classes in this dependency to the classpath when running in test scope, that's a problem for Jetty which I start programmatically. Since it already has it

Unknown lifecycle phase maven

南楼画角 提交于 2020-01-12 04:41:06
问题 I am new to maven and camel. I tried executing the examples in camel book. And I am getting this error when I run the following command. Command: mvn test -Dtest= SpringTransformMethodTest Error: [ERROR] Unknown lifecycle phase "SpringTransformMethodTest". You must specify a valid lifecycle phase or a goal in the f ormat <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle ph ases are: validate, initialize, generate-sources, process

Distribute XSD files over multiple Maven Artifacts

故事扮演 提交于 2020-01-12 03:52:51
问题 Here is a small Example of what I would like to achieve: Maven Artifact A is one of many Webservices and defines a XSD Schema with definitions for Requests and Responses. (src/main/resources/xsd) Artifact A depends on Artifact B wich is a simple JAR Project and contains a multitude of Master XSDs with low level Type descriptions. (src/main/resources/xsd) The XSDs in Artifact A use the type definitions (include) that are specified once in Artifact B. If at all possible I would really like to

Maven Cannot Resolve Local Dependency

折月煮酒 提交于 2020-01-11 08:59:56
问题 I have a maven project with an in-project repository with an external jar file. I used the install command to install the jar file into the in-porject repository and when I checked in the repository the jar file was installed i also added the dependency configuration in the pom file. But when I run the mvn compile file. I get the error that mvn cannot resolve the dependency this is the Pom snippet: <repository> <id>repo</id> <releases> <enabled>true</enabled> <checksumPolicy>ignore<

H2 and Oracle Compatiability issues

[亡魂溺海] 提交于 2020-01-11 05:32:07
问题 I am having an issue executing the following script using Flyway and H2 database. I assume its a Oracle compatibility issue but I am using H2 with the correct mode. This script is used to construct my tables in production but I want to use an in-memory database for testing purposes. Setup and error below. I don't want rewrite the scripts for an in-memory database if thats possible. Jdbc.properties jdbc.driver=org.h2.Driver jdbc.url=jdbc:h2:file:target/firmsoftDB;MODE=Oracle jdbc.username=sa

Append the value of argLine param in maven-surefire-plugin

那年仲夏 提交于 2020-01-10 19:37:07
问题 I am using maven-surefire-plugin + Sonar together and I would like to add some extra value to argLine parameter of the maven-surefire-plugin. So I did it: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.20.1</version> <configuration> <argLine>-DCRR.Webservice.isSimulated=true -D...</argLine> </configuration> </plugin> ... </plugins> </build> But in this case I am overwriting the original value of the argLine

Blacklist Maven dependencies

折月煮酒 提交于 2020-01-10 09:47:26
问题 Is there a way e.g. a Maven plug in that can take a list of unwanted/black listed dependencies (direct and transitive) and fails the build if it detects one of listed dependencies? In my project we strictly want to get rid of Apache Commons Logging and replace it with the SLF4J JCL Bridge. I am aware that we have to exclude the unwanted deps ourselfs but I would like to have the build failed if someone adds a dependency that brings in blacklisted dependency. 回答1: You can ban some dependencies

tomcat7-maven-plugin custom server.xml

好久不见. 提交于 2020-01-10 05:40:28
问题 I am trying to use the tomcat7-maven-plugin:run with a custom server.xml, which contains a Realm I need to enable. As described in the docs I have used <serverXml /> to point to my file. However, my application does not then get loaded. The plugin docs state that I need to configure the context for my application manually. How do I do this? I am unsure what to put for the docBase etc. Thanks. 回答1: Can you check this sample pom http://svn.apache.org/repos/asf/tomcat/maven-plugin/trunk/tomcat7

Maven repository lookup order

Deadly 提交于 2020-01-09 11:13:43
问题 We have an internal Apache Archiva based repository and we have configured the repositories tag in pom.xml to be as follows. Can I assume that all dependency access will get resolved by internal repository if you have access to it and will get resolved by other repositories listed below, if internal repository is down for a certain reason. <repositories> <repository> <id>internal</id> <name>Internal Repository</name> <url>http://192.168.1.2/archiva/repository/internal</url> </repository>

Simpliest way to add an attribute to a jar Manifest in Maven

一笑奈何 提交于 2020-01-09 07:34:07
问题 Since the last Java update, I need to tag my applet jars manifest with the Trusted-Library attribute to avoid warning popup when javascript is communicating with the applet. (see http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mixed_code.html) Manifest-Version: 1.0 Trusted-Library: true Created-By: 1.6.0-internal (Sun Microsystems Inc.) I never done such things before, is there a plugin which allow to do that in a seamless way or should I write one, or use the ant plugin? The jars