2012-12-23 47 views
0

https://issues.sonatype.org/browse/OSSRH-3293「Maven的M2E代碼風格和保存,操作連接器」如何使用maven-m2e-codestyle連接器?

的項目配置和配置的 保存,行動和代碼樣式選項 時,這個插件是M2E Eclipse插件內執行你的Maven項目,所以您不必到.settings文件提交到 您的回購

我一直沒能找到這顯示連接器應該如何使用的樣品。我怎麼把它放到我的pom.xml來觸發它,我怎麼知道我的eclipse安裝是否安裝了連接器?

有沒有人有這個連接器的配置示例?

+0

你怎麼安裝插件?這不是在發現。 –

+0

我實際上創建了這個插件的重寫https://github.com/trajano/m2e-codestyle-maven-plugin –

回答

2

從查看源代碼,它是這樣的:

<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> 

的2配置參數:

  • <baseDir>

它複製這3個文件:

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

到:

${baseDir}/.settings/ 

注意必須是HTTP/HTTPS,因爲它使用的HttpClient幕後。

相關問題