How to use my own life cycle for a project like m2eclipse?

When using m2eclipse ... if you right-click the maven project and select Properties from the pop-up menu, enter the project settings dialog, which has the Maven-> Lifecycle section, which allows you to configure which phases of the assembly should be linked to the assembly life cycle when project updated or cleaned -Built-in . However, these settings are rude and are lost during the “updating the project configuration” (the same if you put the file “org.maven.ide.eclipse.prefs” where these parameters are saved in accordance with version control ... after importing the project, file will be overwritten).

Finding a solution, I found this answer from pascal-thivent , where it describes "how to create a new Maven constructor in the project settings ..." which was not "In my case, it helps a lot, because" Create-New-Builder- Dialog "in my Eclipse installation, unfortunately, cannot find such a Maven Builder . And the existing builder has the" Edit-Builder "button disabled.

+4
source share
1 answer

With Maven, all assembly information is stored inside pom.xml, and the most detailed configuration is the maven plugin configuration .

All configuration inside the Eclipse IDE must be done using the m2e Eclipse plugin . Well, I don’t know where to find all possible configuration. But sometimes some options are available as an Eclipse warning when editing pom.xml

Here is an example of my current settings. It is generated by m2e.

<pluginManagement> <plugins> <!--This plugin configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>ro.isdc.wro4j</groupId> <artifactId> wro4j-maven-plugin </artifactId> <versionRange> [1.4.0,) </versionRange> <goals> <goal>jshint</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> <pluginExecution> <pluginExecutionFilter> <groupId> com.github.searls </groupId> <artifactId> jasmine-maven-plugin </artifactId> <versionRange> [1.2.0.0,) </versionRange> <goals> <goal> generateManualRunner </goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> 
0
source

Source: https://habr.com/ru/post/1337143/


All Articles