2013-08-25 5 views

답변

1

NetBeans에서 "파일"탭으로 전환하십시오. 프로젝트 (빌드 될 프로젝트)를 확장하십시오.

build.xml을 두 번 클릭하십시오.

당신이 이미하지 않은 경우

<!-- 

There exist several targets which are by default empty and which can be 
used for execution of your tasks. These targets are usually executed 
before and after some main targets. They are: 

    -pre-init:     called before initialization of project properties 
    -post-init:    called after initialization of project properties 
    -pre-compile:    called before javac compilation 
    -post-compile:    called after javac compilation 
    -pre-compile-single:  called before javac compilation of single file 
    -post-compile-single:  called after javac compilation of single file 
    -pre-compile-test:   called before javac compilation of JUnit tests 
    -post-compile-test:  called after javac compilation of JUnit tests 
    -pre-compile-test-single: called before javac compilation of single JUnit test 
    -post-compile-test-single: called after javac compilation of single JUunit test 
    -pre-jar:     called before JAR building 
    -post-jar:     called after JAR building 
    -post-clean:    called after cleaning build products 

(Targets beginning with '-' are not intended to be called on their own.) 

Example of inserting an obfuscator after compilation could look like this: 

    <target name="-post-compile"> 
     <obfuscate> 
      <fileset dir="${build.classes.dir}"/> 
     </obfuscate> 
    </target> 

For list of available properties check the imported 
nbproject/build-impl.xml file. 


Another way to customize the build is by overriding existing main targets. 
The targets of interest are: 

    -init-macrodef-javac:  defines macro for javac compilation 
    -init-macrodef-junit:  defines macro for junit execution 
    -init-macrodef-debug:  defines macro for class debugging 
    -init-macrodef-java:  defines macro for class execution 
    -do-jar:     JAR building 
    run:      execution of project 
    -javadoc-build:   Javadoc generation 
    test-report:    JUnit report generation 

An example of overriding the target for project execution could look like this: 

    <target name="run" depends="LED-impl.jar"> 
     <exec dir="bin" executable="launcher.exe"> 
      <arg file="${dist.jar}"/> 
     </exec> 
    </target> 

Notice that the overridden target depends on the jar target and not only on 
the compile target as the regular run target does. Again, for a list of available 
properties which you can use, check the target you are overriding in the 
nbproject/build-impl.xml file. 

--> 

아마 -post-jar

를 추천 할 것입니다 거기 당신이 무시할 수 있습니다 빌드 타겟의 수 ...에 대한 build.xml 문서들을하지만, 여기에 덤프입니다 이렇게, 나는 농부가 될 것이다 Ant copy task

1

Ant 빌드를 사용하십시오. IDE를 사용하여 jar를 만드는 것과 비교하면 더 낫습니다.

+0

Erm ... 나는 그것이 내가 필요로하는 것이라고 생각하지 않는다. 출력 된 폴더에 컴파일 된 다른 jar 파일을 복사하면됩니다. – NewProger

+0

Netbeans은 빌더로서 Ant를 사용합니다. – MadProgrammer