0

According to https://issues.sonatype.org/browse/OSSRH-3293 "Maven m2e Code-Style and Save-Actions connector"

This plugin is executed inside m2e Eclipse plugin when the project is configured and configures the save-actions and code-styling options of your maven project so you don't need to commit the .settings files to your repo

I have not been able to find a sample showing how this connector is supposed to be used. What do I put into my pom.xml to trigger it, how do I know if my eclipse installation has the connector installed?

Does anyone have an example configuration for this connector?

4

1 に答える 1

2

From looking at the source code, it's something like:

<plugin>
  <groupId>com.despegar.maven.plugin</groupId>
  <artifactId>maven-m2e-codestyle</artifactId>
  <version>1.0.3</version>
  <executions>
    <execution>
      <goals>
        <goal>configure</goal>
      </goals>
      <configuration>
        <codeStyleBaseUrl>http://some/path/to/eclipse/files/</codeStyleBaseUrl>
        <!-- Will not work. Scheme 'file' not registered. -->
        <!-- <codeStyleBaseUrl>file://localhost/some/path/to/eclipse/files/</codeStyleBaseUrl> -->
        <baseDir>${basedir}/</baseDir>
      </configuration>
    </execution>
  </executions>
</plugin>

The 2 configuration parameters are:

  • <codeStyleBaseUrl>
  • <baseDir>

It copies these 3 files:

${codeStyleBaseUrl}/org.eclipse.core.resources.prefs
${codeStyleBaseUrl}/org.eclipse.jdt.core.prefs
${codeStyleBaseUrl}/org.eclipse.jdt.ui.prefs

to:

${baseDir}/.settings/

Note that <codeStyleBaseUrl> must be http/https since it uses HttpClient behind the scenes.

于 2012-12-29T03:55:29.640 に答える