maven-3

Is there a way to update default-bindings.xml for maven on local

坚强是说给别人听的谎言 提交于 2019-12-20 04:17:05
问题 It could sound dumb. But is there a way to edit or update the default-bindings file of maven? /META-INF/plexus/default-bindings.xml Why would I want to do that? Background - I am using latest maven version 3.3.9 on my machine as a home directory within intelliJ. I have a module named testng-test without any external plugin specified. Take a look at the pom.xml for the module : <artifactId>testng</artifactId> <dependencies> <dependency> <groupId>org.testng</groupId> <artifactId>testng<

maven error when running in cygwin?

耗尽温柔 提交于 2019-12-20 03:22:15
问题 I have cygwin in Windows 7 and downloaded and installed maven "binaries" and have the following set export JAVA_HOME=/cygdrive/c/java/jdk1.7.0_11 export MAVEN_HOME=/usr/apache-maven-3.0.5 export M2_HOME=/home/MyUser/.m2 export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH $ which java /cygdrive/c/java/jdk1.7.0_11/bin/java $ java -version java version "1.7.0_11" Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode) $ which mvn /usr

Maven: Get repository URL of a dependency

爱⌒轻易说出口 提交于 2019-12-20 03:09:31
问题 I want do display the URL to a JAR that was deployed to our maven repo at the end of my build job. (Basically the "link" where the dependency - the JAR - can be downloaded from the repository server) So how to display the remote repository URL of a dependency on command line? 回答1: I suggest you to compose the URL from the parameters in the very pom. Example: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions>

Unable to get complete maven archetype list

那年仲夏 提交于 2019-12-20 01:14:36
问题 I'm trying generate a Maven project using archetype:generate but I only get a small list of archetypes: 1: internal -> org.apache.maven.archetypes:maven-archetype-archetype (An archetype which contains a sample archetype.) 2: internal -> org.apache.maven.archetypes:maven-archetype-j2ee-simple (An archetype which contains a simplifed sample J2EE application.) 3: internal -> org.apache.maven.archetypes:maven-archetype-plugin (An archetype which contains a sample Maven plugin.) 4: internal ->

Change default mojo configuration in lifecycle mapping

江枫思渺然 提交于 2019-12-19 10:29:10
问题 I'm writing a Maven 3 plugin which builds plugins for another application. A plugin is basically a JAR file with some fancy manifests. The compiled classes need to be post-processed for the plugin to work with the production build of the host application. Unfortunately, the processed version of the plugin won't work with the debug build of the host. I therefore need to produce two artifacts: the raw classes with the classifier debug and the post-processed version as the main artifact. I've

Find dependencies of a Maven Dependency object

◇◆丶佛笑我妖孽 提交于 2019-12-19 10:20:32
问题 I'm writing a Maven 3 plugin that needs to know the transitive dependencies of a given org.apache.maven.model.Dependency . How can I do that? 回答1: So the following code should give you an impression how to do it. @Mojo( name = "test", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE ...) public class TestMojo extends AbstractMojo { @Parameter( defaultValue = "${project}", readonly = true ) private MavenProject project; public void execute() throws

Find dependencies of a Maven Dependency object

天大地大妈咪最大 提交于 2019-12-19 10:19:20
问题 I'm writing a Maven 3 plugin that needs to know the transitive dependencies of a given org.apache.maven.model.Dependency . How can I do that? 回答1: So the following code should give you an impression how to do it. @Mojo( name = "test", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PACKAGE ...) public class TestMojo extends AbstractMojo { @Parameter( defaultValue = "${project}", readonly = true ) private MavenProject project; public void execute() throws

mvn is not recognized after installation Maven 3

别来无恙 提交于 2019-12-19 10:02:11
问题 I have some problems with my maven 3 installation. I have downloaded maven 3.0.3 and extracted it to a folder. I set the following environment variables. M2_HOME: C:\a few folders\apache-maven-3.0.3 M2: %M2_HOME%\bin JAVA_HOME: C:\Program Files\Java\jdk1.6.0_25 Path: %JAVA_HOME%\bin; %M2% I get a message that the command is not recognized when i type "mvn" in the command line. Any ideas? 回答1: Everything looks OK. I don't know if there should be a space after the semicolon and %M2% . This

In Maven, can a profile override the modules (to not include any)

偶尔善良 提交于 2019-12-19 05:22:23
问题 In maven , once you define your modules in you pom.xml all profiles aggregate the modules defined in them: (relevant part only) <project> <modules> <module>module1</module> </modules> <profiles> <profile> <id>pr1</id> <modules> <moudule>module2</module> </modules> If you perform a mvn clean it will pass the command to module1 . If you issue mvn clean -Ppr1 it will pass along to module1 and module2 . I wonder if in maven 3 it is possible to have a pom.xml with submodules and override this. I

Writing an annotation processor for maven-processor-plugin

北慕城南 提交于 2019-12-19 01:28:37
问题 I am interested in writing an annotation processor for the maven-processor-plugin. I am relatively new to Maven. Where in the project path should the processor Java source code go (e.g.: src/main/java/...) so that it gets compiled appropriately, but does not end up as part of my artifact JAR file? 回答1: The easiest way is to keep your annotation processor in a separate project that you include as dependency. If that doesn't work for you, use this config Compiler Plugin: <plugin> <groupId>org