개발/운영 환경에 따라 설정파일관련 정보들이 빌드 시점에 동적으로 변경되어야 한다.

Maven에는 Profile이라는 기능을 통하여 처리하는 반면, Gradle의 경우 System Propertie와 비슷한 방법을 이용하여 처리한다.


[디렉토리 구조]



[build.gradle]

build 시작에 properties-dev 에 있는 내용을 properties 에 옮기고, logback.xml 파일은 class root에 위치 시키는 내용이다.

build 실행 시 target이라는 옵션을 주면 된다.

-Ptarget=dev build  // 주의할 점은 java VM -D가 아니라는 점임

...

sourceSets {
	def targetServer = project.hasProperty('target') ? project.getProperty('target') : 'local'
	println "targetServer: $targetServer"
	if( "$targetServer" != "local" ){
		copy {
			from("src/main/resources/properties-$targetServer"){
				exclude 'logback.xml'
			}
			into "src/main/resources/properties"
		}
		copy {
			from("src/main/resources/properties-$targetServer"){
				include 'logback.xml'
			}
			into("src/main/resources/")
		}
		delete file("src/main/resources/properties-dev")
		delete file("src/main/resources/properties-stage")
		delete file('src/main/resources/properties-real')
	}
}

...


svn: POST of '': 404 Not Found 


Window -> Team -> SVN -> SVN Connector 탭 -> SVN Connector 셀렉트 -> SVNKit .... 선택

[build.gradle]

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'findbugs'
apply plugin: 'pmd'

repositories {
    mavenCentral()
}

sourceCompatibility = 1.7
version = '1.0'
jar {
    manifest {
        attributes 'Implementation-Title': 'StudyPd3Sample', 'Implementation-Version': version
    }
}
group = 'pe.kr.ddakker'


findbugs {
	toolVersion = "2.0.1"
	sourceSets = [sourceSets.main]
	ignoreFailures = true
	reportsDir = file("$project.buildDir/findbugsReports")
	effort = "default"
	reportLevel = "medium"
	includeFilter = file("$rootProject.projectDir/config/findbugs/includeFilter.xml")
	excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
}

tasks.withType(FindBugs) {
    reports {
        xml.enabled = true
        html.enabled = false
    }
}



pmd {
	ignoreFailures = true
	toolVersion = "2.0.1"
	ruleSetFiles = files("$rootProject.projectDir/config/pmd/myRuleSet.xml")
}


dependencies {
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    //compile "com.google.code.findbugs:annotations:2.0.1"
    //findbugs "com.google.code.findbugs:findbugs-ant:2.0.1"
    pmd group:'pmd', name:'pmd', version:'4.2.5'
    testCompile group: 'junit', name: 'junit', version: '4.11'
}


test {
    systemProperties 'property': 'value'
}

uploadArchives {
    repositories {
       flatDir {
           dirs 'repos'
       }
    }
}

tasks.withType(Compile) {
    options.encoding = 'UTF-8'
}
/*
javadoc {
    options.addStringOption("locale","ko_KR");
    options.addStringOption("encoding","UTF-8");
    options.addStringOption("charset","UTF-8");
    options.addStringOption("docencoding","UTF-8");
}
*/


[/config/pmd/myRuleSet.xml]




    
    	
    
    
    
    
        
    
    
        
        
        
        
        
        
    


[/config/findbugs/includeFilter.xml]



	
		
	
	
		
	
	
		
	
	
		
	
	
		
	
	
		
	
	
		
	


[/config/findbugs/excludeFilter.xml]



	
		
	



단축키

Setting 에서 Keymap 에서 Eclipse 스타일 설정 후!!!

 단축키

 동작

 Eclipse

IntelliJ IDEA

 Ctrl + 1

 Alt + Enter

 import 되지 않은 Class import 도움

 Alt + Shift + O

 Ctrl + Alt + O

 import 정리
 Ctrl + D

 Ctrl + Y 

 라인 삭제 

 Alt + Shift + S

 Alt + Insert 

 코드 삽입(Constructor, get/setter, toString 등)

 Ctrl + N

 Alt + Shift + N

 Ctrl + Alt + Insert 

 신규 파일 생성(java, JSP 등) 

 sysout, syserr

 sout, serr

 System.out.println, System.err.println(Code Templetes)

 

 Ctrl + Shift + T

 Class 에 대한 TestCase 파일 생성 및 이동 

 Ctrl + Shift + T

 Ctrl + N

 Class 찾기

 Ctrl + Shift + R

 Ctrl + Shift + N

 Resource 찾기

 Ctrl + k

 Ctrl + F3 이후 F3, Shift + 3 

 선택된 단어 다음/이전 찾기

 

 Ctrl + Tab

 이전 소스

  Ctrl + p

 메소드 내부 파라미터 정보 확인 

  Alt + Shift + Insert

 컬럼모드(Column) 진입

  Ctrl + Alt + ← Ctrl 마우스 클릭으로 이동 된 경우 뒤로 돌아오기
 Ctrl + E

 Ctrl + E

 Ctrl + Shift + E

 eclipse = 열린 파일

 idea = 최근 열린 파일 

 F4

 Ctrl + H

 eclipse = 선택된 단어에 대한 Hierarchy

 idea = 열려 있는 Editor 소스에 대한 Hierarchy

 Ctrl + delete

 Ctrl + ←

 Ctrl + delete

 Ctrl + ←

 단어 단위 삭제 

 Ctrl + Shift + O

 Ctrl + Alt + O

 사용되지 않는 import 제거

 Ctrl + Shift + F

 Ctrl + Alt + L

 코드 포멧(자동 정렬)

 Alt + Shift + Z

 Ctrl + Alt + T

 선택된 코드 둘러 싸기(if, while 등) 

 Alt + Shift + L

 Ctrl + Alt + V

 선택된 내용 지역변수로 리팩토링(Extract Local Variable)

 있었던거 같은데 읍어졌네.. Ctrl + Alt + F 지역 변수 전역변수로 리팩토링(Convert local variable to field) 

 Alt + Shift + M

 Ctrl + Alt + M

 선택된 영역 Method 분리 리팩토링(Extract Method)

 Shift + Enter
 Ctrl + Shift + Enter

 Shift + Enter

 Ctrl + Alt + Enter

 Ctrl + Shift + Enter

 어느 커서에 있던 한줄 밑에서 시작

 어느 커서에 있던 한줄 위에서 시작 

 어느 커서에 있던 줄끝에 ; 붙이기

 

 Ctrl + Alt + ←, →

 왼쪽, 오른쪽 에디터 이동

 Ctrl + Shift + L
