maven-2

Maven: Set the settings.xml location in the pom.xml?

百般思念 提交于 2019-12-01 03:51:34
问题 Is it possible to set the location of the settings.xml file inside the pom.xml file. I know you can do it from the command line typing mvn -s location/of/settings.xml , but I wanted to know if I can set that within the pom.xml so I don't have to keep typing through command line. 回答1: No. And that's probably a horrible idea, from a security standpoint. It'd allow the creator of a pom to bypass all your settings.xml settings. If you do the mvn -s location/of/settings.xml you will at least know

JUnit3 and Junit4 XML Reports with Maven

走远了吗. 提交于 2019-12-01 03:51:34
I am trying to figure out how to use the supposed reporting capabilities of JUnit (3 and 4) in conjunction with Maven, but Google searches aren't turning up much in the way of how to actually run JUnit (via Maven), get a report for each test (or all tests) and what format it will be in. So, my multi-part questions is: 1.) What sort of XML format is JUnit (3/4) capable of outputting? 2.) What sort of calling convention/arguments are required for JUnit to output these reports? 3.) Where are the reports output? 4.) Can these reports be generated while running via Maven or is my only option to use

Java: How do I build standalone distributions of Maven-based projects?

删除回忆录丶 提交于 2019-12-01 03:50:00
I often encounter distributions of Java applications or libraries which use Maven as their build tool. Some of them, sadly, don't provide standalone (or redistributable) jars. Is it possible to build Maven-based applications in such a way, that the build result contains all dependencies and can be redistributed to work out-of-the box? I tried to build Jackrabbit's OCM module. For some very "intelligent" reasons there is no downloadable standalone version. So I built Jackrabbit with Maven (the source package of Jackrabbit includes OCM), and got the same jar as found in the apache repository .

Clearing Grails Dependency Cache

半城伤御伤魂 提交于 2019-12-01 03:38:41
I run into some problems when trying to solve a problem I had with SNAPSHOT maven dependencies (see here) . When running grails dependency-report , cached dependencies get listed, more or less like this: acme-adapter-api by com.acme 108 kB (0 kB downloaded, 108 kB in cache) As this answer suggests, you can run into trouble when updating dependencies without increasing the release number, cause the cache is not emptied and SNAPSHOT dependencies don't get refetched, as one would expect. I looked all over the place, also in the %HOME%\.grails directory and under the bed ;-) but could not find

cxf + wss4j + maven NoSuchMethod error

送分小仙女□ 提交于 2019-12-01 03:30:34
trying to use the cxf+wss4j using maven. Created both the service and client without any compilation issues. The service runs fine in tomcat. Issue: When I run the client code, I get "java.lang.NoSuchMethodError: org.apache.xml.security.utils.I18n.init(Ljava/util/ResourceBundle;)V". This class is in xmlsec jar which comes along with cxf distribution. pom.xml for service project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion

run maven exec-maven-plugin as last step

我们两清 提交于 2019-12-01 03:20:45
I want to execute a command line script with exec-maven-plugin after "mvn test" How do I set this up under pom.xml? You can just take the example from the project website and have to add a phase to the execution. I've just tested with this pom below and it works fine. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.stackoverflow</groupId> <artifactId>q5110133</artifactId> <version>0.0.1

java maven rebuild dependency

℡╲_俬逩灬. 提交于 2019-12-01 03:18:13
I have a project which has dependency A. Project is packing into WAR and dependency A - into jar. And another dependency B, which also depends on A. I want to pack project and when project B is packing it must rebuild its dependency A instead of getting compiled dependency. Please help, how can i achieve this Always perform a clean when doing an install, ie mvn clean install . This will make sure that all modules in the project are rebuilt, packaged, and installed in the local .m2 repository for inclusion by parent dependencies and projects. What you may want is a multi-module project

Why does maven release plugin allow for SNAPSHOT version in dependency management?

試著忘記壹切 提交于 2019-12-01 03:06:51
问题 We have 1 company parent pom. This uses dependencyManagement to manage the versions for all the dependencies of all the artifacts used. What is alarming, is that SNAPSHOT versions can be defined in dependencyManagement. Though when maven release is performed, the pom is allowed to be released with SNAPSHOT version in dependencyManagement. Why? If I point a child project to a released version of the company parent pom, and this child project uses a dependency defined in dependencyManagement

Passing extra properties to maven archetype:generate

只愿长相守 提交于 2019-12-01 02:49:21
I've created a Maven archetype for a custom project setup, which is working wonderfully, but I was wondering if it's possible to pass extra parameters so that I can do some more interesting templating. I tried something like mvn archetype:generate -DarchetypeCatalog=local -DdbHost=localhost and put ... <option name="db.host.config.option" value="${dbHost}" /> ... in my template, but that doesn't seem to work. Is there a way to do this with an archetype? devsprint You just have to mention dbHost as requiredProperty in META-INF/maven/archetype-metadata.xml . <archetype-descriptor name="basic">

java.lang.IllegalStateException: endPosTable already set

泪湿孤枕 提交于 2019-12-01 02:33:39
Trying to build an alexa (amazon:echo) skills set. At the same time, trying to use this experience as a learning testbed for dependency injection through dagger 2. However, building the package using maven-2 cmd: mvn assembly:assembly -DdescriptorId=jar-with-dependencies package'. to generate a zip jar with the complete dependencies produces the following exception trace: [INFO] ------------------------------------------------------------------------ [INFO] Building Echo Device Client 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven