maven-2

Maven checksum failed

前提是你 提交于 2019-12-03 16:18:43
问题 I am working on a project that uses Maven as the build tool. I am using version 2.2.1 of the tool. Recently a coworker mentioned that he couldn't build the project because of checksum errors. I wasn't getting these errors so I deleted my local repository. Sure enough, I also got the checksum errors on the next attempt to build. We are using Archiva as our central repository, so I uploaded the jars again hoping to resolve the issue. No luck. What could be causing these errors and how do I

how to get the super pom basedir in a child module pom?

扶醉桌前 提交于 2019-12-03 16:14:02
问题 I want to define a local repository in my maven project. I've got a super pom and several child modules. My file structure is : /root /repository /child pom.xml pom.xml in my super pom I define : <repository> <id>my-local-repo</id> <url>file://${basedir}/repository</url> </repository> The problem is that in my child pom, the repository defined in my super pom refers to /root/child/repository and so, dependencies cannot be found... Is there a way to define a path always relative to the super

Get dependencies of WAR Artifact using Maven 2 API

我的梦境 提交于 2019-12-03 16:12:44
I have found a few posts surrounding the question of artifact retrieval however the answers don't seem to work in my specific case. I am writing a plugin that will help with skinny war EAR generation and I am running a plugin that I have written for my EAR maven module. In the plugin code I have got to the stage where I want to be able to get the dependencies / artifacts of the WAR dependencies - currently these are not coming through with anything I have tried. I presume this is because even running a dependency:tree on my EAR module doesn't include them, they are not 'transitive'

Creating a web-service client directly from the source

此生再无相见时 提交于 2019-12-03 16:11:12
I am trying to generate the WS client jar directly from the @Webservice class(es). Let's take this example : package com.example.maven.jaxws.helloservice; import javax.jws.WebService; @WebService public class Hello { public String sayHello(String param) { ; return "Hello " + param; } } I can generate a war file and use glassfish to serve this webservice, and from there I can use the glassfish WSDL URL to generate the client sources. What I am trying to do is to skip the glassfish part. From my maven project defining the webservice, I would like to use the jaxws-maven-plugin to create the

Managing native libraries with Maven

泄露秘密 提交于 2019-12-03 16:01:22
Is it possible to manage native libraries (.so) under maven? We use some jars with dependences on external native libs, so I'm looking for some way to mavenize them. Thanks. Pascal Thivent I think that the "common" approach is to bundle the native libraries in platform specific JARs using classifiers (e.g. mylib-1.2.3-solaris.jar ) on which you could depend like any other JAR with classifier: <dependency> <groupId>my.group</groupId> <artifactId>mylib</artifactId> <version>1.2.3</version> <classifier>solaris</classifier> </dependency> And then, unpack them with the maven-dependency-plugin and

Tool to determine licenses for pom.xml dependencies [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-03 15:57:35
问题 This question already has answers here : maven report on licenses your project depends on [closed] (3 answers) Closed 4 years ago . I'm looking for a tool that given a maven pom.xml file tells me all the licenses that are used by the dependencies (and recursively their dependencies). Does such a thing exist? Ideally it would tell me: For each dependency all licenses that apply A summary list of a different licenses referenced. 回答1: Did you have a look at the maven-dependency-plugin? In the

How to disable auto “Update Maven Dependencies” after saving a pom.xml?

走远了吗. 提交于 2019-12-03 15:52:14
How to disable auto "Update Maven Dependencies" after saving a pom.xml in Eclipse IDE with m2eclipse Plugin? 16.04.10 11:09:40 MESZ: Refreshing [/project/pom.xml] 16.04.10 11:09:40 MESZ: Maven Builder: AUTO_BUILD You can't. But why would you even want to do that? Keeping your project build path in sync with the pom is a good thing. Window -> Preferences -> Maven -> enable Offline option You can edit "Goals to run when updating project configuration" in Window > Preferences > Maven. Default setting is "process-resources", try to remove it. If you disable "process-resources" in a Spring

Adding Hibernate 3.5.x to a maven pom.xml build

拥有回忆 提交于 2019-12-03 15:44:22
问题 I added the JBoss Maven repo to my pom.xml file like this... <repositories> <repository> <id>jboss</id> <url>http://repository.jboss.org/maven2/</url> </repository> </repositories> And I added Hibernate itself like this... <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.5.1-Final</version> </dependency> But when I try to build my application I see this error.... Downloading: http://repository.jboss.org/maven2//org/hibernate/hibernate/3.5.1-Final

Maven String Replace of Text Web Resources

吃可爱长大的小学妹 提交于 2019-12-03 15:43:48
问题 I have a Maven web application with text files in src/main/webapp/textfilesdir As I understand it, during the package phase this textfilesdir directory will be copied into the target/project-1.0-SNAPSHOT directory, which is then zipped up into a target/project-1.0-SNAPSHOT.war Problem Now, I need to do a string replacement on the contents of the text files in target/project-1.0-SNAPSHOT/textfilesdir. This must then be done after the textfilesdir is copied into target/project-1.0-SNAPSHOT, but

How to instruct Maven to ignore my main/resources/persistence.xml in favor of test/…?

十年热恋 提交于 2019-12-03 15:37:42
问题 I have two persistence.xml files, for the sake of testing: src/main/resources/META-INF/persistence.xml src/test/resources/META-INF/persistence.xml How to instruct Maven to ignore the first file during testing? Now it is not ignored since OpenEJB says: ERROR - FAIL ... Finder: @PersistenceContext unitName has multiple matches: unitName "abc" has 2 possible matches. 回答1: Check out the alternate descriptors functionality which is aimed at what you're trying to do. Try this setup: src/main