Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2012-12-31 23:21:03 -0500
committerIgor Fedorenko2012-12-31 23:21:03 -0500
commita8b5512972ebd9a273b8955fd1306e039428d400 (patch)
treef6cd368f8ee88082c81eb7087dcbe3bfed3997f6 /org.eclipse.m2e.scm
parentcf04c93473bf354448dd453877b688643d4d5cf9 (diff)
downloadm2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.tar.gz
m2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.tar.xz
m2e-core-a8b5512972ebd9a273b8955fd1306e039428d400.zip
Code format, organize imports
... also enabled automatic code format and organize imports on file save, hopefully this will help us keep formatting consistent in the future. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.scm')
-rw-r--r--org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs120
-rw-r--r--org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs67
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java27
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java86
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java21
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java9
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java25
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java4
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java16
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java21
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java6
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java140
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java47
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java63
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java68
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java36
-rw-r--r--org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java21
17 files changed, 498 insertions, 279 deletions
diff --git a/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs
index 063a9813..80d9c54b 100644
--- a/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.core.prefs
@@ -1,11 +1,114 @@
-#Sat Jul 30 19:01:59 MSD 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
@@ -23,12 +126,14 @@ org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
@@ -66,11 +171,12 @@ org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not inse
org.eclipse.jdt.core.formatter.comment.line_length=120
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=
-org.eclipse.jdt.core.formatter.enabling_tag=
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
@@ -157,12 +263,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -186,6 +294,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
@@ -241,6 +350,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -250,6 +360,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -276,4 +387,7 @@ org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs
index 97bf99cc..595d9975 100644
--- a/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs
+++ b/org.eclipse.m2e.scm/.settings/org.eclipse.jdt.ui.prefs
@@ -1,5 +1,66 @@
eclipse.preferences.version=1
-formatter_profile=_m2eclipse
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_m2 plugin
formatter_settings_version=12
-org.eclipse.jdt.ui.javadoc=false
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\n * Copyright (c) 2008 Sonatype, Inc.&\#13;\n * All rights reserved. This program and the accompanying materials&\#13;\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\n * which accompanies this distribution, and is available at&\#13;\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\n *******************************************************************************/&\#13;\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${type_name}\n *\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;org.w3c;org.xml;org.apache;com;junit;org.eclipse;org.codehaus;org.apache.lucene;org.apache.maven;org.sonatype;org.eclipse.m2e;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\n * Copyright (c) 2010 Sonatype, Inc.&\#13;\n * All rights reserved. This program and the accompanying materials&\#13;\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\n * which accompanies this distribution, and is available at&\#13;\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\n *&\#13;\n * Contributors\:&\#13;\n * Sonatype, Inc. - initial API and implementation&\#13;\n *******************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${type_name}\n *\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nlog.error(${exception_var}.getMessage(), ${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java
index 26af0f5e..a38e0488 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenCheckoutOperation.java
@@ -16,15 +16,17 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
import org.eclipse.m2e.scm.internal.Messages;
import org.eclipse.m2e.scm.internal.ScmHandlerFactory;
import org.eclipse.m2e.scm.spi.ScmHandler;
-import org.eclipse.osgi.util.NLS;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
@@ -36,9 +38,9 @@ public class MavenCheckoutOperation {
private static final Logger log = LoggerFactory.getLogger(MavenCheckoutOperation.class);
private final File location;
-
+
private final Collection<MavenProjectScmInfo> mavenProjects;
-
+
private final List<String> locations = new ArrayList<String>();
public MavenCheckoutOperation(File location, Collection<MavenProjectScmInfo> mavenProjects) {
@@ -56,8 +58,9 @@ public class MavenCheckoutOperation {
}
String folderUrl = info.getFolderUrl();
-
- monitor.setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_scanning, info.getLabel(), info.getFolderUrl()));
+
+ monitor
+ .setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_scanning, info.getLabel(), info.getFolderUrl()));
// XXX check if projects already exist
boolean isNestedPath = false;
@@ -80,7 +83,8 @@ public class MavenCheckoutOperation {
throw new InterruptedException();
}
- monitor.setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_checking,info.getLabel(), info.getFolderUrl()));
+ monitor
+ .setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_checking, info.getLabel(), info.getFolderUrl()));
// XXX if location is pointing to workspace folder need to create unique dir too
File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
@@ -104,7 +108,7 @@ public class MavenCheckoutOperation {
if(!tempDir.exists()) {
return tempDir;
}
- suffix++;
+ suffix++ ;
}
}
@@ -114,13 +118,12 @@ public class MavenCheckoutOperation {
public Collection<MavenProjectScmInfo> getMavenProjects() {
return this.mavenProjects;
}
-
+
/**
* @return Returns list of <code>String</code> paths for the checked out locations
*/
public List<String> getLocations() {
return this.locations;
}
-
-}
+}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
index 1b9374e2..28c9d270 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectPomScanner.java
@@ -17,6 +17,15 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -26,30 +35,26 @@ import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.model.Profile;
import org.apache.maven.model.Scm;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.internal.Messages;
import org.eclipse.m2e.core.project.AbstractProjectScanner;
-import org.eclipse.osgi.util.NLS;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
/**
* Maven project scanner using dependency list
- *
+ *
* @author Eugene Kuleshov
*/
public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProjectScmInfo> {
private static final Logger log = LoggerFactory.getLogger(MavenProjectPomScanner.class);
private final boolean developer;
-
+
private final Dependency[] dependencies;
-
+
private IMaven maven;
public MavenProjectPomScanner(boolean developer, Dependency[] dependencies) {
@@ -59,24 +64,25 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
}
public String getDescription() {
- if(dependencies.length==1) {
+ if(dependencies.length == 1) {
Dependency d = dependencies[0];
- return d.getGroupId() + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier()==null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return d.getGroupId()
+ + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier() == null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return "" + dependencies.length + " projects"; //$NON-NLS-1$
}
-
+
public void run(IProgressMonitor monitor) throws InterruptedException {
for(int i = 0; i < dependencies.length; i++ ) {
if(monitor.isCanceled()) {
throw new InterruptedException();
}
-
+
Dependency d = dependencies[i];
try {
Model model = resolveModel(d.getGroupId(), d.getArtifactId(), d.getVersion(), monitor);
- if(model==null) {
+ if(model == null) {
String msg = "Can't resolve " + d.getArtifactId();
Exception error = new Exception(msg);
log.error(msg, error);
@@ -85,14 +91,14 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
}
Scm scm = resolveScm(model, monitor);
- if(scm==null) {
+ if(scm == null) {
String msg = "No SCM info for " + d.getArtifactId();
Exception error = new Exception(msg);
log.error(msg, error);
addError(error);
continue;
}
-
+
String tag = scm.getTag();
log.info(d.getArtifactId());
@@ -100,11 +106,11 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
log.info(" dev: " + scm.getDeveloperConnection());
log.info(" url: " + scm.getUrl());
log.info(" tag: " + tag);
-
+
String connection;
if(developer) {
connection = scm.getDeveloperConnection();
- if(connection==null) {
+ if(connection == null) {
String msg = d.getArtifactId() + " doesn't specify developer SCM connection";
Exception error = new Exception(msg);
log.error(msg, error);
@@ -113,7 +119,7 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
}
} else {
connection = scm.getConnection();
- if(connection==null) {
+ if(connection == null) {
String msg = d.getArtifactId() + " doesn't specify SCM connection";
Exception error = new Exception(msg);
log.error(msg, error);
@@ -121,21 +127,21 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
continue;
}
}
-
+
// connection: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
// dev: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
// url: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket
// tag: HEAD
// TODO add an option to select all modules/projects and optimize scan
-
+
if(connection.endsWith("/")) { //$NON-NLS-1$
- connection = connection.substring(0, connection.length()-1);
+ connection = connection.substring(0, connection.length() - 1);
}
-
+
int n = connection.lastIndexOf("/"); //$NON-NLS-1$
String label = (n == -1 ? connection : connection.substring(n)) + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
-
+
addProject(new MavenProjectScmInfo(label, model, null, tag, connection, connection));
} catch(Exception ex) {
@@ -143,7 +149,7 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
String msg = "Error reading " + d.getArtifactId();
log.error(msg, ex);
}
- }
+ }
}
private Scm resolveScm(Model model, IProgressMonitor monitor) throws ArtifactResolutionException,
@@ -152,50 +158,51 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
if(scm != null) {
return scm;
}
-
+
Parent parent = model.getParent();
if(parent == null) {
return null;
}
Model parentModel = resolveModel(parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), monitor);
- if(parentModel==null) {
+ if(parentModel == null) {
return null;
}
-
+
Scm parentScm = resolveScm(parentModel, monitor);
- if(parentScm==null) {
+ if(parentScm == null) {
return null;
}
-
+
Set<String> modules = new HashSet<String>(parentModel.getModules());
List<Profile> parentModelProfiles = parentModel.getProfiles();
for(Profile profile : parentModelProfiles) {
modules.addAll(profile.getModules());
}
-
+
// heuristics for matching module names to artifactId
String artifactId = model.getArtifactId();
for(String module : modules) {
if(module.equals(artifactId) || module.endsWith("/" + artifactId)) { //$NON-NLS-1$
- if(parentScm.getConnection()!=null) {
+ if(parentScm.getConnection() != null) {
parentScm.setConnection(parentScm.getConnection() + "/" + module); //$NON-NLS-1$
}
- if(parentScm.getDeveloperConnection()!=null) {
+ if(parentScm.getDeveloperConnection() != null) {
parentScm.setDeveloperConnection(parentScm.getDeveloperConnection() + "/" + module); //$NON-NLS-1$
}
- return parentScm;
+ return parentScm;
}
}
-
+
// XXX read modules from profiles
-
+
return parentScm;
}
private Model resolveModel(String groupId, String artifactId, String version, IProgressMonitor monitor)
throws CoreException {
- monitor.subTask(NLS.bind(Messages.MavenProjectPomScanner_task_resolving, new Object[] { groupId, artifactId, version}));
+ monitor.subTask(NLS.bind(Messages.MavenProjectPomScanner_task_resolving,
+ new Object[] {groupId, artifactId, version}));
List<ArtifactRepository> repositories = maven.getArtifactRepositories();
Artifact artifact = maven.resolve(groupId, artifactId, version, "pom", null, repositories, monitor); //$NON-NLS-1$
@@ -204,13 +211,12 @@ public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProje
if(file == null) {
return null;
}
-
+
// XXX this fail on reading extensions
// MavenProject project = embedder.readProject(file);
-
+
monitor.subTask(NLS.bind(Messages.MavenProjectPomScanner_23, new Object[] {groupId, artifactId, version}));
return maven.readModel(file);
}
-
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java
index 8b6f925a..92044832 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/MavenProjectScmInfo.java
@@ -24,14 +24,19 @@ import org.eclipse.m2e.core.project.MavenProjectInfo;
public class MavenProjectScmInfo extends MavenProjectInfo {
private final String folderUrl;
+
private final String repositoryUrl;
+
private final String revision;
+
private final String branch;
-
+
private String username;
+
private String password;
private File sslCertificate;
+
private String sslCertificatePassphrase;
public MavenProjectScmInfo(String label, Model model, MavenProjectInfo parent, //
@@ -47,19 +52,19 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
this.repositoryUrl = repositoryUrl;
this.branch = branch;
}
-
+
public String getBranch() {
return this.branch;
}
-
+
public String getRevision() {
return this.revision;
}
-
+
public String getFolderUrl() {
return folderUrl;
}
-
+
public String getRepositoryUrl() {
return repositoryUrl;
}
@@ -75,7 +80,7 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
public int hashCode() {
return folderUrl.hashCode();
}
-
+
public String toString() {
return getLabel() + " " + folderUrl; //$NON-NLS-1$
}
@@ -83,6 +88,7 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
public String getUsername() {
return username;
}
+
public void setUsername(String username) {
this.username = username;
}
@@ -90,6 +96,7 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
public String getPassword() {
return password;
}
+
public void setPassword(String password) {
this.password = password;
}
@@ -97,6 +104,7 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
public void setSSLCertificate(File certificate) {
this.sslCertificate = certificate;
}
+
public File getSSLCertificate() {
return sslCertificate;
}
@@ -104,6 +112,7 @@ public class MavenProjectScmInfo extends MavenProjectInfo {
public String getSSLCertificatePassphrase() {
return sslCertificatePassphrase;
}
+
public void setSSLCertificatePassphrase(String passphrase) {
this.sslCertificatePassphrase = passphrase;
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java
index de5b88f9..3d73f82b 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmTag.java
@@ -13,7 +13,7 @@ package org.eclipse.m2e.scm;
/**
* An SCM wrapper for tags
- *
+ *
* @author Eugene Kuleshov
*/
public class ScmTag {
@@ -21,10 +21,10 @@ public class ScmTag {
public static enum Type {
HEAD, TAG, BRANCH, DATE;
}
-
+
private final String name;
+
private final Type type;
-
public ScmTag(String name) {
this(name, null);
@@ -48,6 +48,5 @@ public class ScmTag {
public Type getType() {
return this.type;
}
-
-}
+}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java
index 16c81a20..9dfc02ec 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/ScmUrl.java
@@ -14,9 +14,11 @@ package org.eclipse.m2e.scm;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.scm.internal.Messages;
-import org.eclipse.osgi.util.NLS;
+
/**
* An SCM URL wrapper used to adapt 3rd party resources:
@@ -27,18 +29,19 @@ import org.eclipse.osgi.util.NLS;
*
* @see http://maven.apache.org/scm/scm-url-format.html
* @see org.eclipse.core.runtime.IAdapterManager
- *
* @author Eugene Kuleshov
*/
public class ScmUrl {
private final String scmUrl;
+
private final String scmParentUrl;
+
private final ScmTag tag;
public ScmUrl(String scmUrl) {
this(scmUrl, null);
}
-
+
public ScmUrl(String scmUrl, String scmParentUrl) {
this(scmUrl, scmParentUrl, null);
}
@@ -48,28 +51,28 @@ public class ScmUrl {
this.scmParentUrl = scmParentUrl;
this.tag = tag;
}
-
+
/**
* Return SCM url
*/
public String getUrl() {
return scmUrl;
}
-
+
/**
* Return SCM url for the parent folder
*/
public String getParentUrl() {
return scmParentUrl;
}
-
+
/**
* Return SCM tag
*/
public ScmTag getTag() {
return this.tag;
}
-
+
/**
* Return provider-specific part of the SCM url
*
@@ -79,7 +82,7 @@ public class ScmUrl {
try {
String type = ScmUrl.getType(scmUrl);
return scmUrl.substring(type.length() + 5);
-
+
} catch(CoreException ex) {
return null;
}
@@ -87,11 +90,13 @@ public class ScmUrl {
public static synchronized String getType(String url) throws CoreException {
if(!url.startsWith("scm:")) { //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error, url), null));
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error,
+ url), null));
}
int n = url.indexOf(":", 4); //$NON-NLS-1$
if(n == -1) {
- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error, url), null));
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error,
+ url), null));
}
return url.substring(4, n);
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java
index 797543d0..b96338ee 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/Messages.java
@@ -85,8 +85,8 @@ public class Messages extends NLS {
public static String MavenCheckoutOperation_task_scanning;
public static String MavenCheckoutOperation_task_checking;
-
- public static String MavenCheckoutLocationPage_linkMarketPlace;
+
+ public static String MavenCheckoutLocationPage_linkMarketPlace;
static {
// initialize resource bundle
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
index 41890ac1..b8e9ee60 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/ScmHandlerFactory.java
@@ -17,17 +17,19 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
+
import org.eclipse.m2e.scm.ScmUrl;
import org.eclipse.m2e.scm.spi.ScmHandler;
import org.eclipse.m2e.scm.spi.ScmHandlerUi;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
@@ -37,15 +39,15 @@ import org.slf4j.LoggerFactory;
*/
public class ScmHandlerFactory {
private static final Logger log = LoggerFactory.getLogger(ScmHandlerFactory.class);
-
+
public static final String EXTENSION_SCM_HANDLERS = "org.eclipse.m2e.scm.scmHandlers"; //$NON-NLS-1$
-
+
public static final String EXTENSION_SCM_HANDLERS_UI = "org.eclipse.m2e.scm.scmHandlersUi"; //$NON-NLS-1$
-
+
private static final String ELEMENT_SCM_HANDLER = "handler"; //$NON-NLS-1$
private static final String ELEMENT_SCM_HANDLER_UI = "handlerUi"; //$NON-NLS-1$
-
+
private static volatile Map<String, List<ScmHandler>> scms;
private static volatile Map<String, ScmHandlerUi> scmUis;
@@ -128,7 +130,7 @@ public class ScmHandlerFactory {
}
return scmHandlers;
}
-
+
private static List<ScmHandlerUi> readScmHandlerUiExtensions() {
ArrayList<ScmHandlerUi> scmHandlerUis = new ArrayList<ScmHandlerUi>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java
index 706b2f27..d5c70b58 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/CheckoutAsMavenAction.java
@@ -17,39 +17,40 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
-import org.eclipse.m2e.scm.ScmUrl;
-import org.eclipse.m2e.scm.internal.wizards.MavenCheckoutWizard;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
+import org.eclipse.m2e.scm.ScmUrl;
+import org.eclipse.m2e.scm.internal.wizards.MavenCheckoutWizard;
+
/**
* Checkout as Maven project action
- *
+ *
* @author @author Eugene Kuleshov
*/
public class CheckoutAsMavenAction implements IObjectActionDelegate {
private IStructuredSelection selection;
+
private IWorkbenchPart targetPart;
/* (non-Javadoc)
* @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
+ if(selection instanceof IStructuredSelection) {
this.selection = (IStructuredSelection) selection;
}
}
-
+
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
this.targetPart = targetPart;
}
-
/* (non-Javadoc)
* @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
@@ -60,10 +61,10 @@ public class CheckoutAsMavenAction implements IObjectActionDelegate {
urls = new ScmUrl[selection.size()];
int i = 0;
for(Iterator<?> it = selection.iterator(); it.hasNext();) {
- urls[i++] = (ScmUrl) it.next();
+ urls[i++ ] = (ScmUrl) it.next();
}
}
-
+
MavenCheckoutWizard wizard = new MavenCheckoutWizard(urls);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.open();
@@ -86,5 +87,5 @@ public class CheckoutAsMavenAction implements IObjectActionDelegate {
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
return window == null ? null : window.getShell();
}
-
+
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java
index 7911b715..37a3523e 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/actions/MaterializeAction.java
@@ -11,17 +11,19 @@
package org.eclipse.m2e.scm.internal.actions;
-import org.apache.maven.model.Dependency;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.m2e.scm.internal.wizards.MavenMaterializePomWizard;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.scm.internal.wizards.MavenMaterializePomWizard;
+
public class MaterializeAction implements IObjectActionDelegate {
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java
index 00803275..dd314beb 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutLocationPage.java
@@ -14,7 +14,6 @@ package org.eclipse.m2e.scm.internal.wizards;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.maven.model.Scm;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
@@ -24,14 +23,6 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.RegistryFactory;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.m2e.core.project.ProjectImportConfiguration;
-import org.eclipse.m2e.core.ui.internal.IMavenDiscovery;
-import org.eclipse.m2e.core.ui.internal.wizards.AbstractMavenWizardPage;
-import org.eclipse.m2e.scm.ScmTag;
-import org.eclipse.m2e.scm.ScmUrl;
-import org.eclipse.m2e.scm.internal.Messages;
-import org.eclipse.m2e.scm.internal.ScmHandlerFactory;
-import org.eclipse.m2e.scm.spi.ScmHandlerUi;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -49,6 +40,17 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
+import org.apache.maven.model.Scm;
+
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.internal.IMavenDiscovery;
+import org.eclipse.m2e.core.ui.internal.wizards.AbstractMavenWizardPage;
+import org.eclipse.m2e.scm.ScmTag;
+import org.eclipse.m2e.scm.ScmUrl;
+import org.eclipse.m2e.scm.internal.Messages;
+import org.eclipse.m2e.scm.internal.ScmHandlerFactory;
+import org.eclipse.m2e.scm.spi.ScmHandlerUi;
+
/**
* @author Eugene Kuleshov
@@ -56,25 +58,27 @@ import org.eclipse.swt.widgets.Text;
public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
String scmType;
+
ScmUrl[] scmUrls;
+
String scmParentUrl;
-
+
Combo scmTypeCombo;
-
+
Combo scmUrlCombo;
-
+
Button scmUrlBrowseButton;
-
+
Button headRevisionButton;
Label revisionLabel;
-
+
Text revisionText;
-
+
Button revisionBrowseButton;
-
+
private Button checkoutAllProjectsButton;
-
+
private Link m2eMarketplace;
protected MavenCheckoutLocationPage(ProjectImportConfiguration projectImportConfiguration) {
@@ -119,8 +123,8 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
}
}
});
-
- if(scmUrls!=null && scmUrls.length == 1) {
+
+ if(scmUrls != null && scmUrls.length == 1) {
try {
scmType = ScmUrl.getType(scmUrls[0].getUrl());
} catch(CoreException ex) {
@@ -155,15 +159,15 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
revisionTextData.widthHint = 115;
revisionTextData.verticalIndent = 3;
revisionText.setLayoutData(revisionTextData);
-
+
if(scmUrls != null) {
ScmTag tag = scmUrls[0].getTag();
- if(tag!=null) {
+ if(tag != null) {
headRevisionButton.setSelection(false);
revisionText.setText(tag.getName());
}
}
-
+
revisionText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updatePage();
@@ -178,15 +182,15 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
revisionBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String url = scmParentUrl;
- if(url==null) {
+ if(url == null) {
return;
}
-
+
String scmType = scmTypeCombo.getText();
-
+
ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
String revision = handlerUi.selectRevision(getShell(), scmUrls[0], revisionText.getText());
- if(revision!=null) {
+ if(revision != null) {
revisionText.setText(revision);
headRevisionButton.setSelection(false);
updatePage();
@@ -210,7 +214,7 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
advancedSettingsData.verticalIndent = 10;
createAdvancedSettings(composite, advancedSettingsData);
- if(scmUrls!=null && scmUrls.length == 1) {
+ if(scmUrls != null && scmUrls.length == 1) {
scmTypeCombo.setText(scmType == null ? "" : scmType); //$NON-NLS-1$
scmUrlCombo.setText(scmUrls[0].getProviderUrl());
}
@@ -220,11 +224,11 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
public void widgetSelected(SelectionEvent e) {
ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
// XXX should use null if there is no scmUrl selected
- ScmUrl currentUrl = scmUrls==null || scmUrls.length==0 ? new ScmUrl("scm:" + scmType + ":") : scmUrls[0]; //$NON-NLS-1$ //$NON-NLS-2$
+ ScmUrl currentUrl = scmUrls == null || scmUrls.length == 0 ? new ScmUrl("scm:" + scmType + ":") : scmUrls[0]; //$NON-NLS-1$ //$NON-NLS-2$
ScmUrl scmUrl = handlerUi.selectUrl(getShell(), currentUrl);
- if(scmUrl!=null) {
+ if(scmUrl != null) {
scmUrlCombo.setText(scmUrl.getProviderUrl());
- if(scmUrls==null) {
+ if(scmUrls == null) {
scmUrls = new ScmUrl[1];
}
scmUrls[0] = scmUrl;
@@ -233,7 +237,7 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
}
}
});
-
+
scmUrlCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
final String url = scmUrlCombo.getText();
@@ -251,11 +255,11 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
}
return;
}
-
- if(scmUrls==null) {
+
+ if(scmUrls == null) {
scmUrls = new ScmUrl[1];
}
-
+
ScmUrl scmUrl = new ScmUrl("scm:" + scmType + ":" + url); //$NON-NLS-1$ //$NON-NLS-2$
scmUrls[0] = scmUrl;
scmParentUrl = scmUrl.getUrl();
@@ -307,29 +311,29 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
*/
public void setVisible(boolean visible) {
super.setVisible(visible);
-
- if(dialogSettings!=null && scmUrlCombo!=null) {
+
+ if(dialogSettings != null && scmUrlCombo != null) {
String[] items = dialogSettings.getArray("scmUrl"); //$NON-NLS-1$
if(items != null) {
String text = scmUrlCombo.getText();
scmUrlCombo.setItems(items);
- if (text.length() > 0) {
+ if(text.length() > 0) {
// setItems() clears the text input, so we need to restore it
scmUrlCombo.setText(text);
}
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.m2e.wizards.AbstractMavenWizardPage#dispose()
*/
public void dispose() {
- if(dialogSettings != null && scmUrlCombo!=null) {
+ if(dialogSettings != null && scmUrlCombo != null) {
Set<String> history = new LinkedHashSet<String>(MAX_HISTORY);
-
+
String lastValue = scmUrlCombo.getText();
- if ( lastValue!=null && lastValue.trim().length() > 0 ) {
+ if(lastValue != null && lastValue.trim().length() > 0) {
history.add("scm:" + scmType + ":" + lastValue); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -337,27 +341,27 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
for(int j = 0; j < items.length && history.size() < MAX_HISTORY; j++ ) {
history.add(items[j]);
}
-
+
dialogSettings.put("scmUrl", history.toArray(new String[history.size()])); //$NON-NLS-1$
}
-
+
super.dispose();
}
-
+
public IWizardContainer getContainer() {
return super.getContainer();
}
-
+
void updatePage() {
- boolean canSelectUrl = false ;
+ boolean canSelectUrl = false;
boolean canSelectRevision = false;
ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
- if(handlerUi!=null) {
+ if(handlerUi != null) {
canSelectUrl = handlerUi.canSelectUrl();
canSelectRevision = handlerUi.canSelectRevision();
}
-
- if(scmUrlBrowseButton!=null) {
+
+ if(scmUrlBrowseButton != null) {
scmUrlBrowseButton.setEnabled(canSelectUrl);
scmUrlBrowseButton.setVisible(canSelectUrl);
}
@@ -367,14 +371,14 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
boolean isHeadRevision = isHeadRevision();
revisionLabel.setEnabled(!isHeadRevision);
revisionText.setEnabled(!isHeadRevision);
-
+
setPageComplete(isPageValid());
}
private boolean isPageValid() {
setErrorMessage(null);
-
- if(scmUrls != null && scmUrls.length < 2) {
+
+ if(scmUrls != null && scmUrls.length < 2) {
if(scmType == null) {
setErrorMessage(Messages.MavenCheckoutLocationPage_error_empty);
return false;
@@ -382,52 +386,52 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
}
ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
-
+
if(scmUrls == null || scmUrls.length < 2) {
if(scmUrls == null || scmUrls.length == 0) {
setErrorMessage(Messages.MavenCheckoutLocationPage_error_empty_url);
return false;
}
-
- if(handlerUi!=null && !handlerUi.isValidUrl(scmUrls[0].getUrl())) {
+
+ if(handlerUi != null && !handlerUi.isValidUrl(scmUrls[0].getUrl())) {
setErrorMessage(Messages.MavenCheckoutLocationPage_error_url_empty);
return false;
}
}
-
+
if(!isHeadRevision()) {
String revision = revisionText.getText().trim();
- if(revision.length()==0) {
+ if(revision.length() == 0) {
setErrorMessage(Messages.MavenCheckoutLocationPage_error_scm_empty);
return false;
}
-
- if(handlerUi!=null && !handlerUi.isValidRevision(null, revision)) {
+
+ if(handlerUi != null && !handlerUi.isValidRevision(null, revision)) {
setErrorMessage(Messages.MavenCheckoutLocationPage_error_scm_invalid);
return false;
- }
+ }
}
-
+
return true;
}
-
+
public void setParent(String parentUrl) {
this.scmParentUrl = parentUrl;
}
-
+
public void setUrls(ScmUrl[] urls) {
this.scmUrls = urls;
}
-
+
public ScmUrl[] getUrls() {
return scmUrls;
}
-
+
public Scm[] getScms() {
- if(scmUrls==null) {
+ if(scmUrls == null) {
return new Scm[0];
}
-
+
String revision = getRevision();
Scm[] scms = new Scm[scmUrls.length];
for(int i = 0; i < scms.length; i++ ) {
@@ -438,7 +442,7 @@ public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
}
return scms;
}
-
+
public boolean isCheckoutAllProjects() {
return checkoutAllProjectsButton.getSelection();
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java
index 804a816f..a537a832 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenCheckoutWizard.java
@@ -15,21 +15,23 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import org.apache.maven.model.Scm;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.apache.maven.model.Scm;
+
import org.eclipse.m2e.core.internal.IMavenConstants;
-import org.eclipse.m2e.scm.internal.Messages;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
import org.eclipse.m2e.core.ui.internal.wizards.AbstractMavenProjectWizard;
import org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardLocationPage;
import org.eclipse.m2e.scm.MavenProjectScmInfo;
import org.eclipse.m2e.scm.ScmUrl;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
+import org.eclipse.m2e.scm.internal.Messages;
/**
@@ -42,11 +44,11 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
private ScmUrl[] urls;
private String parentUrl;
-
+
private MavenCheckoutLocationPage scheckoutPage;
private MavenProjectWizardLocationPage locationPage;
-
+
public MavenCheckoutWizard() {
this(null);
setNeedsProgressMonitor(true);
@@ -73,21 +75,21 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
}
setUrls(urls.toArray(new ScmUrl[urls.size()]));
}
-
+
private void setUrls(ScmUrl[] urls) {
- if(urls!=null && urls.length>0) {
+ if(urls != null && urls.length > 0) {
this.urls = urls;
this.parentUrl = getParentUrl(urls);
}
}
private String getParentUrl(ScmUrl[] urls) {
- if(urls.length==1) {
+ if(urls.length == 1) {
return urls[0].getUrl();
}
-
+
String parent = urls[0].getParentUrl();
- for(int i = 1; parent!=null && i < urls.length; i++ ) {
+ for(int i = 1; parent != null && i < urls.length; i++ ) {
String url = urls[i].getParentUrl();
if(!parent.equals(url)) {
parent = null;
@@ -95,21 +97,20 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
}
return parent;
}
-
+
public void addPages() {
scheckoutPage = new MavenCheckoutLocationPage(importConfiguration);
scheckoutPage.setUrls(urls);
scheckoutPage.setParent(parentUrl);
-
+
locationPage = new MavenProjectWizardLocationPage(importConfiguration, //
- Messages.MavenCheckoutWizard_location1,
- Messages.MavenCheckoutWizard_location2, workingSets);
+ Messages.MavenCheckoutWizard_location1, Messages.MavenCheckoutWizard_location2, workingSets);
locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
-
+
addPage(scheckoutPage);
addPage(locationPage);
}
-
+
// /** Adds the listeners after the page controls are created. */
// public void createPageControls(Composite pageContainer) {
// super.createPageControls(pageContainer);
@@ -138,16 +139,16 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
final boolean checkoutAllProjects = scheckoutPage.isCheckoutAllProjects();
Scm[] scms = scheckoutPage.getScms();
-
+
final Collection<MavenProjectScmInfo> mavenProjects = new ArrayList<MavenProjectScmInfo>();
for(int i = 0; i < scms.length; i++ ) {
String url = scms[i].getConnection();
String revision = scms[i].getTag();
-
+
if(url.endsWith("/")) { //$NON-NLS-1$
- url = url.substring(0, url.length()-1);
+ url = url.substring(0, url.length() - 1);
}
-
+
int n = url.lastIndexOf("/"); //$NON-NLS-1$
String label = (n == -1 ? url : url.substring(n)) + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
MavenProjectScmInfo projectInfo = new MavenProjectScmInfo(label, null, //
@@ -164,7 +165,7 @@ public class MavenCheckoutWizard extends AbstractMavenProjectWizard implements I
if(!locationPage.isInWorkspace()) {
job.setLocation(locationPage.getLocationPath().toFile());
}
-
+
job.schedule();
return true;
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java
index 52de1b47..d960cc7c 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenMaterializePomWizard.java
@@ -15,9 +15,18 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.apache.maven.model.Dependency;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.apache.maven.model.Dependency;
+
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
import org.eclipse.m2e.core.ui.internal.actions.SelectionUtil;
@@ -27,30 +36,23 @@ import org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardLocationPage;
import org.eclipse.m2e.scm.MavenProjectPomScanner;
import org.eclipse.m2e.scm.MavenProjectScmInfo;
import org.eclipse.m2e.scm.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
/**
- * A wizard used to import projects for Maven artifacts
+ * A wizard used to import projects for Maven artifacts
*
* @author Eugene Kuleshov
*/
public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implements IImportWizard, INewWizard {
-
+
MavenDependenciesWizardPage selectionPage;
-
+
MavenProjectWizardLocationPage locationPage;
-
+
Button checkOutAllButton;
-
+
Button useDeveloperConnectionButton;
-
+
// TODO replace with ArtifactKey
private Dependency[] dependencies;
@@ -63,7 +65,7 @@ public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implem
public void setDependencies(Dependency[] dependencies) {
this.dependencies = dependencies;
}
-
+
public Dependency[] getDependencies() {
return dependencies;
}
@@ -76,7 +78,7 @@ public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implem
for(Iterator<?> it = selection.iterator(); it.hasNext();) {
Object element = it.next();
ArtifactKey artifactKey = SelectionUtil.getType(element, ArtifactKey.class);
- if(artifactKey!=null) {
+ if(artifactKey != null) {
Dependency d = new Dependency();
d.setGroupId(artifactKey.getGroupId());
d.setArtifactId(artifactKey.getArtifactId());
@@ -85,7 +87,7 @@ public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implem
dependencies.add(d);
}
}
-
+
setDependencies(dependencies.toArray(new Dependency[dependencies.size()]));
}
@@ -97,25 +99,26 @@ public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implem
checkOutAllButton = new Button(composite, SWT.CHECK);
checkOutAllButton.setText(Messages.MavenMaterializePomWizard_btnCheckout);
checkOutAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
-
+
useDeveloperConnectionButton = new Button(composite, SWT.CHECK);
useDeveloperConnectionButton.setText(Messages.MavenMaterializePomWizard_btnDev);
useDeveloperConnectionButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
-
+
super.createAdvancedSettings(composite, gridData);
}
};
selectionPage.setDependencies(dependencies);
-
- locationPage = new MavenProjectWizardLocationPage(importConfiguration, //
- Messages.MavenMaterializePomWizard_location_title,
- Messages.MavenMaterializePomWizard_location_message, workingSets);
+
+ locationPage = new MavenProjectWizardLocationPage(
+ importConfiguration, //
+ Messages.MavenMaterializePomWizard_location_title, Messages.MavenMaterializePomWizard_location_message,
+ workingSets);
locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
-
+
addPage(selectionPage);
addPage(locationPage);
}
-
+
public boolean canFinish() {
return super.canFinish();
}
@@ -126,25 +129,25 @@ public class MavenMaterializePomWizard extends AbstractMavenProjectWizard implem
}
final Dependency[] dependencies = selectionPage.getDependencies();
-
+
final boolean checkoutAllProjects = checkOutAllButton.getSelection();
final boolean developer = useDeveloperConnectionButton.getSelection();
-
+
MavenProjectCheckoutJob job = new MavenProjectCheckoutJob(importConfiguration, checkoutAllProjects, workingSets) {
protected List<MavenProjectScmInfo> getProjects(IProgressMonitor monitor) throws InterruptedException {
MavenProjectPomScanner<MavenProjectScmInfo> scanner = new MavenProjectPomScanner<MavenProjectScmInfo>(
developer, dependencies);
scanner.run(monitor);
// XXX handle errors/warnings
-
+
return scanner.getProjects();
}
};
-
+
if(!locationPage.isInWorkspace()) {
job.setLocation(locationPage.getLocationPath().toFile());
}
-
+
job.schedule();
return true;
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
index 85bd4a69..51310086 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/internal/wizards/MavenProjectCheckoutJob.java
@@ -18,9 +18,9 @@ import java.util.Collection;
import java.util.List;
import java.util.Set;
-import org.apache.maven.model.Model;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -37,6 +37,20 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.NewProjectAction;
+import org.eclipse.ui.progress.IProgressConstants;
+import org.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizard;
+
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.FileUtils;
+
+import org.apache.maven.model.Model;
+
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.eclipse.m2e.core.internal.lifecyclemapping.discovery.LifecycleMappingConfiguration;
@@ -51,16 +65,6 @@ import org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard;
import org.eclipse.m2e.scm.MavenCheckoutOperation;
import org.eclipse.m2e.scm.MavenProjectScmInfo;
import org.eclipse.m2e.scm.internal.Messages;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.NewProjectAction;
-import org.eclipse.ui.progress.IProgressConstants;
-import org.eclipse.ui.wizards.datatransfer.ExternalProjectImportWizard;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
@@ -72,13 +76,13 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
private static final Logger log = LoggerFactory.getLogger(MavenProjectCheckoutJob.class);
final ProjectImportConfiguration configuration;
-
+
boolean checkoutAllProjects;
Collection<MavenProjectInfo> projects;
File location;
-
+
List<String> collectedLocations = new ArrayList<String>();
final List<IWorkingSet> workingSets;
@@ -93,16 +97,15 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
addJobChangeListener(new CheckoutJobChangeListener());
}
-
+
public void setLocation(File location) {
this.location = location;
}
-
+
protected abstract Collection<MavenProjectScmInfo> getProjects(IProgressMonitor monitor) throws InterruptedException;
-
-
+
// WorkspaceJob
-
+
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
try {
MavenCheckoutOperation operation = new MavenCheckoutOperation(location, getProjects(monitor));
@@ -112,13 +115,13 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
-
+
LocalProjectScanner scanner = new LocalProjectScanner(workspace.getLocation().toFile(), operation.getLocations(),
true, modelManager);
scanner.run(monitor);
this.projects = MavenPlugin.getProjectConfigurationManager().collectProjects(scanner.getProjects());
-
+
if(checkoutAllProjects) {
// check if there any project name conflicts
for(MavenProjectInfo projectInfo : projects) {
@@ -160,17 +163,17 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
if(projects.isEmpty()) {
log.info("No Maven projects to import");
-
- if(collectedLocations.size()==1) {
+
+ if(collectedLocations.size() == 1) {
final String location = collectedLocations.get(0);
-
+
DirectoryScanner projectScanner = new DirectoryScanner();
projectScanner.setBasedir(location);
projectScanner.setIncludes(new String[] {"**/.project"}); //$NON-NLS-1$
projectScanner.scan();
-
+
String[] projectFiles = projectScanner.getIncludedFiles();
- if(projectFiles!=null && projectFiles.length>0) {
+ if(projectFiles != null && projectFiles.length > 0) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
boolean res = MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay().getActiveShell(), //
@@ -188,7 +191,7 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
});
return;
}
-
+
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() {
boolean res = MessageDialog.openConfirm(PlatformUI.getWorkbench().getDisplay().getActiveShell(), //
@@ -196,9 +199,10 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
Messages.MavenProjectCheckoutJob_confirm2_message);
if(res) {
Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay());
- clipboard.setContents(new Object[] { location }, new Transfer[] { TextTransfer.getInstance() });
-
- NewProjectAction newProjectAction = new NewProjectAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ clipboard.setContents(new Object[] {location}, new Transfer[] {TextTransfer.getInstance()});
+
+ NewProjectAction newProjectAction = new NewProjectAction(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow());
newProjectAction.run();
} else {
cleanup(collectedLocations);
@@ -210,7 +214,7 @@ public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
cleanup(collectedLocations);
}
-
+
if(checkoutAllProjects) {
if(M2EUIPluginActivator.getDefault().getMavenDiscovery() != null) {
final LifecycleMappingConfiguration mappingConfiguration = LifecycleMappingConfiguration.calculate(projects,
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
index f5f8efd1..f3a2b2a0 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandler.java
@@ -14,27 +14,33 @@ package org.eclipse.m2e.scm.spi;
import java.io.File;
import java.io.InputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IProgressMonitor;
+
import org.eclipse.m2e.scm.MavenProjectScmInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
/**
* An SCM handler base class
- *
+ *
* @author Eugene Kuleshov
*/
public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableExtension {
private static final Logger log = LoggerFactory.getLogger(ScmHandler.class);
public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+
public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
+
public static final String ATTR_PRIORITY = "priority"; //$NON-NLS-1$
-
+
private String type;
+
private int priority;
public String getType() {
@@ -44,21 +50,19 @@ public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableE
public int getPriority() {
return priority;
}
-
+
/**
* Opens resource from SCM
*
* @param url an url in maven-scm format for the resource to open
* @param revision a resource revision to open
- *
* @throws CoreException when selected resource can't be open
- *
* @see http://maven.apache.org/scm/scm-url-format.html
*/
public InputStream open(String url, String revision) throws CoreException {
return null;
}
-
+
/**
* @param info
* @param location
@@ -66,17 +70,17 @@ public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableE
*/
public abstract void checkoutProject(MavenProjectScmInfo info, //
File location, IProgressMonitor monitor) throws CoreException, InterruptedException;
-
+
// IExecutableExtension
-
+
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
String handlerClass = config.getAttribute(propertyName);
String type = config.getAttribute(ATTR_TYPE);
String priority = config.getAttribute(ATTR_PRIORITY);
this.type = type;
-
- if(priority!=null) {
+
+ if(priority != null) {
try {
this.priority = Integer.parseInt(priority);
} catch(Exception ex) {
@@ -84,17 +88,17 @@ public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableE
}
}
}
-
+
// Comparable
-
+
public int compareTo(ScmHandler o) {
if(o != null) {
ScmHandler handler = o;
int res = getType().compareTo(handler.getType());
- if(res==0) {
+ if(res == 0) {
res = getPriority() - handler.getPriority();
}
- return res;
+ return res;
}
return -1;
}
diff --git a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java
index 865a0214..6f2dde68 100644
--- a/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java
+++ b/org.eclipse.m2e.scm/src/org/eclipse/m2e/scm/spi/ScmHandlerUi.java
@@ -13,20 +13,23 @@ package org.eclipse.m2e.scm.spi;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.m2e.scm.ScmUrl;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.m2e.scm.ScmUrl;
+
+
/**
* An SCM handler UI base class
- *
+ *
* @author Eugene Kuleshov
*/
public abstract class ScmHandlerUi implements IExecutableExtension {
public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
+
public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
-
+
private String type;
-
+
public String getType() {
return type;
}
@@ -53,11 +56,11 @@ public abstract class ScmHandlerUi implements IExecutableExtension {
public ScmUrl selectUrl(Shell shell, ScmUrl scmUrl) {
return null;
}
-
+
public boolean isValidUrl(String scmUrl) {
return false;
}
-
+
public boolean isValidRevision(ScmUrl scmUrl, String scmRevision) {
return false;
}
@@ -70,12 +73,10 @@ public abstract class ScmHandlerUi implements IExecutableExtension {
return false;
}
-
// IExecutableExtension
-
+
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
this.type = config.getAttribute(ATTR_TYPE);
}
-
-}
+}

Back to the top