(Spring STS Plugin)

 Ctrl + Shift + F

 모든 문서 내에서 Text 검색

 Alt + Shift + z

 Ctrl + Alt + t

 try cache, if, loop 등 코드 감쌓기

 Ctrl + Shift + y, x

 Ctrl + Shift + u

 대소문자 변경

 마우스 컨텍스트 메뉴

 Ctrl + Alt + Shift + c

 풀 패키지 + 클래스 복사(import 문자열?) 

 Ctrl + 마우스 대면 나옴 Ctrl + Alt + b

 구현체 찾기 

 

 Ctrl + Shift + Enter

 if, loop, ; 등 문장 자동완성

 Package Explorer 버튼이 있지

 Alt + F1 이후 1

소스 위치 이동 


Live Templates

iter

List<CustomGroup> coustomGroups = customGroupRepository.findAll();
for (CustomGroup coustomGroup : coustomGroups) {

}

ifn, inn

if (coustomGroup == null) {

}
if (coustomGroup != null) {

}


IntelliJ 를 사용해보니 Tomcat WTP에 있던 AJP 설정 부분이 보이지 않아 수동으로 설정하는 방법을...


VM Options 에 적당한 key값에 셋팅해주고, 




.../tomcat/conf/server.xml 설정파일을 수정해준다.



    

  1. 코드 Number 보기
    • Settings -> Editor -> Appearance -> Show line Numbers 체크
  2. 커스 위치 문제
    • Settings -> Editor -> Virtual Space -> Allow placement of caret after and of line 체크해제
  3. 저장하지 않은 파일 표시
    • Settings -> Editor -> Editor Tabs -> Tab Appearance -> Mark modified tabs with asterisk 체크
  4. 공백 시각적으로 표시하기
    • Settings -> Editor -> Appearance -> Show whitespaces 체크
  5. 저장시 모든 라인 끝 공백 없애기
    • Settings -> Editor -> Other -> Srip trailing space on Svae: All 선택
  6. 자동 컴파일
    • Settings -> Compile -> Make project automatically 체크
  7. 단축키 이클리스 화~~
    1. Settings -> Keymap -> Keymaps: Eclipse 선택


예전에 Subclipse Plugin 사용할 적에는 콘솔 로그가 기본으로 나왔던 것 같은데, Subversive 을 사용하면서부터는 안 나오는듯?? 하다.


나오게 하려면!!


Preferences -> Team -> SVN -> Sonsole

- Show console automatically

On output 체크!!



[기준] eclipse-4.3 64bit


힙메모리 최적화 버튼

Window > Perference > General에 - Show heap status



영어 단어 검사

Window > Prereces > General > Editors > Spellings - Enable spell checking 해제



코드 블럭(펼치고, 닫기)

Window->Preferences->Java(또는 사용언어)->Editor->Folding 해제


소스 및 패키지,함수 위치 정보 에디터 위에 활성화(java)

툴바에 Toggle Breadcrumb


저장 시 라인 마지막 공백 제거(AnyEdit  Tools 사용 할 경우)

Window > Prereces > General > Editors > AnyEdit Tools - Remove trailing whitespace 해제


괄호해제

    Window > Preference > JAVA -> Editor -> Typing - Automatically close 부분 체크 조절








Plugin

JRebel

Subclipse Or Subversive

JadClipse Or JD-Eclipse

AnyEdit Tools - remove white space option unchecked

StartExplorer

devutil

gradle

grep console




경로 참고

Server 설정 정보 및 Build 경로

..\workspace...\.metadata\.plugins\org.eclipse.wst.server.core

Preferences 설정 파일(Font, Keys)

..\workspace...\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.workbench.prefs






Eclipse 에서 Aptana plugin 을 최신으로 업데이트 했더니 svn 비교 에디터 색상이 검색 계열로 바뀌었더군요.
도저히 답답해서 변경 방법을 찾아봤다.

아래 파일에서 설정 변경 할 수 있고, 잘 모르면 삭제 하면 기본 설정으로 나온다.

workspace경로\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.compare.prefs
http://www.npaint.com/
데모 http://app.npaint.com/nPaintLite/default.php

+ Recent posts