티스토리 뷰



To start from scratch, move on to Set up the project.


1. Create the directory structure

In a project directory of your choosing, create the following subdirectory structure; for example, with mkdir -p src/main/java/hello on *nix systems:

1, mkdir -p src/main/java/hello

 2, src/main/java/hello/HelloWorld.java

vi src/main/java/hello/HelloWorld.java

package hello;

public class HelloWorld {
    public static void main(String[] args) {
        Greeter greeter = new Greeter();
        System.out.println(greeter.sayHello());
    }
}

vi src/main/java/hello/Greeter.java

package hello;

public class Greeter {
    public String sayHello() {
        return "Hello world!";
    }
}


3. complie

cd src/main/java
 find . -type f
./hello/HelloWorld.java
 javac -d . hello/HelloWorld.java


find . -type f
./hello/Greeter.class
./hello/Greeter.java
./hello/HelloWorld.class
./hello/HelloWorld.java

Now that you have a project that is ready to be built with Maven, the next step is to install Maven

// 메이븐 환경변수 맥설치하기 
http://maven.apache.org/download.cgi  메이븐 다운로드 사이트

Maven 다운로드 ( http://maven.apache.org/download.cgi )
vi ~/.bash_profile
PATH 설정을 하자. (/Users/본인 유저명) 밑의 .bash_profile 파일을 편집한다. (없으면 생성)
export M2_HOME=메이븐경로
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

source ~/.bash_profile 

mvn -v 확인

find .

Define a simple Maven build

Create a file named pom.xml ( 프로젝트 최상의 디렉토리에 생성 )
Mac에서 .DS_Store 일괄 삭제 및 생성 방지하는 법
일괄삭제

sudo -s

find / -type f -name .DS_Store -print -delete

/ 부터 검색을 해서 .DS_Store가 발견이 되면 해당위치를 프린트하고 삭제를 한다.

생성 방지

defaults write com.apple.desktopservices DSDontWriteNetworkStores true


mvn complie













'웹개발 > Java' 카테고리의 다른 글

알기쉬운 프로그래밍 설계 하기  (1) 2011.06.30
DIP 의존관계 역전원칙  (0) 2010.12.30
LSP 리스코프 치환의 원칙  (0) 2010.12.30
SRP 단일 책임의 원칙  (0) 2010.12.30
OCP 개방 폐쇄 원책  (0) 2010.12.30
댓글
댓글쓰기 폼