maven-2

How do I execute a program using Maven?

瘦欲@ 提交于 2019-12-17 02:55:16
问题 I would like to have a Maven goal trigger the execution of a java class. I'm trying to migrate over a Makefile with the lines: neotest: mvn exec:java -Dexec.mainClass="org.dhappy.test.NeoTraverse" And I would like mvn neotest to produce what make neotest does currently. Neither the exec plugin documentation nor the Maven Ant tasks pages had any sort of straightforward example. Currently, I'm at: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version

Difference of Maven JAXB plugins

会有一股神秘感。 提交于 2019-12-17 02:53:32
问题 I have determined that two JAXB plugins for Maven 2 exist, with some different configurations. The one is from Sun: http://jaxb.dev.java.net/jaxb-maven2-plugin/, the other from Mojohaus: http://mojohaus.org/jaxb2-maven-plugin/ Which of these two plugins can be recommended? Thanks Matt. On my little research project, I found that there's quite another plugin comming from the sunners: <groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId> and that one: <groupId

A simple command line to download a remote maven2 artifact to the local repository?

柔情痞子 提交于 2019-12-17 02:41:07
问题 I have a library that I distribute using maven 2. The typical user of this library doesn't use maven to build their applications, but is likely somewhat familiar with maven and probably has it installed. I'd like to document a "simple" one line command they can use to download my library's artifacts to their local ~/.m2/repository without requiring that they set up a pom.xml to do it. I thought there was a way to do this, but I can't seem to find it after looking through the install:install

Maven2: Best practice for Enterprise Project (EAR file)

一个人想着一个人 提交于 2019-12-17 02:17:15
问题 I am just switching from Ant to Maven and am trying to figure out the best practice to set up a EAR file based Enterprise project? Let's say I want to create a pretty standard project with a jar file for the EJBs, a WAR file for the Web tier and the encapsulating EAR file, with the corresponding deployment descriptors. How would I go about it? Create the project with archetypeArtifactId=maven-archetype-webapp as with a war file, and extend from there? What is the best project structure (and

How do I build only one JAR file with classifier?

醉酒当歌 提交于 2019-12-14 03:59:11
问题 I'm using Maven 2 and maven-jar-plugin to build my jar . I'd like to generate only a jar with a classifier . Is it possible? In my example I'd like to generate only the myjar-another-1.0.jar but not myjar-1.0.jar . After take a look at this question I tried to skip the default-jar . But this seems to work only with version 3 of Maven (haven't tried thou. The parent is to do the <modules> Thanks all! Here is the relevant piece of my pom.xml: Also tried in the global configuration segment.

Creating an archive of all jars and source jars for a multi-module project

可紊 提交于 2019-12-14 03:42:30
问题 I'm building a Maven project which has half a dozen modules. I'm fine with importing it myself using either Maven or Ivy, but other teams would like to use those jars as well, but their practice is to commit the jars and source jars to version control. I'd like to generate a zip/tar assembly of all modules and their sources which they can use however they like. I've read Maven Assembly Plugin: Including Module Binaries but I'm shy of using it because: The linked FAQ entry returns a 404; I

Classifiers not working in Maven Snapshot repo for IVY

邮差的信 提交于 2019-12-14 03:16:30
问题 So I have got my Maven build deploying both Java5 and Java6 versions to my snapshot repo (Nexus). I do this with build profiles and classifiers. All is good in the Maven side of things. However, if I try to resolve the Java5 dependency from my IVY based project it will not work if the most recent Maven deploy was for the Java6 profile/classifier. I guess this is because the timestamp in maven-metadata.xml picks out the Java6 version. It does work if the most recent deploy was for Java5. This

Maven clean install issue: Failed to configure plugin parameters

混江龙づ霸主 提交于 2019-12-14 03:16:16
问题 I'm trying to made a clean install for a Maven project but I found a problem. The console displays this error: [INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-enforcer-plugin:1.0 Cause: Class 'org.apache.maven.enforcer.rule.api.EnforcerRule' cannot be instantiated It's the same error for the command line: mvn release:prepare -Dresume=false This is the pom of all the project: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0

Filter maven resources with filter-file from external dependency

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 03:14:03
问题 Given a property file in maven project A I want to use them in project B for resource filtering. So in Project B I use <build> <filters> <filter>${project.build.directory}/myFile.properties</filter> </filters> </build> To filter my resources based on values in myFile.properties This file is stored in project A. So I include it with <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id>

Tycho: How do I deploy sources jars of packaging eclipse-plugin?

烈酒焚心 提交于 2019-12-14 02:55:30
问题 In my parent pom I got this configuration to deploy sources jars: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <goals> <goal>jar</goal> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> But the tycho build modules ignore that, so their sources aren't installed/deployed in the maven repository. Which means I can't include them in an assembly (especially if the assembly module is located in another