maven-2

Managing native libraries with Maven

半城伤御伤魂 提交于 2019-12-04 22:29:44
问题 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. 回答1: 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

Junit maven Error occured in starting fork, check output in log [closed]

我怕爱的太早我们不能终老 提交于 2019-12-04 22:17:13
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center . Closed 7 years ago . BUILD ERROR Error occured in starting fork, check output in log with using maven 2.2.1 and surefire plugin 2.11 while running junit test-cases user1137387 You need to setup surefire plugin to use <forkMode>once</forkMode> like this: <plugin> <groupId>org

How to specify a repository for a dependency in Maven

天大地大妈咪最大 提交于 2019-12-04 22:11:35
In projects with several dependencies and repositories, the try-and-error approach of Maven for downloading dependencies is a bit cumbersome and slow, so I was wondering if there is any way to set an specific repo for some declared dependencies. For example, I want for bouncycastle to check directly BouncyCastle's Maven repo at http://repo2.maven.org/maven2/org/bouncycastle/ instead of official Maven. Not possible. Maven checks the repositories in their declaration order until a given artifact gets resolved (or not). Some repository manager can do something approaching this though. For example

How to deliver properties files in addition to artifacts?

情到浓时终转凉″ 提交于 2019-12-04 21:18:06
问题 I am using Maven2 to build a WAR project. Some properties files are dependent on the environment targeted for a release. I want to deliver, in addition of the WAR, a file called datasource.xml . This file already exists in my project directory, but contains properties that will be filtered during the build (i.e. some ${foo.bar} ). In others words, after running the command mvn clean install , I want to see in my target/ directory two files, my-webapp.war and datasource.xml . Note that

Surefire is not picking up Junit 4 tests

南笙酒味 提交于 2019-12-04 21:00:51
I cannot get Maven Surefire to execute my JUnit 4 tests even after I tried all the advices from another post. My POM: <project> <modelVersion>4.0.0</modelVersion> <groupId>maven-test</groupId> <artifactId>maven-test</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.junit</groupId> <artifactId>com.springsource.org.junit</artifactId> <version>4.4.0</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source

Maven - Dependency Inheritance - Provided

安稳与你 提交于 2019-12-04 19:35:13
问题 I make use of dependency POMs which I will then go and include into another projects as as dependency. The problem I am having is while it aggregates the POM with those dependencies, it appears when I declare dependencies of scope, provided, those aren't included. Is it possible to include provided dependencies in dependency POMs with a scope of provided? I often declare what APIs I need and then include the implementation as a runtime dependency. 回答1: If a dependency is provided why can't

How to get hibernate3-maven-plugin hbm2ddl to find JDBC driver?

北城以北 提交于 2019-12-04 19:33:17
I have a Java project I am building with Maven. I am now trying to get the hibernate3-maven-plugin to run the hbm2ddl tool to generate a schema.sql file I can use to create the database schema from my annotated domain classes. This is a JPA application that uses Hibernate as the provider. In my persistence.xml file I call out the mysql driver: <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> When I run Maven, I see it processing all my classes, but when it goes to output the schema

Where is Cargo generating context XML for Jetty 6.x?

只谈情不闲聊 提交于 2019-12-04 19:17:44
I am trying to implement the solution mentioned in How to specify jetty-env.xml file for Maven Cargo plugin for Jetty? However I am facing something even more fundamental: My Cargo is simply not generating any context xml. <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.2.1</version> <configuration> <!-- Container configuration --> <container> <containerId>jetty6x</containerId> <type>embedded</type> </container> <!-- Configuration to use with the container or the deployer --> <configuration> <properties> <cargo.servlet.port>${itest.webapp

Can Maven Wagon plugin use a private key for scp?

一曲冷凌霜 提交于 2019-12-04 19:14:07
问题 Can Maven Wagon plugin be configured to use a private key for ssh/scp? Everything I've tried still leaves maven to ask me for a password when it gets to the point of scp-ing. 回答1: You should be able to specify the path to the private key in the server element in your settings.xml: The repositories for download and deployment are defined by the repositories and distributionManagement elements of the POM. However, certain settings such as username and password should not be distributed along

Problem with Eclipse and a Maven multi-module project

你离开我真会死。 提交于 2019-12-04 18:55:34
问题 I have created a Maven project with the following structure: + root-project pom.xml (pom) + sub-projectA (jar) + sub-projectB (jar) I have done the following steps: mvn archetype:create –DgroupId=my.group.id –DartifactId=root-project mvn archetype:create –DgroupId=my.group.id –DartifactId=sub-projectA mvn archetype:create –DgroupId=my.group.id –DartifactId=sub-projectB So I have, obviously, in the top-level pom.xml the following elements: <modules> <module>sub-projectA</module> <module>sub