ANT를 사용하여 Tomcat에 물건을 배포하고있었습니다. 하지만 필자는 의존성을 잃어 버리는 데 어려움을 겪었고 아이비를 추가하고 싶었습니다. Java, Apache Ivy 문제가있는 Ant 사용
지금 내 build.xml 파일이 추가 : 내 프로젝트에 공통 랭 JAR 파일을 추가하려고이와<!-- Ivy settings start-->
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="go" depends="init-ivy" description="--> resolve dependencies, compile and run the project">
<echo message="using ivy to resolve commons-lang 2.1..."/>
<!--
here comes the magic line: asks ivy to resolve a dependency on commons-lang 2.1 and to build an ant path with it from its cache
-->
<ivy:cachepath organisation="commons-lang" module="commons-lang" revision="2.1" pathid="lib.path.id" inline="true"/>
</target>
<!-- Ivy settings end-->
합니다. 어디 그 JAR 파일 내 프로젝트에 나타나지 않는
1) : 지금 .. 나는 그것이 작동 생각
Buildfile: C:\Users\Jansu\workspace\HelloWorld\build.xml
build:
deploywar:
download-ivy:
[get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
[get] To: C:\Users\Jansu\.ant\lib\ivy-2.2.0.jar
[get] Not modified - so not downloaded
init-ivy:
go:
[echo] using ivy to resolve commons-lang 2.1...
[ivy:cachepath] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:cachepath] :: loading settings :: url = jar:file:/C:/Users/Jansu/.ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:cachepath] :: resolving dependencies :: commons-lang#commons-lang-caller;working
[ivy:cachepath] confs: [default, master, compile, provided, runtime, system, sources, javadoc, optional]
[ivy:cachepath] found commons-lang#commons-lang;2.1 in public
[ivy:cachepath] :: resolution report :: resolve 151ms :: artifacts dl 10ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 1 | 0 | 0 | 0 || 1 | 0 |
| master | 1 | 0 | 0 | 0 || 1 | 0 |
| compile | 1 | 0 | 0 | 0 || 0 | 0 |
| provided | 1 | 0 | 0 | 0 || 0 | 0 |
| runtime | 1 | 0 | 0 | 0 || 0 | 0 |
| system | 1 | 0 | 0 | 0 || 0 | 0 |
| sources | 1 | 0 | 0 | 0 || 1 | 0 |
| javadoc | 1 | 0 | 0 | 0 || 1 | 0 |
| optional | 1 | 0 | 0 | 0 || 0 | 0 |
---------------------------------------------------------------------
BUILD SUCCESSFUL
Total time: 2 seconds
2 개 질문 : 이것은 내가 출력으로 무엇을 얻을?
2) 스프링 프레임 워크 파일과 같은 다른 JAR 파일을 어떻게 추가합니까?
Maven 2/3는 처리하기가 훨씬 쉽습니다 ... –