maven-2

What's the difference between mvn archetype:generate and mvn archetype:create

巧了我就是萌 提交于 2020-01-01 07:51:10
问题 any difference between those two? 回答1: archetype:create is the old and deprecated form that needed all properties defined upon start, while archetype:generate is the newer and more comfortable way. archetype:generate knows about those catalogs where archetypes are listed and can ask you for missing properties/variables. I guess the reason for introducing a new command was that the new generate was not backward-compatible, so it might have broken existing scripts that rely on it. 回答2: Check

Override Maven plugin configuration defined in the pom pluginManagement from the command line

淺唱寂寞╮ 提交于 2020-01-01 07:40:32
问题 The POM that my project inherits contains some <pluginManagement> for the release plugin that specifies some additional arguments . My question is: Is there a way to override the arguments parameter from the command line in this case? The parent POM has this: <pluginManagement> <plugin> <artifactId>maven-release-plugin</artifactId> <configuration> <arguments>-Prelease</arguments> </configuration> </plugin> </pluginManagement> Due to that the command line argument doesn't work: mvn release

Exclude dependency in a profile

这一生的挚爱 提交于 2020-01-01 07:34:45
问题 I have a maven module which has some dependencies. In a certain profile, I want to exclude some of those dependencies (to be exact, all dependencies with a certain group id). They however need to be present in all other profiles. Is there a way to specify exclusions from the dependencies for a profile? 回答1: To my knowledge, no , you can't deactivate dependencies (you can exclude transitive dependencies but this is not what you are asking for) and yes , what you are currently doing with the

How do I get m2eclipse to recognize $M2_OPTS?

谁说胖子不能爱 提交于 2020-01-01 07:08:11
问题 It appears m2eclipse is not recognizing my $M2_OPTS variable. I can run the same build outside of eclipse fine (with cranked up heapsize): [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 51 seconds [INFO] Finished at: Tue Nov 10 00:00:02 EST 2009 [INFO] Final Memory: 72M/187M [INFO] ----------------------------------------------------------

How do I get m2eclipse to recognize $M2_OPTS?

你。 提交于 2020-01-01 07:08:06
问题 It appears m2eclipse is not recognizing my $M2_OPTS variable. I can run the same build outside of eclipse fine (with cranked up heapsize): [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 51 seconds [INFO] Finished at: Tue Nov 10 00:00:02 EST 2009 [INFO] Final Memory: 72M/187M [INFO] ----------------------------------------------------------

adding artifacts to standard maven deploy

故事扮演 提交于 2020-01-01 05:49:06
问题 I was hoping someone could help me with maven deployments (typically run through the release plugin). I want to deploy files other than just the packaged jar to the repo upon release, such as specific instruction documents and generated SQL files. It would be good if i did not have to use deploy:deploy-file for each one. it would be best if I could just add each file to a list within my POM file and it would be picked up automatically for me upon release. 回答1: Either use the Maven Assembly

Running single test class or group with Surefire and TestNG

风格不统一 提交于 2020-01-01 04:34:12
问题 I want to run single test class from command line using Maven and TestNG Things that doesn't work: mvn -Dtest=ClassName test I have defined groups in pom.xml, and this class isn't in one of those groups. So it got excluded on those grounds. mvn -Dgroups=skipped-group test mvn -Dsurefire.groups=skipped-group test when config is <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.1</version> <configuration> <groups>functest</groups> <

Is packaging type 'pom' needed when not using project aggregation (multimodule)?

二次信任 提交于 2020-01-01 04:31:07
问题 I want to inherit the dependencies of a (parent) pom.xml in a child project in Maven 2.2.1; i.e. use project inheritance. It seems it is necessary to change the default packaging type from jar to pom in this case. However, doesn't the Maven2 documentation state that the packaging type pom is necessary for project aggregation, i.e. multimodule projects which use submodules, but not for project inheritance? <project> <modelVersion>4.0.0</modelVersion> <groupId>example</groupId> <artifactId

Trouble getting started with maven assembly plugin

我怕爱的太早我们不能终老 提交于 2020-01-01 04:31:06
问题 I'm sorry to sound ignorant here, but I'm new to Maven, and have been banging my head against something that I'm sure is quite simple. The docs say: [...] a project could produce a ZIP assembly which contains a project's JAR artifact in the root directory, the runtime dependencies in a lib/ directory, and a shell script to launch a stand-alone application. which is exactly what I want to do! But I can't seem to make it happen. My POM is as follows: <project> <modelVersion>4.0.0</modelVersion>

Trouble importing multi module maven project in to Eclipse (STS 2.5.2)

痴心易碎 提交于 2020-01-01 03:39:15
问题 I've just spent the last hour looking at threads on Stackoverflow.com , trying to import a Maven project in to Spring ToolSuite 2.5.2. The Maven project has multiple modules, when I use the Import... wizard in STS to import the project All the Modules are listed in the Package Explorer and some of the modules dependencies are not resolved. Can any advise on the proper way to import a Multi-Module Maven project in to STS/Eclipse such that all the modules appear under a Parent directory? And so