Make Java 8 doclint happy; adjust javadoc Ant target; remove connection to svn from build.xml

This commit is contained in:
twogee 2017-05-28 11:30:37 +02:00
parent 6c92f32eda
commit baf03a919c
84 changed files with 1151 additions and 920 deletions

405
build.xml
View File

@ -18,50 +18,50 @@
-->
<project name="ivy" default="coverage-report" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env" />
<property file="version.properties" />
<property file="build.properties" />
<property environment="env"/>
<property file="version.properties"/>
<property file="build.properties"/>
<property name="final.name" value="ivy.jar" />
<property name="final.name" value="ivy.jar"/>
<target name="init-ivy-user-home" unless="ivy.use.local.home">
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ivy2" />
<property name="ivy.home" value="${user.home}/.ivy2"/>
</target>
<target name="init-ivy-local-home" if="ivy.use.local.home">
<property name="ivy.home" value="${basedir}/.ivy2" />
<property name="ivy.home" value="${basedir}/.ivy2"/>
</target>
<target name="init-ivy-home" depends="init-ivy-user-home, init-ivy-local-home" />
<target name="init-ivy-home" depends="init-ivy-user-home,init-ivy-local-home"/>
<target name="init-ivy" depends="compile-bootstrap, init-ivy-home">
<target name="init-ivy" depends="compile-bootstrap,init-ivy-home">
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant">
<classpath>
<pathelement location="${core.classes.build.dir}" />
<pathelement location="${bootstrap.classes.build.dir}" />
<pathelement location="${core.classes.build.dir}"/>
<pathelement location="${bootstrap.classes.build.dir}"/>
</classpath>
</taskdef>
<ivy:configure override="true" />
<ivy:configure override="true"/>
</target>
<target name="install" depends="init-ivy-home, jar"
<target name="install" depends="init-ivy-home,jar"
description="build Ivy and install it in Ivy user home for builds using Ivy user home to load Ivy jar">
<property name="ivy.jar.file" value="${ivy.home}/jars/ivy.jar" />
<copy file="${artifacts.build.dir}/jars/${final.name}" tofile="${ivy.jar.file}" />
<property name="ivy.jar.file" value="${ivy.home}/jars/ivy.jar"/>
<copy file="${artifacts.build.dir}/jars/${final.name}" tofile="${ivy.jar.file}"/>
</target>
<target name="install-ant" depends="init-ivy-home, jar"
<target name="install-ant" depends="init-ivy-home,jar"
description="build Ivy and install it in Ant home lib">
<condition property="ant.home" value="${env.ANT_HOME}">
<isset property="env.ANT_HOME" />
<isset property="env.ANT_HOME"/>
</condition>
<fail unless="ant.home" message="ANT_HOME environment variable or ant.home property required" />
<copy file="${artifacts.build.dir}/jars/${final.name}" tofile="${ant.home}/lib/ivy.jar" />
<fail unless="ant.home" message="ANT_HOME environment variable or ant.home property required"/>
<copy file="${artifacts.build.dir}/jars/${final.name}" tofile="${ant.home}/lib/ivy.jar"/>
</target>
<!-- =================================================================
@ -70,111 +70,111 @@
<target name="init">
<path id="lib.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="*.jar"/>
</fileset>
</path>
<path id="build.bootstrap.classpath">
<pathelement location="${core.classes.build.dir}" />
<pathelement location="${core.classes.build.dir}"/>
</path>
<path id="build.ant.classpath">
<pathelement location="${core.classes.build.dir}" />
<path refid="lib.classpath" />
<pathelement location="${core.classes.build.dir}"/>
<path refid="lib.classpath"/>
</path>
<path id="build.optional.classpath">
<path refid="build.ant.classpath" />
<path refid="build.ant.classpath"/>
</path>
<path id="run.classpath">
<pathelement location="${core.classes.build.dir}" />
<pathelement location="${ant.classes.build.dir}" />
<pathelement location="${optional.classes.build.dir}" />
<path refid="lib.classpath" />
<pathelement location="${core.classes.build.dir}"/>
<pathelement location="${ant.classes.build.dir}"/>
<pathelement location="${optional.classes.build.dir}"/>
<path refid="lib.classpath"/>
</path>
<path id="test.classpath">
<pathelement location="${coverage.classes.dir}" />
<pathelement location="${coverage.classes.dir}"/>
<fileset dir="${lib.dir}">
<include name="*.jar" />
<exclude name="ant.jar" />
<exclude name="ant-launcher.jar" />
<include name="*.jar"/>
<exclude name="ant.jar"/>
<exclude name="ant-launcher.jar"/>
<exclude name="ant-nodeps.jar"/>
<exclude name="ant-trax.jar"/>
</fileset>
<pathelement location="${core.classes.build.dir}" />
<pathelement location="${ant.classes.build.dir}" />
<pathelement location="${optional.classes.build.dir}" />
<pathelement path="${test.build.dir}" />
<pathelement location="${core.classes.build.dir}"/>
<pathelement location="${ant.classes.build.dir}"/>
<pathelement location="${optional.classes.build.dir}"/>
<pathelement path="${test.build.dir}"/>
</path>
</target>
<target name="prepare" depends="init">
<mkdir dir="${classes.build.dir}" />
<mkdir dir="${core.classes.build.dir}" />
<mkdir dir="${bootstrap.classes.build.dir}" />
<mkdir dir="${ant.classes.build.dir}" />
<mkdir dir="${optional.classes.build.dir}" />
<mkdir dir="${all.classes.build.dir}" />
<mkdir dir="${test.build.dir}" />
<mkdir dir="${artifacts.build.dir}" />
<mkdir dir="${test.report.dir}" />
<mkdir dir="${ivy.report.dir}" />
<mkdir dir="${classes.build.dir}"/>
<mkdir dir="${core.classes.build.dir}"/>
<mkdir dir="${bootstrap.classes.build.dir}"/>
<mkdir dir="${ant.classes.build.dir}"/>
<mkdir dir="${optional.classes.build.dir}"/>
<mkdir dir="${all.classes.build.dir}"/>
<mkdir dir="${test.build.dir}"/>
<mkdir dir="${artifacts.build.dir}"/>
<mkdir dir="${test.report.dir}"/>
<mkdir dir="${ivy.report.dir}"/>
</target>
<target name="clean" description="delete all generated files keeping sources only">
<delete dir="${classes.build.dir}" />
<delete dir="${test.build.dir}" />
<delete dir="${artifacts.build.dir}" />
<delete dir="${test.report.dir}" />
<delete dir="${javadoc.build.dir}" />
<delete dir="${doc.build.dir}" />
<delete dir="${build.dir}" />
<delete dir="${classes.build.dir}"/>
<delete dir="${test.build.dir}"/>
<delete dir="${artifacts.build.dir}"/>
<delete dir="${test.report.dir}"/>
<delete dir="${javadoc.build.dir}"/>
<delete dir="${doc.build.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="clean-lib">
<delete dir="${lib.dir}" />
<delete dir="${lib.dir}"/>
</target>
<target name="clean-ivy-cache" depends="init-ivy-home">
<delete dir="${ivy.home}/cache" />
<delete dir="${ivy.home}/cache"/>
</target>
<target name="clean-ivy-home" depends="init-ivy-home">
<delete dir="${ivy.home}" />
<delete dir="${ivy.home}"/>
</target>
<target name="clean-examples" description="clean all examples">
<subant target="clean" failonerror="false">
<fileset dir="${example.dir}" includes="**/build.xml" />
<fileset dir="${example.dir}" includes="**/build.xml"/>
</subant>
</target>
<target name="clean-all" depends="clean, clean-lib, clean-examples" />
<target name="clean-all" depends="clean-examples,clean,clean-lib"/>
<target name="/noresolve" description="use to skip dependency resolution">
<property name="no.resolve" value="true" />
<property name="no.resolve" value="true"/>
</target>
<target name="/notest" description="use to skip tests">
<property name="skip.test" value="true" />
<property name="skip.test" value="true"/>
</target>
<target name="/nojavadoc" description="use to skip javadoc">
<property name="skip.javadoc" value="true" />
<property name="skip.javadoc" value="true"/>
</target>
<target name="/localivy" description="use a local ivy home">
<property name="ivy.use.local.home" value="true" />
<property name="ivy.use.local.home" value="true"/>
</target>
<target name="/offline" depends="/noresolve" description="use to indicate no internet connection is available">
<property name="offline" value="true" />
<property name="offline" value="true"/>
</target>
<target name="default-version">
<tstamp>
<format property="pubdate" pattern="yyyyMMddHHmmss" />
<format property="pubdate" pattern="yyyyMMddHHmmss"/>
</tstamp>
<property name="version.prefix" value="${target.ivy.version}-local-" />
<property name="build.version" value="${version.prefix}${pubdate}" />
<property name="bundle.version" value="${target.ivy.bundle.version}.${target.ivy.bundle.version.qualifier}${pubdate}" />
<property name="version.prefix" value="${target.ivy.version}-local-"/>
<property name="build.version" value="${version.prefix}${pubdate}"/>
<property name="bundle.version" value="${target.ivy.bundle.version}.${target.ivy.bundle.version.qualifier}${pubdate}"/>
</target>
<!-- =================================================================
@ -192,30 +192,30 @@
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
includeantruntime="no">
<excludesfile name="ant.patterns" />
<excludesfile name="optional.patterns" />
<excludesfile name="ant.patterns"/>
<excludesfile name="optional.patterns"/>
</javac>
<copy todir="${core.classes.build.dir}" includeEmptyDirs="false">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
<excludesfile name="ant.patterns" />
<excludesfile name="optional.patterns" />
<exclude name="**/*.java"/>
<excludesfile name="ant.patterns"/>
<excludesfile name="optional.patterns"/>
</fileset>
</copy>
<!-- copy settings files for backward compatibility with ivyconf naming -->
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings-local.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-local.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-local.xml"/>
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings-default-chain.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-default-chain.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-default-chain.xml"/>
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings-main-chain.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-main-chain.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-main-chain.xml"/>
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings-public.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-public.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-public.xml"/>
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings-shared.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-shared.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf-shared.xml"/>
<copy file="${core.classes.build.dir}/org/apache/ivy/core/settings/ivysettings.xml"
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf.xml" />
tofile="${core.classes.build.dir}/org/apache/ivy/core/settings/ivyconf.xml"/>
</target>
<!-- Build the Ant tasks with the current Ant runtime -->
@ -228,18 +228,18 @@
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
includeantruntime="yes">
<includesfile name="ant.patterns" />
<includesfile name="ant.patterns"/>
</javac>
<copy todir="${bootstrap.classes.build.dir}" includeEmptyDirs="false">
<fileset dir="${src.dir}">
<includesfile name="ant.patterns" />
<exclude name="**/*.java" />
<includesfile name="ant.patterns"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- Build the Ant tasks with the minimal Ant runtime -->
<target name="compile-ant" depends="compile-core, resolve">
<target name="compile-ant" depends="compile-core,resolve">
<javac srcdir="${src.dir}"
destdir="${ant.classes.build.dir}"
sourcepath=""
@ -248,21 +248,21 @@
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
includeantruntime="no">
<includesfile name="ant.patterns" />
<includesfile name="ant.patterns"/>
</javac>
<copy todir="${ant.classes.build.dir}" includeEmptyDirs="false">
<fileset dir="${src.dir}">
<includesfile name="ant.patterns" />
<exclude name="**/*.java" />
<includesfile name="ant.patterns"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
<!-- copy antlib for backward compatibility with fr.jayasoft.ivy package -->
<copy file="${ant.classes.build.dir}/org/apache/ivy/ant/antlib.xml"
todir="${ant.classes.build.dir}/fr/jayasoft/ivy/ant" />
todir="${ant.classes.build.dir}/fr/jayasoft/ivy/ant"/>
</target>
<target name="compile-optional" depends="compile-ant, resolve">
<target name="compile-optional" depends="compile-ant,resolve">
<javac srcdir="${src.dir}"
destdir="${optional.classes.build.dir}"
sourcepath=""
@ -271,13 +271,13 @@
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
includeantruntime="no">
<includesfile name="optional.patterns" />
<includesfile name="ant.patterns" />
<includesfile name="optional.patterns"/>
<includesfile name="ant.patterns"/>
</javac>
<copy todir="${core.classes.build.dir}" includeEmptyDirs="false">
<fileset dir="${src.dir}">
<includesfile name="optional.patterns" />
<exclude name="**/*.java" />
<includesfile name="optional.patterns"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
@ -285,10 +285,10 @@
<!-- =================================================================
Create the two jar files (Ivy core and Ivy core + Ant tasks)
================================================================= -->
<target name="jar" depends="compile-optional, default-version" description="Create Jar files">
<target name="jar" depends="compile-optional,default-version" description="Create Jar files">
<!-- identify compiled ivy version -->
<echo message="version=${build.version}${line.separator}" file="${core.classes.build.dir}/module.properties" append="true" />
<echo message="date=${pubdate}${line.separator}" file="${core.classes.build.dir}/module.properties" append="true" />
<echo message="version=${build.version}${line.separator}" file="${core.classes.build.dir}/module.properties" append="true"/>
<echo message="date=${pubdate}${line.separator}" file="${core.classes.build.dir}/module.properties" append="true"/>
<mkdir dir="${artifacts.build.dir}/jars/"/>
@ -299,38 +299,38 @@
-->
<copy file="${basedir}/META-INF/MANIFEST.MF" tofile="${artifacts.build.dir}/MANIFEST.MF">
<filterchain>
<replaceregex pattern="Bundle-Version:.*" replace="Bundle-Version: ${bundle.version}" byline="true" />
<replaceregex pattern="Bundle-Version:.*" replace="Bundle-Version: ${bundle.version}" byline="true"/>
</filterchain>
</copy>
<copy todir="${all.classes.build.dir}">
<fileset dir="${core.classes.build.dir}" />
<fileset dir="${ant.classes.build.dir}" />
<fileset dir="${optional.classes.build.dir}" />
<fileset dir="${core.classes.build.dir}"/>
<fileset dir="${ant.classes.build.dir}"/>
<fileset dir="${optional.classes.build.dir}"/>
</copy>
<jar destfile="${artifacts.build.dir}/jars/${final.name}"
manifest="${artifacts.build.dir}/MANIFEST.MF">
<metainf dir="${basedir}" includes="LICENSE,NOTICE" />
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<manifest>
<attribute name="Specification-Title" value="Apache Ivy with Ant tasks" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Specification-Vendor" value="Apache Software Foundation" />
<attribute name="Implementation-Title" value="org.apache.ivy" />
<attribute name="Implementation-Version" value="${build.version}" />
<attribute name="Implementation-Vendor" value="Apache Software Foundation" />
<attribute name="Implementation-Vendor-Id" value="org.apache" />
<attribute name="Extension-name" value="org.apache.ivy" />
<attribute name="Build-Version" value="${build.version}" />
<attribute name="Specification-Title" value="Apache Ivy with Ant tasks"/>
<attribute name="Specification-Version" value="${build.version}"/>
<attribute name="Specification-Vendor" value="Apache Software Foundation"/>
<attribute name="Implementation-Title" value="org.apache.ivy"/>
<attribute name="Implementation-Version" value="${build.version}"/>
<attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
<attribute name="Extension-name" value="org.apache.ivy"/>
<attribute name="Build-Version" value="${build.version}"/>
</manifest>
<fileset dir="${all.classes.build.dir}" />
<fileset dir="${all.classes.build.dir}"/>
</jar>
<!-- copy main jar to ease its use as an OSGi bundle -->
<copy file="${artifacts.build.dir}/jars/${final.name}"
tofile="${artifacts.build.dir}/org.apache.ivy_${bundle.version}.jar" />
tofile="${artifacts.build.dir}/org.apache.ivy_${bundle.version}.jar"/>
<!-- clean generated module properties file -->
<delete file="${core.classes.build.dir}/module.properties" />
<delete file="${core.classes.build.dir}/module.properties"/>
</target>
<!-- =================================================================
@ -339,75 +339,75 @@
<target name="publish-local" depends="jar,sources" description="publishes Ivy to Ivy local repository">
<ivy:publish resolver="local" pubrevision="${build.version}"
artifactsPattern="${artifacts.build.dir}/[type]s/[artifact].[ext]"
forcedeliver="true" />
forcedeliver="true"/>
</target>
<!-- =================================================================
TESTS
================================================================= -->
<target name="build-custom-resolver-jar" depends="jar">
<mkdir dir="${build.dir}/custom-classpath" />
<mkdir dir="${build.dir}/custom-classpath"/>
<javac srcdir="${basedir}/test/custom-classpath"
destdir="${build.dir}/custom-classpath"
classpathref="run.classpath"
source="${ivy.minimum.javaversion}"
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
includeantruntime="no" />
includeantruntime="no"/>
<jar destfile="${test.dir}/org/apache/ivy/core/settings/custom-resolver.jar"
basedir="${build.dir}/custom-classpath" />
basedir="${build.dir}/custom-classpath"/>
</target>
<target name="init-tests-offline" if="offline">
<fileset id="test.fileset" dir="${test.dir}">
<include name="**/${test.class.pattern}.java" />
<exclude name="**/Abstract*Test.java" />
<not><contains text="remote.test" /></not>
<include name="**/${test.class.pattern}.java"/>
<exclude name="**/Abstract*Test.java"/>
<not><contains text="remote.test"/></not>
</fileset>
</target>
<target name="init-tests-online" unless="offline">
<fileset id="test.fileset" dir="${test.dir}">
<include name="**/${test.class.pattern}.java" />
<exclude name="**/Abstract*Test.java" />
<include name="**/${test.class.pattern}.java"/>
<exclude name="**/Abstract*Test.java"/>
</fileset>
</target>
<target name="init-tests" depends="init-tests-offline, init-tests-online" />
<target name="init-tests" depends="init-tests-offline,init-tests-online"/>
<target name="emma" depends="jar" unless="skip.test">
<ivy:cachepath organisation="emma" module="emma" revision="2.0.5312"
inline="true" conf="default" pathid="emma.classpath"
log="download-only" />
log="download-only"/>
<ivy:cachepath organisation="emma" module="emma_ant" revision="2.0.5312"
inline="true" conf="default" pathid="emma.ant.classpath" transitive="false"
log="download-only" />
log="download-only"/>
<taskdef resource="emma_ant.properties">
<classpath refid="emma.classpath" />
<classpath refid="emma.ant.classpath" />
<classpath refid="emma.classpath"/>
<classpath refid="emma.ant.classpath"/>
</taskdef>
<property name="emma.enabled" value="true" />
<property name="coverage.dir" value="${build.dir}/coverage" />
<property name="coverage.classes.dir" value="${coverage.dir}/classes" />
<mkdir dir="${coverage.dir}" />
<mkdir dir="${coverage.classes.dir}" />
<property name="emma.enabled" value="true"/>
<property name="coverage.dir" value="${build.dir}/coverage"/>
<property name="coverage.classes.dir" value="${coverage.dir}/classes"/>
<mkdir dir="${coverage.dir}"/>
<mkdir dir="${coverage.classes.dir}"/>
<emma enabled="${emma.enabled}">
<instr mode="copy"
destdir="${coverage.dir}/classes"
metadatafile="${coverage.dir}/metadata.emma">
<instrpath>
<pathelement location="${core.classes.build.dir}" />
<pathelement location="${ant.classes.build.dir}" />
<pathelement location="${optional.classes.build.dir}" />
<pathelement location="${core.classes.build.dir}"/>
<pathelement location="${ant.classes.build.dir}"/>
<pathelement location="${optional.classes.build.dir}"/>
</instrpath>
</instr>
</emma>
<delete file="${coverage.dir}/coverage.emma" />
<delete file="${coverage.dir}/coverage.emma"/>
<!-- add emma path to test path, because emma jars need to be available when running
instrumented classes -->
<ivy:addpath topath="test.classpath" first="true">
<pathelement location="${coverage.dir}/classes" />
<path refid="emma.classpath" />
<pathelement location="${coverage.dir}/classes"/>
<path refid="emma.classpath"/>
</ivy:addpath>
</target>
@ -419,30 +419,30 @@
target="${ivy.minimum.javaversion}"
debug="${debug.mode}"
encoding="ISO-8859-1"
includeantruntime="no" />
includeantruntime="no"/>
<copy todir="${test.build.dir}">
<fileset dir="${test.dir}">
<exclude name="**/*.java" />
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="prepare-osgi-tests" depends="resolve" unless="skip.test">
<ant dir="${basedir}/test/test-repo" target="generate-bundles" />
<ant dir="${basedir}/test/test-repo" target="generate-bundles"/>
</target>
<target name="prepare-test-jar-repositories" unless="skip.test">
<mkdir dir="${basedir}/test/jar-repos" />
<mkdir dir="${basedir}/test/jar-repos"/>
<jar destfile="${basedir}/test/jar-repos/jarrepo1.jar" >
<fileset dir="${basedir}/test/repositories/1" />
<fileset dir="${basedir}/test/repositories/1"/>
</jar>
<jar destfile="${basedir}/test/jar-repos/jarrepo1_subdir.jar">
<fileset dir="${basedir}/test/repositories" includes="1/**/*" />
<fileset dir="${basedir}/test/repositories" includes="1/**/*"/>
</jar>
</target>
<target name="test-internal" depends="build-test, init-tests, prepare-osgi-tests, prepare-test-jar-repositories" unless="skip.test">
<mkdir dir="${test.xml.dir}" />
<target name="test-internal" depends="build-test,init-tests,prepare-osgi-tests,prepare-test-jar-repositories" unless="skip.test">
<mkdir dir="${test.xml.dir}"/>
<junit
haltonfailure="off"
@ -455,25 +455,25 @@
dir="${basedir}"
fork="true">
<classpath>
<path refid="test.classpath" />
<path refid="test.classpath"/>
<pathelement path="${ant.home}/lib/ant-nodeps.jar"/>
<pathelement path="${ant.home}/lib/ant-trax.jar"/>
</classpath>
<!-- pass the proxy properties to the forked junit process to use correct proxy -->
<syspropertyset>
<propertyref prefix="http" />
</syspropertyset>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<propertyref prefix="http"/>
</syspropertyset>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
<!-- Added this to test IVY-65 -->
<jvmarg value="-Duser.region=TR" />
<jvmarg value="-Duser.language=tr" />
<jvmarg value="-Duser.region=TR"/>
<jvmarg value="-Duser.language=tr"/>
<formatter type="xml"/>
<batchtest todir="${test.xml.dir}">
<fileset refid="test.fileset" />
<fileset refid="test.fileset"/>
</batchtest>
</junit>
</target>
@ -481,7 +481,7 @@
<target name="x" depends="init,build-test">
<java classname="org.apache.ivy.plugins.resolver.FileSystemResolverTest">
<classpath>
<path refid="test.classpath" />
<path refid="test.classpath"/>
<pathelement path="${ant.home}/lib/ant-nodeps.jar"/>
<pathelement path="${ant.home}/lib/ant-trax.jar"/>
</classpath>
@ -490,7 +490,7 @@
<target name="test" depends="test-internal" description="Run the test">
<fail if="test.failed"
message="At least one test has failed. See logs (in ${test.xml.dir}) for details (use the target test-report to run the test with a report)" />
message="At least one test has failed. See logs (in ${test.xml.dir}) for details (use the target test-report to run the test with a report)"/>
</target>
<!-- =================================================================
@ -499,25 +499,25 @@
<target name="test-report" depends="test-internal" unless="skip.test">
<junitreport todir="${test.xml.dir}">
<fileset dir="${test.xml.dir}">
<include name="TEST-*.xml" />
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report.dir}" />
<report format="frames" todir="${test.report.dir}"/>
</junitreport>
<fail if="test.failed"
message="At least one test has failed. See logs (in ${test.xml.dir}) or report (in ${test.report.dir})" />
message="At least one test has failed. See logs (in ${test.xml.dir}) or report (in ${test.report.dir})"/>
</target>
<target name="coverage-report" depends="emma, test-report" unless="skip.test"
<target name="coverage-report" depends="emma,test-report" unless="skip.test"
description="run tests with instrumentation and generate coverage report">
<mkdir dir="${coverage.report.dir}" />
<mkdir dir="${coverage.report.dir}"/>
<emma>
<report sourcepath="${src.dir}">
<fileset dir="${coverage.dir}">
<include name="*.emma" />
<include name="*.emma"/>
</fileset>
<txt outfile="${coverage.report.dir}/coverage.txt" />
<html outfile="${coverage.report.dir}/coverage.html" />
<txt outfile="${coverage.report.dir}/coverage.txt"/>
<html outfile="${coverage.report.dir}/coverage.html"/>
</report>
</emma>
</target>
@ -526,45 +526,51 @@
<ivy:report todir="${ivy.report.dir}"/>
</target>
<target name="javadoc" unless="skip.javadoc">
<javadoc destdir="${javadoc.build.dir}" useexternalfile="true">
<fileset dir="${src.dir}" includes="**/*.java" />
<target name="javadoc" depends="init" unless="skip.javadoc">
<tstamp>
<format pattern="2007-yyyy" property="years"/>
</tstamp>
<property name="copyright" value="Copyright &amp;copy;${years} The Apache Software Foundation, Licensed under &lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0.txt&quot;&gt;Apache License, Version 2.0&lt;/a&gt;."/>
<property name="title" value="Apache Ivy&amp;trade; dependency manager ${target.ivy.version} API"/>
<javadoc destdir="${javadoc.build.dir}"
useexternalfile="true"
windowtitle="Apache Ivy&amp;trade;"
doctitle="${title}"
bottom="${copyright}"
classpathref="lib.classpath">
<fileset dir="${src.dir}" includes="**/*.java"/>
<arg value="-tag"/>
<arg value="pre:a:Precondition:"/>
</javadoc>
</target>
<target name="sources" depends="default-version" description="Create source archive files">
<mkdir dir="${artifacts.build.dir}/sources/"/>
<jar destfile="${artifacts.build.dir}/sources/${final.name}">
<metainf dir="${basedir}" includes="LICENSE,NOTICE" />
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
<manifest>
<attribute name="Specification-Title" value="Apache Ivy Sources" />
<attribute name="Specification-Version" value="${build.version}" />
<attribute name="Specification-Vendor" value="Apache Software Foundation" />
<attribute name="Specification-Title" value="Apache Ivy Sources"/>
<attribute name="Specification-Version" value="${build.version}"/>
<attribute name="Specification-Vendor" value="Apache Software Foundation"/>
</manifest>
<fileset dir="${src.dir}" />
<fileset dir="${src.dir}"/>
</jar>
</target>
<target name="fixcrlf">
<property name="eol.native.includes"
value="**/*.html,**/*.json,**/*.java,**/*.xml,**/*.txt,**/*.MF,**/*.properties,**/*.patterns,**/*.pom,**/*.xsl,**/*.css" />
value="**/*.html,**/*.json,**/*.java,**/*.xml,**/*.txt,**/*.MF,**/*.properties,**/*.patterns,**/*.pom,**/*.xsl,**/*.css"/>
<property name="eol.native.excludes"
value="build/**,bin/**,lib/**" />
value="build/**,bin/**,lib/**"/>
<fileset id="eol.native.fileset"
dir="${basedir}"
includes="${eol.native.includes}"
excludes="${eol.native.excludes}" />
excludes="${eol.native.excludes}"/>
<fixcrlf srcdir="${basedir}"
includes="${eol.native.includes}"
excludes="${eol.native.excludes}" />
<apply executable="svn">
<fileset refid="eol.native.fileset" />
<arg value="propset" />
<arg value="svn:eol-style" />
<arg value='"native"' />
</apply>
excludes="${eol.native.excludes}"/>
</target>
<!-- Checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config -->
@ -572,35 +578,35 @@
<ivy:cachepath organisation="checkstyle" module="checkstyle" revision="5.0"
inline="true" conf="default" pathid="checkstyle.classpath" transitive="true"
log="download-only"/>
<taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath" />
<taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
<mkdir dir="${checkstyle.report.dir}" />
<mkdir dir="${checkstyle.report.dir}"/>
<checkstyle config="${checkstyle.src.dir}/checkstyle-config"
failOnViolation="false" failureProperty="checkstyle.failed">
<classpath>
<path refid="run.classpath" />
<path refid="run.classpath"/>
</classpath>
<formatter type="xml" toFile="${checkstyle.report.dir}/checkstyle.xml" />
<formatter type="xml" toFile="${checkstyle.report.dir}/checkstyle.xml"/>
<fileset dir="${src.dir}">
<include name="**/*.java" />
<include name="**/*.java"/>
</fileset>
<fileset dir="${example.dir}">
<include name="**/*.java" />
<include name="**/*.java"/>
</fileset>
</checkstyle>
</target>
<target name="checkstyle" depends="checkstyle-internal" description="checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config">
<fail if="checkstyle.failed"
message="Checkstyle has errors. See report in ${checkstyle.report.dir}" />
message="Checkstyle has errors. See report in ${checkstyle.report.dir}"/>
</target>
<target name="checkstyle-report" depends="checkstyle-internal">
<property name="checkstyle.basedir" location="${src.dir}" />
<property name="checkstyle.basedir" location="${src.dir}"/>
<xslt in="${checkstyle.report.dir}/checkstyle.xml"
style="${checkstyle.src.dir}/checkstyle-frames.xsl"
out="${checkstyle.report.dir}/output.txt">
<param name="basedir" expression="${checkstyle.basedir}" />
<param name="basedir" expression="${checkstyle.basedir}"/>
</xslt>
</target>
@ -625,8 +631,7 @@
property="findbugs.home"
value="${findbugs.download.to}/${findbugs.download.name}"
file="${findbugs.download.to}/${findbugs.download.name}/lib/findbugs.jar"
description="Check if Findbugs is already installed."
/>
description="Check if Findbugs is already installed."/>
<!-- Findbugs: Running Findbugs -->
<property name="findbugs.reportdir"
@ -655,7 +660,7 @@
</path>
<!-- Load the Findbugs AntTasks -->
<taskdef uri="http://findbugs.sourceforge.net/" resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpathref="findbugs.real.classpath" />
<taskdef uri="http://findbugs.sourceforge.net/" resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpathref="findbugs.real.classpath"/>
<!-- Start Findbugs -->
<mkdir dir="${findbugs.reportdir}"/>
@ -665,8 +670,8 @@
outputFile="${findbugs.reportdir}/${findbugs.raw}"
jvmargs="${findbugs.jvmargs}"
projectName="${Name} ${project.version}">
<class location="${core.classes.build.dir}" />
<sourcePath path="${src.dir}" />
<class location="${core.classes.build.dir}"/>
<sourcePath path="${src.dir}"/>
</fb:findbugs>
<!-- Generate (human) readable output -->
@ -680,24 +685,24 @@
<!-- =================================================================
IDE SPECIFIC
================================================================= -->
<available file="${basedir}/.classpath" property="eclipse.classpath.exists" />
<available file="${basedir}/.classpath" property="eclipse.classpath.exists"/>
<target name="check-eclipse-classpath-overwrite" if="eclipse.classpath.exists">
<input message=".classpath file already exists.${line.separator}Are you sure you want to overwrite it and loose your original file?"
validargs="Y,N,y,n" addproperty="eclipse.classpath.confirm" />
validargs="Y,N,y,n" addproperty="eclipse.classpath.confirm"/>
<condition property="eclipse.classpath.abort">
<equals arg1="${eclipse.classpath.confirm}" arg2="N" casesensitive="false" />
<equals arg1="${eclipse.classpath.confirm}" arg2="N" casesensitive="false"/>
</condition>
</target>
<target name="eclipse-default" depends="resolve, check-eclipse-classpath-overwrite"
<target name="eclipse-default" depends="resolve,check-eclipse-classpath-overwrite"
unless="eclipse.classpath.abort"
description="creates a default .classpath for eclipse, using jars resolved by this ant build">
<copy file="${basedir}/.classpath.default" tofile="${basedir}/.classpath" overwrite="true" />
<copy file="${basedir}/.classpath.default" tofile="${basedir}/.classpath" overwrite="true"/>
</target>
<target name="eclipse-ivyde" depends="check-eclipse-classpath-overwrite"
unless="eclipse.classpath.abort"
description="creates a .classpath for eclipse using Apache IvyDE version">
<copy file="${basedir}/.classpath.ivyde" tofile="${basedir}/.classpath" overwrite="true" />
<copy file="${basedir}/.classpath.ivyde" tofile="${basedir}/.classpath" overwrite="true"/>
</target>
</project>

View File

@ -76,6 +76,7 @@ import org.apache.ivy.util.MessageLoggerEngine;
* <a href="http://ant.apache.org/ivy/">Ivy</a> is a free java based dependency manager.
* <p>
* This class is the main class of Ivy, which acts as a Facade to all services offered by Ivy:
* </p>
* <ul>
* <li>resolve dependencies</li>
* <li>retrieve artifacts to a local location</li>
@ -83,22 +84,21 @@ import org.apache.ivy.util.MessageLoggerEngine;
* <li>repository search and listing</li>
* </ul>
* Here is one typical usage:
*
* <pre>
* Ivy ivy = Ivy.newInstance();
* ivy.configure(new URL(&quot;ivysettings.xml&quot;));
* ivy.resolve(new URL(&quot;ivy.xml&quot;));
* </pre>
*
* </p>
* <h2>Using Ivy engines directly</h2>
* <p>
* If the methods offered by the {@link Ivy} class are not flexible enough and you want to use Ivy
* engines directly, you need to call the methods within a single {@link IvyContext} associated to
* the {@link Ivy} instance you use.<br/>
* the {@link Ivy} instance you use.
* </p>
* <p>
* To do so, it is recommended to use the {@link #execute(org.apache.ivy.Ivy.IvyCallback)} method
* like this:
*
* </p>
* <pre>
* Ivy ivy = Ivy.newInstance();
* ivy.execute(new IvyCallback() {
@ -111,19 +111,17 @@ import org.apache.ivy.util.MessageLoggerEngine;
* }
* });
* </pre>
*
* </p>
*/
public class Ivy {
/**
* Callback used to execute a set of Ivy related methods within an {@link IvyContext}.
*
*
* @see Ivy#execute(org.apache.ivy.Ivy.IvyCallback)
*/
public static interface IvyCallback {
/**
* Executes Ivy related job within an {@link IvyContext}
*
*
* @param ivy
* the {@link Ivy} instance to which this callback is related
* @param context
@ -171,7 +169,7 @@ public class Ivy {
/**
* Returns the current version of Ivy, as displayed on the console when Ivy is initialized.
*
*
* @return the current version of Ivy
*/
public static String getIvyVersion() {
@ -180,9 +178,8 @@ public class Ivy {
/**
* Returns the date at which this version of Ivy has been built.
* <p>
* May be empty if unknown.
*
* <p>May be empty if unknown.</p>
*
* @return the date at which this version of Ivy has been built
*/
public static String getIvyDate() {
@ -191,7 +188,7 @@ public class Ivy {
/**
* Returns the URL at which Ivy web site can be found.
*
*
* @return the URL at which Ivy web site can be found
*/
public static String getIvyHomeURL() {
@ -218,7 +215,7 @@ public class Ivy {
/**
* True if this instance of Ivy has already been bound to its dependencies, false otherwise.
*
*
* @see #bind()
*/
private boolean bound;
@ -344,7 +341,7 @@ public class Ivy {
* <p>
* Alternatively you can use the {@link #pushContext()} and {@link #popContext()} methods, but
* this is not recommended:
*
* </p>
* <pre>
* Object result = null;
* pushContext();
@ -355,9 +352,7 @@ public class Ivy {
* }
* doSomethingWithResult(result);
* </pre>
*
* </p>
*
*
* @param callback IvyCallback
* @return Object
*/
@ -446,6 +441,9 @@ public class Ivy {
/**
* Configures Ivy with 1.4 compatible default settings
*
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public void configureDefault14() throws ParseException, IOException {
pushContext();
@ -594,13 +592,13 @@ public class Ivy {
/**
* Example of use: deliver(mrid, "1.5", "target/ivy/ivy-[revision].xml",
* DeliverOptions.newInstance(settings).setStatus("release").setValidate(false));
*
*
* @param mrid ModuleRevisionId
* @param revision String
* @param destIvyPattern String
* @param options DeliverOptions
* @throws IOException
* @throws ParseException
* @throws IOException if something goes wrong
* @throws ParseException if something goes wrong
*/
public void deliver(ModuleRevisionId mrid, String revision, String destIvyPattern,
DeliverOptions options) throws IOException, ParseException {
@ -633,6 +631,10 @@ public class Ivy {
/**
* Sorts the collection of IvyNode from the less dependent to the more dependent
*
* @param nodes Collection&lt;IvyNode&gt;
* @param options SortOptions
* @return List&lt;IvyNode&gt;
*/
public List<IvyNode> sortNodes(Collection<IvyNode> nodes, SortOptions options) {
pushContext();
@ -647,7 +649,7 @@ public class Ivy {
* Sorts the given ModuleDescriptors from the less dependent to the more dependent. This sort
* ensures that a ModuleDescriptor is always found in the list before all ModuleDescriptors
* depending directly on it.
*
*
* @param moduleDescriptors
* a Collection of ModuleDescriptor to sort
* @param options
@ -779,6 +781,8 @@ public class Ivy {
/**
* Interrupts the current running operation in the given operating thread, no later than
* interruptTimeout milliseconds after the call
*
* @param operatingThread Thread
*/
@SuppressWarnings("deprecation")
public void interrupt(Thread operatingThread) {

View File

@ -61,17 +61,17 @@ import org.apache.ivy.util.filter.FilterHelper;
* instance of this class.
* <p>
* For instance, where you were doing:
*
*
* <pre>
* Ivy ivy = new Ivy();
* </pre>
*
*
* do instead:
*
*
* <pre>
* Ivy14 ivy = new Ivy14();
* </pre>
*
*
* And that should be enough in most cases!
*/
public class Ivy14 {

View File

@ -38,14 +38,14 @@ import org.apache.tools.ant.taskdefs.Property;
* Triggers an ant build on an event occurrence.
* <p>
* Example of use:
*
* </p>
* <pre>
* &lt;ant-build-trigger event=&quot;pre-resolve-dependency&quot;
* &lt;ant-build-trigger event=&quot;pre-resolve-dependency&quot;
* filter=&quot;revision=latest.integration&quot;
* antfile=&quot;/path/to/[module]/build.xml&quot;
* antfile=&quot;/path/to/[module]/build.xml&quot;
* target=&quot;compile&quot;/&gt;
* </pre>
*
* <p>
* Triggers an ant build for any dependency in asked in latest.integration, just before resolving
* the dependency.
* </p>
@ -53,7 +53,7 @@ import org.apache.tools.ant.taskdefs.Property;
* The onlyonce property is used to tell if the ant build should be triggered only once, or several
* times in the same build.
* </p>
*
*
* @see AntCallTrigger
* @since 1.4
*/

View File

@ -107,7 +107,7 @@ public class IvyAntSettings extends DataType {
/**
* Returns the default ivy settings of this classloader. If it doesn't exist yet, a new one is
* created using the given project to back the VariableContainer.
*
*
* @param task
* TODO add text.
* @return An IvySetting instance.
@ -241,7 +241,8 @@ public class IvyAntSettings extends DataType {
/**
* Return the configured Ivy instance.
*
*
* @param task ProjectComponent
* @return Returns the configured Ivy instance.
*/
public Ivy getConfiguredIvyInstance(ProjectComponent task) {
@ -336,7 +337,7 @@ public class IvyAntSettings extends DataType {
/**
* Set file or url to its default value
*
*
* @param variableContainer IvyVariableContainer
*/
private void defineDefaultSettingFile(IvyVariableContainer variableContainer,

View File

@ -352,7 +352,7 @@ public class IvyBuildList extends IvyTask {
/**
* Returns a collection of ModuleDescriptors that are contained in the input collection of
* ModuleDescriptors and upon which the root module depends
*
*
* @param mds
* input collection of ModuleDescriptors
* @param rootmds
@ -393,7 +393,7 @@ public class IvyBuildList extends IvyTask {
* Adds the current node to the toKeep collection and then processes the each of the direct
* dependencies of this node that appear in the moduleIdMap (indicating that the dependency is
* part of this BuildList)
*
*
* @param node
* the node to be processed
* @param toKeep
@ -423,7 +423,7 @@ public class IvyBuildList extends IvyTask {
/**
* Returns a collection of ModuleDescriptors that are contained in the input collection of
* ModuleDescriptors which depends on the leaf module
*
*
* @param mds
* input collection of ModuleDescriptors
* @param leafmds
@ -461,7 +461,7 @@ public class IvyBuildList extends IvyTask {
/**
* Search in the moduleIdMap modules depending on node, add them to the toKeep set and process
* them recursively.
*
*
* @param node
* the node to be processed
* @param toKeep
@ -520,6 +520,7 @@ public class IvyBuildList extends IvyTask {
}
/**
* @return boolean
* @deprecated use {@link #getOnMissingDescriptor()} instead.
*/
@Deprecated
@ -528,6 +529,7 @@ public class IvyBuildList extends IvyTask {
}
/**
* @param skipBuildFilesWithoutIvy boolean
* @deprecated use {@link #setOnMissingDescriptor(String)} instead.
*/
@Deprecated

View File

@ -98,6 +98,7 @@ public class IvyPublish extends IvyTask {
}
/**
* @return String
* @deprecated use {@link #getSrcivypattern()} instead.
*/
@Deprecated
@ -106,6 +107,7 @@ public class IvyPublish extends IvyTask {
}
/**
* @param destivypattern String
* @deprecated use {@link #setSrcivypattern(String)} instead.
*/
@Deprecated

View File

@ -193,6 +193,7 @@ public class IvyResolve extends IvyTask {
}
/**
* @param failureProperty String
* @deprecated Use {@link #setFailureProperty(String)} instead
*/
@Deprecated

View File

@ -159,6 +159,8 @@ public class IvyRetrieve extends IvyPostResolveTask {
/**
* Option to create symlinks instead of copying.
*
* @param symlink boolean
*/
public void setSymlink(boolean symlink) {
this.symlink = symlink;
@ -166,6 +168,8 @@ public class IvyRetrieve extends IvyPostResolveTask {
/**
* Option to create symlinks in one mass action, instead of separately.
*
* @param symlinkmass boolean
*/
public void setSymlinkmass(boolean symlinkmass) {
this.symlinkmass = symlinkmass;
@ -185,9 +189,9 @@ public class IvyRetrieve extends IvyPostResolveTask {
/**
* Add a mapper to convert the file names.
*
*
* @param mapper
* a <code>Mapper</code> value.
* a Mapper value.
*/
public void addMapper(Mapper mapper) {
if (this.mapper != null) {
@ -198,7 +202,7 @@ public class IvyRetrieve extends IvyPostResolveTask {
/**
* Add a nested filenamemapper.
*
*
* @param fileNameMapper
* the mapper to add.
*/
@ -210,7 +214,7 @@ public class IvyRetrieve extends IvyPostResolveTask {
/**
* Returns the path of the file relative to the given base directory.
*
*
* @param base
* the parent directory to which the file must be evaluated.
* @param file

View File

@ -278,8 +278,8 @@ public abstract class IvyTask extends Task {
/**
* The real logic of task execution after project has been set in the context. MUST be
* implemented by subclasses
*
* @throws BuildException
*
* @throws BuildException if something goes wrong
*/
public abstract void doExecute() throws BuildException;

View File

@ -36,7 +36,7 @@ import org.apache.ivy.util.MessageLogger;
/**
* This class represents an execution context of an Ivy action. It contains several getters to
* retrieve information, like the used Ivy instance, the cache location...
*
*
* @see IvyThread
*/
public class IvyContext {
@ -90,7 +90,7 @@ public class IvyContext {
* {@link #popContext()} should usually be called when the job for which this context has been
* pushed is finished.
* </p>
*
*
* @return the newly pushed context
*/
public static IvyContext pushNewContext() {
@ -104,7 +104,7 @@ public class IvyContext {
* {@link #popContext()} should usually be called when the job for which this context has been
* pushed is finished.
* </p>
*
*
* @return the newly pushed context
*/
public static IvyContext pushNewCopyContext() {
@ -115,7 +115,7 @@ public class IvyContext {
* Changes the context associated with this thread. This is especially useful when launching a
* new thread, to associate it with the same context as the initial one. Do not forget to call
* {@link #popContext()} when done.
*
*
* @param context
* the new context to use in this thread.
* @return the pushed context
@ -129,7 +129,7 @@ public class IvyContext {
* Pops one context used with this thread. This is usually called after having finished a task
* for which a call to {@link #pushNewContext()} or {@link #pushContext(IvyContext)} was done
* prior to beginning the task.
*
*
* @return the popped context
*/
public static IvyContext popContext() {
@ -144,7 +144,7 @@ public class IvyContext {
* This methods does a similar job to {@link #peek(String)}, except that it considers the whole
* context stack and not only one instance.
* </p>
*
*
* @param key
* context key for the string
* @return top object from the list (index 0) of the first context in the stack containing this
@ -172,7 +172,7 @@ public class IvyContext {
* Then, or if no ivy method has been called, a default ivy instance is returned by this method,
* so that it never returns <code>null</code>.
* </p>
*
*
* @return the current ivy instance
*/
public Ivy getIvy() {
@ -187,7 +187,7 @@ public class IvyContext {
* If you want get a default Ivy instance in case no instance if currently associated, use
* {@link #getIvy()}.
* </p>
*
*
* @return the current ivy instance, or <code>null</code> if there is no current ivy instance.
*/
public Ivy peekIvy() {
@ -233,7 +233,7 @@ public class IvyContext {
/**
* Reads the first object from the list saved under given key in the context. If value under key
* represents non List object then a RuntimeException is thrown.
*
*
* @param key
* context key for the string
* @return top object from the list (index 0) or null if no key or list empty
@ -259,7 +259,7 @@ public class IvyContext {
/**
* Removes and returns first object from the list saved under given key in the context. If value
* under key represents non List object then a RuntimeException is thrown.
*
*
* @param key
* context key for the string
* @return top object from the list (index 0) or null if no key or list empty
@ -286,9 +286,11 @@ public class IvyContext {
* Removes and returns first object from the list saved under given key in the context but only
* if it equals the given expectedValue - if not a false value is returned. If value under key
* represents non List object then a RuntimeException is thrown.
*
*
* @param key
* context key for the string
* @param expectedValue
* expected value of the key
* @return true if the r
*/
public boolean pop(String key, Object expectedValue) {
@ -318,7 +320,7 @@ public class IvyContext {
* under key represents non List object then a RuntimeException is thrown. If no list exists
* under given key a new LinkedList is created. This is kept without WeakReference in opposite
* to the put() results.
*
*
* @param key
* key context key for the string
* @param value

View File

@ -28,19 +28,20 @@ public abstract class RelativeUrlResolver {
/**
* Resolve the url in the context of context.
*
*
* @param context
* The URL of the resource containing the reference url
* @param url
* a relative or absolution url string
* @throws MalformedURLException
* @return URL
* @throws MalformedURLException if url is wrong
*/
public abstract URL getURL(URL context, String url) throws MalformedURLException;
/**
* Resolve file or url path relatively to a context. file is considered first. If file is not
* defined, url will be considered.
*
*
* @param context
* The URL of the resource containing the reference file or url
* @param file
@ -48,7 +49,7 @@ public abstract class RelativeUrlResolver {
* @param url
* a relative or absolution url string
* @return the resulting url or null if failed and url are null.
* @throws MalformedURLException
* @throws MalformedURLException if url is wrong
*/
public URL getURL(URL context, String file, String url) throws MalformedURLException {
if (file != null) {

View File

@ -22,7 +22,7 @@ import org.apache.ivy.util.Checks;
/**
* This class contains information about the origin of an artifact.
*
*
* @see org.apache.ivy.plugins.resolver.BasicResolver
* @see org.apache.ivy.plugins.resolver.util.ResolvedResource
*/
@ -31,6 +31,9 @@ public class ArtifactOrigin {
/**
* ArtifactOrigin instance used when the origin is unknown.
*
* @param artifact ditto
* @return ArtifactOrigin
*/
public static final ArtifactOrigin unknown(Artifact artifact) {
return new ArtifactOrigin(artifact, false, UNKNOWN);
@ -58,7 +61,7 @@ public class ArtifactOrigin {
/**
* Create a new instance
*
*
* @param artifact
* the artifact pointed by this location. Must not be <code>null</code>.
* @param isLocal
@ -77,7 +80,7 @@ public class ArtifactOrigin {
/**
* Is this resource local to this host, i.e. is it on the file system?
*
*
* @return <code>boolean</code> value indicating if the resource is local.
*/
public boolean isLocal() {
@ -86,7 +89,7 @@ public class ArtifactOrigin {
/**
* Return the location of the resource (normally a url)
*
*
* @return the location of the resource
*/
public String getLocation() {
@ -99,7 +102,7 @@ public class ArtifactOrigin {
/**
* Return the artifact that this location is pointing at.
*
*
* @return the artifact that this location is pointing at.
*/
public Artifact getArtifact() {
@ -109,7 +112,7 @@ public class ArtifactOrigin {
/**
* The last time the resource was checked to be up to date. Maybe <code>null</code> if this
* information is not actually used by in some case.
*
*
* @return Long timestamp
*/
public Long getLastChecked() {

View File

@ -306,7 +306,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* True if this cache should check lastmodified date to know if ivy files are up to date.
*
*
* @return boolean
*/
public boolean isCheckmodified() {
@ -324,6 +324,8 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* True if this cache should use artifacts original location when possible, false if they should
* be copied to cache.
*
* @return boolean
*/
public boolean isUseOrigin() {
if (useOrigin == null) {
@ -340,6 +342,9 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
* Returns a File object pointing to where the artifact can be found on the local file system.
* This is usually in the cache, but it can be directly in the repository if it is local and if
* the resolve has been done with useOrigin = true
*
* @param artifact Artifact
* @return File
*/
public File getArchiveFileInCache(Artifact artifact) {
ArtifactOrigin origin = getSavedArtifactOrigin(artifact);
@ -350,6 +355,10 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
* Returns a File object pointing to where the artifact can be found on the local file system.
* This is usually in the cache, but it can be directly in the repository if it is local and if
* the resolve has been done with useOrigin = true
*
* @param artifact Artifact
* @param origin ArtifactOrigin
* @return File
*/
public File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin) {
File archive = new File(getRepositoryCacheRoot(), getArchivePathInCache(artifact, origin));
@ -368,6 +377,11 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
* using or not the original location depending on the availability of origin information
* provided as parameter and the setting of useOrigin. If useOrigin is false, this method will
* always return the file in the cache.
*
* @param artifact Artifact
* @param origin ArtifactOrigin
* @param useOrigin boolean
* @return File
*/
private File getArchiveFileInCache(Artifact artifact, ArtifactOrigin origin, boolean useOrigin) {
if (useOrigin && !ArtifactOrigin.isUnknown(origin) && origin.isLocal()) {
@ -390,7 +404,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Saves the information of which resolver was used to resolve a md, so that this info can be
* retrieve later (even after a jvm restart) by getSavedResolverName(ModuleDescriptor md)
*
*
* @param md
* the module descriptor resolved
* @param name
@ -406,7 +420,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Saves the information of which resolver was used to resolve a md, so that this info can be
* retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)
*
*
* @param md
* the module descriptor resolved
* @param metadataResolverName
@ -573,7 +587,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Creates the unique prefix key that will reference the artifact within the properties.
*
*
* @param artifact
* the artifact to create the unique key from. Cannot be null.
* @return the unique prefix key as a string.
@ -588,7 +602,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Returns the key used to identify the location of the artifact.
*
*
* @param artifact
* the artifact to generate the key from. Cannot be null.
* @return the key to be used to reference the artifact location.
@ -600,7 +614,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Returns the key used to identify if the artifact is local.
*
*
* @param artifact
* the artifact to generate the key from. Cannot be null.
* @return the key to be used to reference the artifact locality.
@ -612,7 +626,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Returns the key used to identify the last time the artifact was checked to be up to date.
*
*
* @param artifact
* the artifact to generate the key from. Cannot be null.
* @return the key to be used to reference the artifact's last check date.
@ -624,7 +638,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Returns the key used to identify the existence of the remote artifact.
*
*
* @param artifact
* the artifact to generate the key from. Cannot be null.
* @return the key to be used to reference the existence of the artifact.
@ -636,7 +650,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Returns the key used to identify the original artifact.
*
*
* @param artifact
* the artifact to generate the key from. Cannot be null.
* @return the key to be used to reference the original artifact.
@ -786,7 +800,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Choose write module descriptor parser for a given moduleDescriptor
*
*
* @param moduleDescriptorFile
* a given module descriptor
* @return ModuleDescriptorParser
@ -1153,7 +1167,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Compute a SHA1 of the resource name, encoded in base64, so we can use it as a file name.
*
*
* @param resource
* the resource which name will be hashed
* @return the hash
@ -1169,7 +1183,7 @@ public class DefaultRepositoryCacheManager implements RepositoryCacheManager, Iv
/**
* Check that a cached file can be considered up to date and thus not downloaded
*
*
* @param archiveFile
* the file in the cache
* @param resource

View File

@ -52,6 +52,10 @@ public class CheckEngine {
* are available in the corresponding resolver. Note that the check is not performed
* recursively, i.e. if a dependency has itself dependencies badly described or not available,
* this check will not discover it.
*
* @param ivyFile URL
* @param resolvername String
* @return boolean
*/
public boolean check(URL ivyFile, String resolvername) {
try {

View File

@ -53,13 +53,15 @@ public class DeliverEngine {
* Delivers a resolved ivy file based upon last resolve call status. If resolve report file
* cannot be found in cache, then it throws an IllegalStateException (maybe resolve has not been
* called before ?).
*
*
* @param revision
* the revision to which the module should be delivered
* @param destIvyPattern
* the pattern to which the delivered ivy file should be written
* @param options
* the options with which deliver should be done
* @throws IOException if something goes wrong
* @throws ParseException if something goes wrong
*/
public void deliver(String revision, String destIvyPattern, DeliverOptions options)
throws IOException, ParseException {
@ -86,7 +88,7 @@ public class DeliverEngine {
* Delivers a resolved ivy file based upon last resolve call status. If resolve report file
* cannot be found in cache, then it throws an IllegalStateException (maybe resolve has not been
* called before ?).
*
*
* @param mrid
* the module revision id of the module to deliver
* @param revision
@ -95,6 +97,8 @@ public class DeliverEngine {
* the pattern to which the delivered ivy file should be written
* @param options
* the options with which deliver should be done
* @throws IOException if something goes wrong
* @throws ParseException if something goes wrong
*/
public void deliver(ModuleRevisionId mrid, String revision, String destIvyPattern,
DeliverOptions options) throws IOException, ParseException {

View File

@ -55,7 +55,7 @@ public class DeliverOptions {
/**
* Returns an instance of DeliverOptions with options corresponding to default values taken from
* the given settings.
*
*
* @param settings
* The settings to use to get default option values
* @return a DeliverOptions instance ready to be used or customized
@ -74,6 +74,12 @@ public class DeliverOptions {
/**
* Creates an instance of DeliverOptions with all options explicitly set.
* @param status String
* @param pubDate Date
* @param pdrResolver PublishingDependencyRevisionResolver
* @param validate boolean
* @param resolveDynamicRevisions boolean
* @param confs String[]
*/
public DeliverOptions(String status, Date pubDate,
PublishingDependencyRevisionResolver pdrResolver, boolean validate,
@ -93,7 +99,7 @@ public class DeliverOptions {
* PublishingDependencyRevisionResolver can then do the delivering work for the dependency and
* return the new (delivered) dependency info (with the delivered revision). Note that
* PublishingDependencyRevisionResolver is only called for each <b>direct</b> dependency.
*
*
* @return the pdrResolver that will be used during deliver
*/
public PublishingDependencyRevisionResolver getPdrResolver() {
@ -107,7 +113,8 @@ public class DeliverOptions {
* PublishingDependencyRevisionResolver can then do the delivering work for the dependency and
* return the new (delivered) dependency info (with the delivered revision). Note that
* PublishingDependencyRevisionResolver is only called for each <b>direct</b> dependency.
*
*
* @param pdrResolver PublishingDependencyRevisionResolver
* @return the instance of DeliverOptions on which the method has been called, for easy method
* chaining
*/
@ -155,7 +162,7 @@ public class DeliverOptions {
/**
* Returns the status to which the module should be delivered, or null if the current status
* should be kept.
*
*
* @return the status to which the module should be delivered
*/
public String getStatus() {
@ -165,7 +172,8 @@ public class DeliverOptions {
/**
* Sets the status to which the module should be delivered, use null if the current status
* should be kept.
*
*
* @param status String
* @return the instance of DeliverOptions on which the method has been called, for easy method
* chaining
*/
@ -176,7 +184,7 @@ public class DeliverOptions {
/**
* Returns the id of a previous resolve to use for delivering.
*
*
* @return the id of a previous resolve
*/
public String getResolveId() {
@ -185,7 +193,7 @@ public class DeliverOptions {
/**
* Sets the id of a previous resolve to use for delivering.
*
*
* @param resolveId
* the id of a previous resolve
* @return the instance of DeliverOptions on which the method has been called, for easy method
@ -199,7 +207,7 @@ public class DeliverOptions {
/**
* Return the configurations which must be delivered. Returns <tt>null</tt> if all configurations
* has to be delivered. Attention: the returned array can contain wildcards!
*
*
* @return the configurations to deliver
*/
public String[] getConfs() {
@ -208,7 +216,7 @@ public class DeliverOptions {
/**
* Sets the configurations to deliver.
*
*
* @param confs
* the configurations to deliver
* @return the instance of DeliverOptions on which the method has been called, for easy method
@ -222,7 +230,7 @@ public class DeliverOptions {
/**
* Returns the branch with which the Ivy file should be delivered, or <code>null</code> if
* branch info shouldn't be changed.
*
*
* @return the branch with which the Ivy file should be delivered
*/
public String getPubBranch() {
@ -231,7 +239,7 @@ public class DeliverOptions {
/**
* Sets the branch with which the Ivy file should be delivered.
*
*
* @param pubBranch
* the branch with which the Ivy file should be delivered
* @return the instance of DeliverOptions on which the method has been called, for easy method
@ -264,7 +272,6 @@ public class DeliverOptions {
return "status=" + status + " pubdate=" + pubdate + " validate=" + validate
+ " resolveDynamicRevisions=" + resolveDynamicRevisions + " merge=" + merge
+ " resolveId=" + resolveId + " pubBranch=" + pubBranch;
}
}

View File

@ -27,15 +27,19 @@ import org.apache.ivy.core.module.id.ModuleRevisionId;
import org.apache.ivy.util.StringUtils;
/**
* <p>
* The root of all ivy events Any ivy event knows which ivy instance triggered the event (the
* source) and also has a name and a map of attributes. The name of the event represents the event
* type, usually there is a one - one mapping between event names and IvyEvent subclass, even if
* this is not mandatory. Example: pre-resolve pre-resolve-dependency post-download The map of
* attributes is a Map from String keys to String values. It is especially useful to filter events,
* and to get some of their essential data in some context where access to Java types is not easy
* (in an ant build file, for example), Example: pre-resolve (organisation=foo, module=bar,
* revision=1.0, conf=default) post-download (organisation=foo, module=bar, revision=1.0,
* artifact=foo-test, type=jar, ext=jar)
* this is not mandatory. Example: <code>pre-resolve pre-resolve-dependency post-download</code>
* </p>
* <p>
* The map of attributes is a Map from String keys to String values. It is especially useful to
* filter events, and to get some of their essential data in some context where access to Java types
* is not easy (in an Ant build file, for example), Example: <code>pre-resolve (organisation=foo,
* module=bar, revision=1.0, conf=default) post-download (organisation=foo, module=bar,
* revision=1.0, artifact=foo-test, type=jar, ext=jar)</code>
* </p>
*/
public class IvyEvent {
private EventManager source;
@ -51,7 +55,7 @@ public class IvyEvent {
/**
* Should only be called during event object construction, since events should be immutable
*
*
* @param key ditto
* @param value ditto
*/
@ -93,9 +97,9 @@ public class IvyEvent {
}
/**
* Returns the attributes of this event, as a Map(String->String)
*
* @return the attributes of this event, as a Map(String->String)
* Returns the attributes of this event, as a Map(String,String)
*
* @return the attributes of this event, as a Map(String,String)
*/
public Map getAttributes() {
return new HashMap(attributes);

View File

@ -34,6 +34,7 @@ import org.apache.ivy.util.filter.OrFilter;
* attribute values is done using the {@link PatternMatcher} used to construct this object. Here are
* some examples:
* <table>
* <caption>Filtering examples</caption>
* <tr>
* <td>expression</td>
* <td>effect</td>
@ -60,10 +61,10 @@ import org.apache.ivy.util.filter.OrFilter;
* </tr>
* </table>
* Combination of these can be used, but no parentheses are supported right now, so only the default
* priority can be used. The priority order is this one: AND OR NOT = This means that artifact=foo
* AND ext=zip OR type=src will match event with artifact matching foo AND (ext matching zip OR type
* matching src)
*
* priority can be used. The priority order is this one: <code>AND OR NOT =</code> This means that
* <code>artifact=foo AND ext=zip OR type=src</code> will match event with artifact matching foo AND
* (ext matching zip OR type matching src)
*
* @since 1.4
*/
public class IvyEventFilter implements Filter {

View File

@ -57,7 +57,7 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
* descriptor in the system namespace. <i>Note that exclude rules are not converted in system
* namespace, because they aren't transformable (the name space hasn't the ability to convert
* regular expressions). However, method doesExclude will work with system artifacts.</i>
*
*
* @param dd DependencyDescriptor
* @param ns Namespace
* @return DependencyDescriptor
@ -76,9 +76,10 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
* Transforms a dependency descriptor using the given transformer. Note that no namespace info
* will be attached to the transformed dependency descriptor, so calling doesExclude is not
* recommended (doesExclude only works when namespace is properly set)
*
*
* @param dd DependencyDescriptor
* @param t NamespaceTransformer
* @param fromSystem boolean
* @return DefaultDependencyDescriptor
*/
public static DefaultDependencyDescriptor transformInstance(DependencyDescriptor dd,
@ -252,6 +253,7 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
* extending one). Both moduleConfiguration and requestedConfiguration are configurations of the
* caller, the array returned is composed of the required configurations of the dependency
* described by this descriptor.
* </p>
*/
public String[] getDependencyConfigurations(String moduleConfiguration,
String requestedConfiguration) {
@ -288,16 +290,22 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
* we do not handle special confs like *!sg or [cond]* in right hand
* confs yet: it would require supporting parenthesis grouping in
* configurations intersection interpretation
*
* for (Iterator it2 = depConfs.iterator(); it2.hasNext();) { String
* depConf = (String) it2.next(); if (depConf.startsWith("*")) { if
* (intersectedDepConf .indexOf("(" + depConf + ")") != -1) {
* intersectedDepConfs.add(intersectedDepConf); } else {
* intersectedDepConfs.add( "(" + intersectedDepConf + ")+(" +
* depConf + ")"); } } else if (intersectedDepConf.startsWith("*"))
* { if (depConf .indexOf("(" + intersectedDepConf + ")") != -1) {
* intersectedDepConfs.add(depConf); } else {
* intersectedDepConfs.add( depConf + "+" + intersectedDepConf); } }
*
* for (Iterator it2 = depConfs.iterator(); it2.hasNext();) {
* String depConf = (String) it2.next();
* if (depConf.startsWith("*")) {
* if (intersectedDepConf .indexOf("(" + depConf + ")") != -1) {
* intersectedDepConfs.add(intersectedDepConf);
* } else {
* intersectedDepConfs.add( "(" + intersectedDepConf + ")+(" + depConf + ")");
* }
* } else if (intersectedDepConf.startsWith("*")) {
* if (depConf .indexOf("(" + intersectedDepConf + ")") != -1) {
* intersectedDepConfs.add(depConf);
* } else {
* intersectedDepConfs.add( depConf + "+" + intersectedDepConf);
* }
* }
* }
*/
}
@ -406,7 +414,7 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
/**
* Replaces fallback patterns with correct values if fallback pattern exists.
*
*
* @param pattern
* pattern to look for
* @param conf
@ -607,7 +615,7 @@ public class DefaultDependencyDescriptor implements DependencyDescriptor {
}
/**
*
*
* @return true if this descriptor contains any exclusion rule
*/
public boolean canExclude() {

View File

@ -133,7 +133,7 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
* descriptor in the system namespace. <i>Note that dependency exclude rules are not converted
* in system namespace, because they aren't transformable (the name space hasn't the ability to
* convert regular expressions)</i>
*
*
* @param md ModuleDescriptor
* @param ns Namespace
* @return ModuleDescriptor
@ -280,6 +280,9 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
/**
* IMPORTANT : at least call setModuleRevisionId and setResolvedPublicationDate with instances
* created by this constructor !
*
* @param parser ModuleDescriptorParser
* @param res Resource
*/
public DefaultModuleDescriptor(ModuleDescriptorParser parser, Resource res) {
this.parser = parser;
@ -361,7 +364,7 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
/**
* Artifact configurations are not used since added artifact may not be entirely completed, so
* its configurations data may not be accurate
*
*
* @param conf ditto
* @param artifact ditto
*/
@ -427,6 +430,8 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
/**
* Returns the configuration object with the given name in the current module descriptor, null
* if not found.
*
* @param confName String
*/
public Configuration getConfiguration(String confName) {
Configuration configuration = configurations.get(confName);
@ -599,7 +604,7 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
/**
* regular expressions as explained in Pattern class may be used in ModuleId organisation and
* name
*
*
* @param moduleId ditto
* @param matcher PatternMatcher
* @param manager ConflictManager
@ -681,7 +686,7 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
}
/**
* Throws an exception if the module descriptor is inconsistent For the moment, only extended
* Throws an exception if the module descriptor is inconsistent. For the moment, only extended
* configurations existence and cycles are checked
*/
public void check() {
@ -781,8 +786,12 @@ public class DefaultModuleDescriptor implements ModuleDescriptor {
}
/**
* only works when namespace is properly set. The behaviour is not specified if namespace is not
* set
* Only works when namespace is properly set. The behaviour is not specified if namespace is
* not set.
*
* @param moduleConfigurations String[]
* @param artifactId ditto
* @return boolean
*/
public boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId) {
if (namespace != null) {

View File

@ -27,44 +27,32 @@ import org.apache.ivy.util.extendable.ExtendableItem;
*/
public interface DependencyArtifactDescriptor extends ExtendableItem {
/**
* Returns the dependency descriptor in which this dependency artifact descriptor is declared.
*
* @return the dependency descriptor in which this dependency artifact descriptor is declared.
*/
public DependencyDescriptor getDependencyDescriptor();
/**
* Returns the name of the artifact asked
*
* @return
* @return the name of the artifact asked
*/
public String getName();
/**
* Returns the type of the artifact asked
*
* @return
* @return the type of the artifact asked
*/
public String getType();
/**
* Returns the ext of the artifact asked
*
* @return
* @return the ext of the artifact asked
*/
public String getExt();
/**
* Returns the url to look this artifact at
*
* @return
* @return the url to look this artifact up at
*/
public URL getUrl();
/**
* Returns the configurations of the module in which the artifact is asked
*
* @return an array of configuration names in which the artifact is asked
* @return an array of configuration names of the module in which the artifact is asked
*/
public String[] getConfigurations();
}

View File

@ -34,11 +34,11 @@ import org.apache.ivy.util.extendable.ExtendableItem;
* </p>
* <p>
* Then there is the dynamic constraint, which can either be the same as the default constraint, or
* the original dependency constraint when an Ivy file is delivered an published to a repository.
* This dynamic constraint is returned by {@link #getDynamicConstraintDependencyRevisionId()}, and
* corresponds to the <code>revconstraint</code> attribute in the Ivy file. In some resolve mode,
* this constraint can be used instead of the default dependency constraint when performing
* dependency resolution.
* the original dependency constraint when an Ivy file is delivered an published to a
* repository. This dynamic constraint is returned by
* {@link #getDynamicConstraintDependencyRevisionId()}, and corresponds to the
* <code>revconstraint</code> attribute in the Ivy file. In some resolve mode, this constraint can
* be used instead of the default dependency constraint when performing dependency resolution.
* </p>
*/
public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
@ -47,7 +47,7 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
/**
* Used to indicate that this revision must be used in case of conflicts, independently of
* conflicts manager. This only works for direct dependencies, and not transitive ones.
*
*
* @return true if this dependency should be used, false if conflicts manager can do its work.
*/
boolean isForce();
@ -57,7 +57,7 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
* that the revision may have its artifacts modified without revision change. When new artifacts
* are published a new ivy file should also be published with a new publication date to indicate
* to ivy that artifacts have changed and that they should be downloaded again.
*
*
* @return true if this dependency is a changing one
*/
boolean isChanging();
@ -68,14 +68,14 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
/**
* Returns the constraint on dependency this descriptor represents.
*
*
* @return the constraint on dependency.
*/
ModuleRevisionId getDependencyRevisionId();
/**
* Returns the dynamic constraint on dependency this descriptor represents.
*
*
* @return the dynamic constraint on dependency, or exact constraint if no dynamic constraint is
* specified.
*/
@ -111,7 +111,7 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
/**
* Returns true if
*
*
* @param moduleConfigurations ditto
* @param artifactId ditto
* @return boolean
@ -119,8 +119,6 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId);
/**
* Returns true if this descriptor contains any exclusion rule
*
* @return true if this descriptor contains any exclusion rule
*/
public boolean canExclude();
@ -129,7 +127,7 @@ public interface DependencyDescriptor extends ExtendableItem, InheritableItem {
/**
* Clones current dependency descriptor with another revision.
*
*
* @param revision
* the revision of the cloned dependency descriptor
* @return the cloned dependency descriptor

View File

@ -24,12 +24,18 @@ import org.apache.ivy.core.module.id.ModuleRevisionId;
*/
public interface ExtendsDescriptor {
/** get the module revision id of the declared parent descriptor */
/**
* get the module revision id of the declared parent descriptor
*
* @return ModuleRevisionId
*/
public ModuleRevisionId getParentRevisionId();
/**
* get the resolved revision id for {@link #getParentRevisionId}, see
* {@link org.apache.ivy.core.module.descriptor.ModuleDescriptor#getResolvedModuleRevisionId()}
*
* @return ModuleRevisionId
*/
public ModuleRevisionId getResolvedParentRevisionId();
@ -38,6 +44,8 @@ public interface ExtendsDescriptor {
/**
* If there is an explicit path to check for the parent descriptor, return it. Otherwise returns
* null.
*
* @return String
*/
public String getLocation();
@ -46,22 +54,34 @@ public interface ExtendsDescriptor {
* <code>info</code>, <code>description</code>, <code>configurations</code>,
* <code>dependencies</code>, and/or <code>all</code>. Ivy extensions may add support for
* additional extends types.
*
* @return String[]
*/
public String[] getExtendsTypes();
/** @return true if the <code>all</code> extend type is specified, implying all other types */
/**
* @return true if the <code>all</code> extend type is specified, implying all other types
*/
public boolean isAllInherited();
/** @return true if parent info attributes are inherited (organisation, branch, revision, etc) */
/**
* @return true if parent info attributes are inherited (organisation, branch, revision, etc)
*/
public boolean isInfoInherited();
/** @return true if parent description is inherited */
/**
* @return true if parent description is inherited
*/
public boolean isDescriptionInherited();
/** @return true if parent configurations are inherited */
/**
* @return true if parent configurations are inherited
*/
public boolean areConfigurationsInherited();
/** @return true if parent dependencies are inherited */
/**
* @return true if parent dependencies are inherited
*/
public boolean areDependenciesInherited();
public boolean isLocal();

View File

@ -46,35 +46,31 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
public static final String CALLER_ALL_CONFIGURATION = "all";
/**
* Returns true if this descriptor is a default one, i.e. one generated for a module not
* actually having one.
*
* @return boolean
* @return true if this descriptor is a default one, i.e. one generated for a module not
* actually having one.
*/
boolean isDefault();
ModuleRevisionId getModuleRevisionId();
/**
* The module revision id returned here is the resolved one, i.e. it is never a latest one. If
* the revision has not been resolved, a null revision should be returned by getRevision() of
* the returned ModuleRevisionId. This revision must be the same as the module descriptor
* resolved revision id unless no module descriptor is defined
*
* @return ModuleRevisionId
* @return the resolved module revision id; it is never the latest one. If the revision has not
* been resolved, a null revision should be returned by getRevision() of the returned
* ModuleRevisionId. This revision must be the same as the module descriptor resolved
* revision id unless no module descriptor is defined
*/
ModuleRevisionId getResolvedModuleRevisionId();
/**
* This method update the resolved module revision id
* This method updates the resolved module revision id
*
* @param revId ModuleRevisionId
*/
void setResolvedModuleRevisionId(ModuleRevisionId revId);
/**
* Get the list of parent descriptors imported via an &lt;extends&gt; element. Only directly
* imported descriptors are included; the parent's parents are not included.
* @return the list of parent descriptors imported via an &lt;extends&gt; element. Only directly
* imported descriptors are included; the parent's parents are not included.
*/
ExtendsDescriptor[] getInheritedDescriptors();
@ -88,9 +84,7 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
String getStatus();
/**
* May be <code>null</code> if unknown in the descriptor itself.
*
* @return The publication date or <code>null</code> when not known.
* @return the publication date or null when not known in the descriptor itself.
*/
Date getPublicationDate();
@ -98,14 +92,14 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
* The publication date of the module revision should be the date at which it has been
* published, i.e. in general the date of any of its published artifacts, since all published
* artifact of a module should follow the same publishing cycle.
*
* @return Date
*/
Date getResolvedPublicationDate();
/**
* Returns all the configurations declared by this module as an array. This array is never empty
* (a 'default' conf is assumed when none is declared in the ivy file)
*
* @return all the configurations declared by this module as an array.
* @return all the configurations declared by this module as an array. This array is never empty
* (a 'default' conf is assumed when none is declared in the ivy file).
*/
Configuration[] getConfigurations();
@ -116,27 +110,23 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
Artifact[] getArtifacts(String conf);
/**
* Returns all artifacts of this module, excluding the artifact corresponding to the module
* descriptor.
*
* @return all published artifacts of this module
* @return all published artifacts of this module, excluding the artifact corresponding to the
* module descriptor.
* @see #getMetadataArtifact()
*/
Artifact[] getAllArtifacts();
/**
* @return The dependencies of the module. If there is no dependencies return an empty array (non
* null)
* @return The dependencies of the module. If there are no dependencies return an empty array
* (non null)
*/
DependencyDescriptor[] getDependencies();
/**
* Returns true if the module described by this descriptor depends directly upon the given
* module descriptor
*
* @param matcher VersionMatcher
* @param md ModuleDescriptor
* @return boolean
* @return true if the module described by this descriptor depends directly upon the given
* module descriptor
*/
boolean dependsOn(VersionMatcher matcher, ModuleDescriptor md);
@ -147,18 +137,14 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
Configuration getConfiguration(String confName);
/**
* Returns the conflict manager to use for the given ModuleId, or <code>null</code> if no
* specific conflict manager is associated with the given module id in this module descriptor.
*
* @param id ModuleId
* @return ConflictManager
* @return the conflict manager to use for the given ModuleId, or null if no specific conflict
* manager is associated with the given module id in this module descriptor.
*/
ConflictManager getConflictManager(ModuleId id);
/**
* Returns the licenses of the module described by this descriptor
*
* @return License[]
* @return the licenses of the module described by this descriptor
*/
License[] getLicenses();
@ -175,92 +161,69 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
*
* @param ivyFile
* the destination ivy file
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
void toIvyFile(File ivyFile) throws ParseException, IOException;
/**
* The ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.
*
* @return ModuleDescriptorParser
* @return the ModuleDescriptorParser used to parse this module descriptor, null is no parser was used.
*/
ModuleDescriptorParser getParser();
/**
* The resource being the source of this module descriptor, null if no resource corresponds to
* this module descriptor
*
* @return Resource
* @return the resource being the source of this module descriptor, null if no resource
* corresponds to this module descriptor.
*/
Resource getResource();
/**
* Returns the Artifact representing this module descriptor itself.
* <p>
* Even though the module descriptor is never described as a published artifact of a module in
* the module descriptor itself, it is often useful to consider it as any other artifact of the
* module. This method allows to access to the Artifact object representing this module
* descriptor for this purpose.
* </p>
*
* @return the Artifact representing this module descriptor itself.
*/
Artifact getMetadataArtifact();
/**
* Returns true if this descriptor contains any exclusion rule
*
* @return true if this descriptor contains any exclusion rule
* @return true if this descriptor contains any exclusion rule.
*/
boolean canExclude();
/**
* Returns true if an exclude rule of this module attached to any of the given configurations
* matches the given artifact id, and thus exclude it
*
* @param moduleConfs String[]
* @param artifactId ditto
* @return boolean
* @return true if an exclude rule of this module attached to any of the given configurations
* matches the given artifact id, and thus exclude it
*/
boolean doesExclude(String[] moduleConfs, ArtifactId artifactId);
/**
* Returns an array of all the exclude rules this module descriptor currently holds. Module
* Descriptor exclude rules are used to exclude (usually transitive) dependencies for the whole
* module.
* Module Descriptor exclude rules are used to exclude (usually transitive) dependencies for the
* whole module.
*
* @return an array of {@link ExcludeRule} this module descriptor holds
* @return an array of all {@link ExcludeRule} this module descriptor currently holds.
*/
public ExcludeRule[] getAllExcludeRules();
/**
* Returns all the dependency descriptor mediators used by this {@link ModuleDescriptor}, as an
* instance of {@link ModuleRules}.
* <p>
* All rules in the {@link ModuleRules} object returned are {@link DependencyDescriptorMediator}
* .
* </p>
*
* @return all the dependency descriptor mediators used by this {@link ModuleDescriptor}.
* @return all the {@link DependencyDescriptorMediator}s used by this
* {@link ModuleDescriptor}, as an instance of {@link ModuleRules}.
*/
public ModuleRules/* <DependencyDescriptorMediator> */getAllDependencyDescriptorMediators();
/**
* Returns the list of xml namespaces used by extra attributes, as Map from prefix to namespace
* URIs.
* <p>
* The returned list is never <code>null</code>, it is empty when no extra attribute is used or
* if extra attributes are used without xml namespaces
* </p>
*
* @return the list of xml namespaces used by extra attributes, as Map from prefix to namespace
* URIs.
* URIs. The returned list is never null, it is empty when no extra attribute is used or
* if extra attributes are used without xml namespaces
*/
Map<String, String> getExtraAttributesNamespaces();
/**
* Returns the custom info provided in the info tag. All the tags except the description are
* given. The key is the name of the tag, the value is its content. <br />
*
* @return the custom info provided in the info tag. All the tags except the description are
* given. The key is the name of the tag, the value is its content.
* @deprecated this method is not returning the full content of the extra info: to get the full
* structure of the extra infos, use getExtraInfos()
*/
@ -268,27 +231,23 @@ public interface ModuleDescriptor extends ExtendableItem, ArtifactInfo,
Map<String, String> getExtraInfo();
/**
* Returns a list of extras infos (tag name, attributes and content). All the tags except the
* description are given.
*
* @since 2.4.0
* @return List&lt;ExtraInfoHolder&gt;
* @return a list of extras infos (tag name, attributes and content). All the tags except the
* description are given.
*/
List<ExtraInfoHolder> getExtraInfos();
/**
* Returns content from first extrainfo matching with given tag name
*
* @since 2.4.0
* @return ditto
* @param tagName String
* @return content from first extrainfo matching with given tag name.
*/
String getExtraInfoContentByTagName(String tagName);
/**
* Returns first extrainfo matching with given tag name
*
* @since 2.4.0
* @return ExtraInfoHolder
* @param tagName String
* @return first extrainfo matching with given tag name.
*/
ExtraInfoHolder getExtraInfoByTagName(String tagName);
}

View File

@ -19,7 +19,7 @@ package org.apache.ivy.core.module.id;
/**
* Identifies an artifact in a module, without revision information
*
*
* @see <a href="package-summary.html">org.apache.ivy.core.module.id</a>
*/
public class ArtifactId {
@ -38,6 +38,8 @@ public class ArtifactId {
* The name of the artifact.
* @param type
* The type of the artifact.
* @param ext
* The name extension of the artifact.
*/
public ArtifactId(ModuleId mid, String name, String type, String ext) {
this.mid = mid;

View File

@ -33,24 +33,22 @@ import org.apache.ivy.plugins.matcher.PatternMatcher;
* matcher's attributes. When matcher is looked up against specific module, the key is recreated
* from module's attributes.
* <p>
* </p>
* The lookup doesn't target to speed up lookup for non exact pattern matcher. All non exact
* matchers are placed in non-keyed collection.
* <p>
* </p>
* <p>
* At lookup for matchers against specific module, all non exact pattern matchers are iterated to
* match with module attributes, and exact pattern matchers binding to the same key will also
* iterated to match with module attributes.
* <p>
* </p>
* <p>
* If there are much more exact pattern matchers than non exact pattern matchers, the matcher lookup
* speed can benefit from this class significantly. A quick example could be user declares lots of
* dependencyOverrides which are typically exact pattern matchers.
* <p>
* </p>
* <p>
* If there are balanced exact and non exact pattern matchers, the matcher lookup speed doesn't hurt
* by this class.
* <p>
* </p>
*/
public class MatcherLookup {
@ -65,12 +63,12 @@ public class MatcherLookup {
/**
* Add matcher.
*
*
* If matcher is exact pattern matcher, it will be associated with a key and placed in keyed
* collection.
*
*
* If matcher is not exact pattern matcher, it will be placed into non-keyed collection
*
*
* @param matcher MapMatcher
*/
public void add(MapMatcher matcher) {
@ -88,12 +86,10 @@ public class MatcherLookup {
}
/**
* Get a list of matchers which can apply to module with specified attributes
*
* @param attrs
* A map of attributes that matcher should match.
*
* @return list A list of candidate matchers that matches specified attributes
*
* @return a list of matchers that can apply to module withs specified attributes
*/
public List<MapMatcher> get(Map<String, String> attrs) {
List<MapMatcher> matchers = new ArrayList<MapMatcher>();
@ -131,7 +127,7 @@ public class MatcherLookup {
/**
* Create a key from specified attributes
*
*
* @param attrs
* A map of attributes
* @return key object

View File

@ -73,6 +73,13 @@ public class PublishEngine {
* reports. The extra artifacts array can be null (= no extra artifacts), and if non null only
* the name, type, ext url and extra attributes of the artifacts are really used. Other methods
* can return null safely.
*
* @param mrid ModuleRevisionId
* @param srcArtifactPattern a Collection of String
* @param resolverName String
* @param options PublishOptions
* @return Collection&lt;Artifact&gt;
* @throws IOException if something goes wrong
*/
public Collection<Artifact> publish(ModuleRevisionId mrid,
Collection<String> srcArtifactPattern, String resolverName, PublishOptions options)

View File

@ -78,11 +78,15 @@ public class ConfigurationResolveReport {
}
/**
* Check if the set of dependencies has changed since the previous execution of a resolution.<br/>
* Check if the set of dependencies has changed since the previous execution of a resolution.
* <p>
* This function use the report file found in the cache. So the function must be called before
* the new report is serialized there.</br> This function also use the internal dependencies
* that must already be filled. This function might be 'heavy' because it may have to parse the
* previous report.
* the new report is serialized there.
* </p>
* <p>
* This function also use the internal dependencies that must already be filled. This function
* might be 'heavy' because it may have to parse the previous report.
* </p>
*/
public void checkIfChanged() {
ResolutionCacheManager cache = resolveEngine.getSettings().getResolutionCacheManager();
@ -109,6 +113,7 @@ public class ConfigurationResolveReport {
/**
* @pre checkIfChanged has been called.
* @return boolean
*/
public boolean hasChanged() {
return hasChanged;
@ -117,7 +122,7 @@ public class ConfigurationResolveReport {
/**
* Returns all non evicted and non error dependency mrids The returned set is ordered so that a
* dependency will always be found before their own dependencies
*
*
* @return all non evicted and non error dependency mrids
*/
public Set<ModuleRevisionId> getModuleRevisionIds() {
@ -235,7 +240,7 @@ public class ConfigurationResolveReport {
/**
* gives all the modules ids concerned by this report, from the most dependent to the least one
*
*
* @return a list of ModuleId
*/
public List<ModuleId> getModuleIds() {
@ -278,7 +283,7 @@ public class ConfigurationResolveReport {
/**
* Get every report on the download requests.
*
*
* @return the list of reports, never <code>null</code>
*/
public ArtifactDownloadReport[] getAllArtifactsReports() {
@ -288,7 +293,7 @@ public class ConfigurationResolveReport {
/**
* Get the report on the download requests. The list of download report can be restricted to a
* specific download status, and also remove the download report for the evicted modules.
*
*
* @param downloadStatus
* the status of download to retrieve. Set it to <code>null</code> for no restriction
* on the download status
@ -321,7 +326,7 @@ public class ConfigurationResolveReport {
/**
* Get the report on the successful download requests with the evicted modules
*
*
* @return the list of reports, never <code>null</code>
*/
public ArtifactDownloadReport[] getDownloadedArtifactsReports() {
@ -330,7 +335,7 @@ public class ConfigurationResolveReport {
/**
* Get the report on the failed download requests with the evicted modules
*
*
* @return the list of reports, never <code>null</code>
*/
public ArtifactDownloadReport[] getFailedArtifactsReports() {

View File

@ -38,7 +38,8 @@ public final class DownloadStatus {
/**
* Returns the {@link DownloadStatus} corresponding to the given String representation.
*
*
* @param status String
* @return the {@link DownloadStatus} corresponding to the given String representation.
* @throws IllegalArgumentException
* if the given String does not correspond to any {@link DownloadStatus}.

View File

@ -128,7 +128,7 @@ public class ResolveReport {
/**
* Get every report on the download requests.
*
*
* @return the list of reports, never <code>null</code>
*/
public ArtifactDownloadReport[] getFailedArtifactsReports() {
@ -138,7 +138,7 @@ public class ResolveReport {
/**
* Get every report on the download requests.
*
*
* @return the list of reports, never <code>null</code>
*/
public ArtifactDownloadReport[] getAllArtifactsReports() {
@ -148,7 +148,7 @@ public class ResolveReport {
/**
* Get the report on the download requests. The list of download report can be restricted to a
* specific download status, and also remove the download report for the evicted modules.
*
*
* @param downloadStatus
* the status of download to retrieve. Set it to <code>null</code> for no restriction
* on the download status
@ -184,7 +184,11 @@ public class ResolveReport {
}
}
/** Can only be called if checkIfChanged has been called */
/**
* Can only be called if checkIfChanged has been called
*
* @return boolean
*/
public boolean hasChanged() {
for (ConfigurationResolveReport report : confReports.values()) {
if (report.hasChanged()) {
@ -245,7 +249,7 @@ public class ResolveReport {
/**
* Returns the list of all dependencies concerned by this report as a List of IvyNode ordered
* from the more dependent to the least one
*
*
* @return The list of all dependencies.
*/
public List<IvyNode> getDependencies() {
@ -255,7 +259,7 @@ public class ResolveReport {
/**
* Returns the list of all artifacts which should be downloaded per this resolve To know if the
* artifact have actually been downloaded use information found in ConfigurationResolveReport.
*
*
* @return The list of all artifacts.
*/
public List<Artifact> getArtifacts() {
@ -264,7 +268,7 @@ public class ResolveReport {
/**
* gives all the modules ids concerned by this report, from the most dependent to the least one
*
*
* @return a list of ModuleId
*/
public List<ModuleId> getModuleIds() {
@ -305,7 +309,7 @@ public class ResolveReport {
* This only includes artifacts actually downloaded to cache (DownloadStatus.SUCCESSFUL), and
* not artifacts already in cache or used at their original location.
* </p>
*
*
* @return The total size of downloaded artifacts, in bytes.
*/
public long getDownloadSize() {
@ -319,7 +323,7 @@ public class ResolveReport {
/**
* Get every configuration which extends the specified one. The returned list also includes the
* specified one.
*
*
* @param extended String
* @return String[]
*/

View File

@ -132,7 +132,16 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* After the call node may be discarded. To avoid using discarded node, make sure to get the
* real node after the call IvyNode node = ... node.loadData(); node = node.getRealNode(); ...
* real node after the call
* <code>IvyNode node = ... node.loadData(); node = node.getRealNode(); ...</code>
*
* @param rootModuleConf String
* @param parent IvyNode
* @param parentConf String
* @param conf String
* @param shouldBePublic boolean
* @param usage IvyNodeUsage
* @return boolean
*/
public boolean loadData(String rootModuleConf, IvyNode parent, String parentConf, String conf,
boolean shouldBePublic, IvyNodeUsage usage) {
@ -312,7 +321,7 @@ public class IvyNode implements Comparable<IvyNode> {
* Load the dependencies of the current node
* <p>
* The resulting collection of nodes may have some configuration to load
*
*
* @param rootModuleConf
* the requested configuration of the root module
* @param conf
@ -515,7 +524,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* returns the required configurations from the given node
*
*
* @param in IvyNode
* @param inConf ditto
* @return array of configuration names
@ -537,7 +546,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* returns all the current required configurations of the node
*
*
* @return array of configuration names
*/
public String[] getRequiredConfigurations() {
@ -564,7 +573,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the configurations of the dependency required in a given root module configuration.
*
*
* @param rootModuleConf String
* @return array of configuration names
*/
@ -620,7 +629,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the root module configurations in which this dependency is required
*
*
* @return array of configuration names
*/
public String[] getRootModuleConfigurations() {
@ -630,7 +639,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the root module configurations in which this dependency is required
*
*
* @return {@link Set} of configuration names
*/
public Set<String> getRootModuleConfigurationsSet() {
@ -675,7 +684,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Finds and returns a path in callers from the given module id to the current node
*
*
* @param from
* the module id to start the path from
* @return a collection representing the path, starting with the from node, followed by the list
@ -707,7 +716,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Update data in this node from data of the given node, for the given root module
* configuration.
*
*
* @param node
* the source node from which data should be copied
* @param rootModuleConf
@ -748,7 +757,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns all the artifacts of this dependency required in all the root module configurations
*
*
* @return array of {@link Artifact}s
*/
public Artifact[] getAllArtifacts() {
@ -762,7 +771,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns all the artifacts of this dependency required in the root module configurations in
* which the node is not evicted nor blacklisted
*
*
* @param artifactFilter Filter
* @return array of {@link Artifact}s
*/
@ -780,7 +789,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the artifacts of this dependency required in the configurations themselves required
* in the given root module configuration
*
*
* @param rootModuleConf String
* @return array of {@link Artifact}s
*/
@ -995,7 +1004,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the last modified timestamp of the module represented by this Node, or 0 if the last
* modified timestamp is currently unknown (module not loaded)
*
*
* @return the last modified timestamp of the module represented by this Node
*/
public long getLastModified() {
@ -1085,7 +1094,13 @@ public class IvyNode implements Comparable<IvyNode> {
// EVICTION MANAGEMENT
// /////////////////////////////////////////////////////////////////////////////
/** A copy of the set of resolved nodes (real nodes) */
/**
* A copy of the set of resolved nodes (real nodes)
*
* @param moduleId ditto
* @param rootModuleConf String
* @return Set&lt;IvyNode&gt;
*/
public Set<IvyNode> getResolvedNodes(ModuleId moduleId, String rootModuleConf) {
return eviction.getResolvedNodes(moduleId, rootModuleConf);
}
@ -1190,7 +1205,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns a collection of Nodes in conflict for which conflict has been detected but conflict
* resolution hasn't been done yet
*
*
* @param rootModuleConf ditto
* @param mid
* the module id for which pending conflicts should be found
@ -1217,7 +1232,7 @@ public class IvyNode implements Comparable<IvyNode> {
* implementation which use a best effort strategy to find compatible dependency set, like
* {@link LatestCompatibleConflictManager}
* </p>
*
*
* @param bdata
* the root module configuration in which the node should be blacklisted
*/
@ -1255,10 +1270,10 @@ public class IvyNode implements Comparable<IvyNode> {
* <p>
* A blacklisted node should be considered as if it doesn't even exist on the repository.
* </p>
*
*
* @param rootModuleConf
* the root module conf for which we'd like to know if the node is blacklisted
*
*
* @return true if this node is blacklisted int he given root module conf, false otherwise
* @see #blacklist(IvyNodeBlacklist)
*/
@ -1268,7 +1283,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Indicates if this node has been blacklisted in all root module configurations.
*
*
* @return true if this node is blacklisted in all root module configurations, false otherwise
* @see #blacklist(IvyNodeBlacklist)
*/
@ -1287,7 +1302,7 @@ public class IvyNode implements Comparable<IvyNode> {
/**
* Returns the blacklist data of this node in the given root module conf, or <code>null</code>
* if this node is not blacklisted in this root module conf.
*
*
* @param rootModuleConf
* the root module configuration to consider
* @return the blacklist data if any
@ -1308,7 +1323,7 @@ public class IvyNode implements Comparable<IvyNode> {
* given root module conf which has a dependency descriptor with transitive == true, then it
* returns true. Otherwise it returns false.
* </p>
*
*
* @param rootModuleConf
* the root module configuration to consider
* @return true if there is any merged usage with transitive dd, false otherwise.

View File

@ -154,6 +154,7 @@ public class IvyNodeCallers {
* @param rootModuleConf ditto
* @param callerNode IvyNode
* @param callerConf ditto
* @param requestedConf ditto
* @param dependencyConfs
* '*' must have been resolved
* @param dd
@ -251,7 +252,7 @@ public class IvyNodeCallers {
/**
* Returns true if ALL callers exclude the given artifact in the given root module conf
*
*
* @param rootModuleConf ditto
* @param artifact Artifact
* @return boolean

View File

@ -54,7 +54,7 @@ public class IvyNodeEviction {
/**
* Creates a new object containing the eviction data of an {@link IvyNode}.
*
*
* @param rootModuleConf
* the root module configuration
* @param parent
@ -73,7 +73,7 @@ public class IvyNodeEviction {
/**
* Creates a new object containing the eviction data of an {@link IvyNode}.
*
*
* @param rootModuleConf
* the root module configuration
* @param parent
@ -197,6 +197,8 @@ public class IvyNodeEviction {
}
/**
* @param mid ModuleId
* @param rootModuleConf String
* @return A copy of the set of resolved nodes (real nodes)
*/
public Set<IvyNode> getResolvedNodes(ModuleId mid, String rootModuleConf) {
@ -337,7 +339,7 @@ public class IvyNodeEviction {
/**
* Returns null if this node has only be evicted transitively, or the the collection of selected
* nodes if it has been evicted by other selected nodes
*
*
* @return Collection&lt;IvyNode&gt;
*/
public Collection<IvyNode> getAllEvictingNodes() {
@ -385,7 +387,7 @@ public class IvyNodeEviction {
* Returns the eviction data for this node if it has been previously evicted in the root, null
* otherwise (if it hasn't been evicted in root) for the given rootModuleConf. Note that this
* method only works if conflict resolution has already be done in all the ancestors.
*
*
* @param rootModuleConf ditto
* @param ancestor IvyNode
* @return EvictionData

View File

@ -76,7 +76,7 @@ import org.apache.ivy.util.filter.Filter;
* {@link #resolve(URL)} which allow to simply resolve dependencies of a single module descriptor,
* or more complete one, like the {@link #resolve(ModuleDescriptor, ResolveOptions)} which allows to
* provide options to the resolution engine.
*
*
* @see ResolveOptions
*/
public class ResolveEngine {
@ -92,7 +92,7 @@ public class ResolveEngine {
/**
* Constructs a ResolveEngine.
*
*
* @param settings
* the settings to use to configure the engine. Must not be null.
* @param eventManager
@ -112,7 +112,7 @@ public class ResolveEngine {
/**
* Returns the currently configured dictator resolver, which when non null is used in place of
* any specified resolver in the {@link IvySettings}
*
*
* @return the currently configured dictator resolver, may be null.
*/
public DependencyResolver getDictatorResolver() {
@ -122,7 +122,7 @@ public class ResolveEngine {
/**
* Sets a dictator resolver, which is used in place of regular dependency resolver for
* subsequent dependency resolution by this engine.
*
*
* @param dictatorResolver
* the dictator resolver to use in this engine, null if regular settings should used
*/
@ -142,6 +142,13 @@ public class ResolveEngine {
/**
* Resolves the module identified by the given mrid with its dependencies if transitive is set
* to true.
*
* @param mrid ModuleRevisionId
* @param options ResolveOptions
* @param changing boolean
* @return ResolveReport
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public ResolveReport resolve(final ModuleRevisionId mrid, ResolveOptions options,
boolean changing) throws ParseException, IOException {
@ -176,6 +183,12 @@ public class ResolveEngine {
/**
* Resolve dependencies of a module described by an ivy file.
*
* @param ivySource URL
* @param options ResolveOptions
* @return ResolveReport
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public ResolveReport resolve(URL ivySource, ResolveOptions options) throws ParseException,
IOException {
@ -197,6 +210,11 @@ public class ResolveEngine {
/**
* Resolve dependencies of a module described by a module descriptor.
* @param md ModuleDescriptor
* @param options ResolveOptions
* @return ResolveReport
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public ResolveReport resolve(ModuleDescriptor md, ResolveOptions options)
throws ParseException, IOException {
@ -434,9 +452,10 @@ public class ResolveEngine {
* It is possible to track the progression of the download using classical ivy progress
* monitoring feature (see addTransferListener).
* </p>
*
*
* @param artifact
* the artifact to download
* @param options DownloadOptions
* @return a report concerning the download
* @see #download(ArtifactOrigin, DownloadOptions)
*/
@ -449,7 +468,7 @@ public class ResolveEngine {
/**
* Locates an artifact in dependency resolvers, and return its location if it can be located and
* actually exists, or an unknown {@link ArtifactOrigin} in other cases.
*
*
* @param artifact
* the artifact to locate.
* @return the artifact location, should be tested with
@ -475,9 +494,10 @@ public class ResolveEngine {
* It is possible to track the progression of the download using classical ivy progress
* monitoring feature (see addTransferListener).
* </p>
*
*
* @param origin
* the artifact origin to materialize
* @param options DownloadOptions
* @return a report concerning the download
* @see #download(Artifact, DownloadOptions)
* @see #locate(Artifact)
@ -492,7 +512,7 @@ public class ResolveEngine {
* Resolve the dependencies of a module without downloading corresponding artifacts. The module
* to resolve is given by its ivy file URL. This method requires appropriate configuration of
* the ivy instance, especially resolvers.
*
*
* @param ivySource
* url of the ivy file to use for dependency resolving
* @param options
@ -517,7 +537,7 @@ public class ResolveEngine {
* <p>
* The <code>IvyNode</code>s are ordered from the most dependent to the less dependent, so that
* an IvyNode is always found in the list after all IvyNode depending directly on it.
*
*
* @param md
* the descriptor of the module for which we want to get dependencies - must not be
* null
@ -817,7 +837,7 @@ public class ResolveEngine {
/**
* Returns true if we've already fetched the dependencies for this node and configuration
*
*
* @param node
* node to check
* @param conf
@ -847,11 +867,12 @@ public class ResolveEngine {
/**
* Resolves conflict for the given node in the given ancestor. This method do conflict
* resolution in ancestor parents recursively, unless not necessary.
*
*
* @param node
* the node for which conflict resolution should be done
* @param ancestor
* the ancestor in which the conflict resolution should be done
* @param conf String
* @param toevict
* a collection of IvyNode to evict (as computed by conflict resolution in
* descendants of ancestor)
@ -1033,7 +1054,7 @@ public class ResolveEngine {
/**
* Compute possible conflicts for a node, in the context of an ancestor (a node which has a
* dependency - direct or indirect - on the node for which conflicts should be computed.
*
*
* @param node
* the node for which conflicts should be computed
* @param ancestor
@ -1159,7 +1180,7 @@ public class ResolveEngine {
* The mediated dependency descriptor must return the actually requested module revision id when
* the method {@link DependencyDescriptor#getDependencyRevisionId()} is called.
* </p>
*
*
* @param dd
* the dependency descriptor for which the requested module revision id should be
* returned

View File

@ -29,7 +29,7 @@ import org.apache.ivy.util.filter.FilterHelper;
/**
* A set of options used during resolve related tasks
*
*
* @see ResolveEngine
*/
public class ResolveOptions extends LogOptions {
@ -153,7 +153,7 @@ public class ResolveOptions extends LogOptions {
/**
* Returns the resolve mode to use, or <code>null</code> to use settings configured resolve
* mode.
*
*
* @return the resolve mode to use.
*/
public String getResolveMode() {
@ -169,7 +169,8 @@ public class ResolveOptions extends LogOptions {
* Indicates if the configurations use a special configuration * , *(private) or *(public). When
* special configurations are used, you must have the module descriptor in order to get the list
* of configurations.
*
*
* @return boolean
* @see #getConfs()
* @see #getConfs(ModuleDescriptor)
*/
@ -185,6 +186,7 @@ public class ResolveOptions extends LogOptions {
/**
* @pre can only be called if useSpecialConfs()==false. When it is true, you have to provide a
* module descriptor so that configurations can be resolved.
* @return String[]
* @see #getConfs(ModuleDescriptor)
*/
public String[] getConfs() {
@ -197,10 +199,11 @@ public class ResolveOptions extends LogOptions {
/**
* Get the asked confs. Special confs (like *) use the moduleDescriptor to find the values *
*
*
* @param md
* Used to get the exact values for special confs.
* */
* @return String[]
*/
public String[] getConfs(ModuleDescriptor md) {
// TODO add isInline, in that case, replace * by *(public).
return ConfigurationUtils.replaceWildcards(confs, md);

View File

@ -40,11 +40,11 @@ import org.apache.ivy.util.Checks;
* dependency graph following the dependencies, thus the same node can be visited several times, if
* it is requested from several module. In this case you will have one VisitNode per parent and per
* root module configuration. Thus VisitNode stores data specific to the visit:
* <ul>
* <li>parent</li> the node from which the visit is occurring
* <li>parentConf</li> the configuration of the parent in which this node is visited
* <li>rootModuleConf</li> the configuration of the root module which is currently resolved
* </ul>
* <dl>
* <dd>parent</dd><dt>the node from which the visit is occurring</dt>
* <dd>parentConf</dd><dt>the configuration of the parent in which this node is visited</dt>
* <dd>rootModuleConf</dd><dt>the configuration of the root module which is currently resolved</dt>
* </dl>
*/
public class VisitNode {
/**
@ -152,7 +152,7 @@ public class VisitNode {
/**
* Get an ordered collection with the nodes from the root to this node
*
*
* @return Collection&lt;VisitNode&gt;
*/
public Collection<VisitNode> getPath() {
@ -211,7 +211,7 @@ public class VisitNode {
/**
* Returns true if the current dependency descriptor is transitive and the parent configuration
* is transitive. Otherwise returns false.
*
*
* @return true if current node is transitive and the parent configuration is transitive.
*/
public boolean isTransitive() {
@ -255,7 +255,7 @@ public class VisitNode {
* resolved to an existing node in the graph, we will return the existing node, and not the one
* originally used which is about to be discarded, since it's not possible to have in the graph
* two nodes for the same ModuleRevisionId
*
*
* @return the 'real' node currently visited.
*/
public IvyNode getRealNode() {
@ -313,7 +313,7 @@ public class VisitNode {
/**
* Returns a VisitNode for the given node. The given node must be a representation of the same
* module (usually in another revision) as the one visited by this node.
*
*
* @param node
* the node to visit
* @return a VisitNode for the given node
@ -413,7 +413,7 @@ public class VisitNode {
/**
* Returns true if this node can already be found in the path
*
*
* @return boolean
*/
public boolean isCircular() {
@ -461,7 +461,7 @@ public class VisitNode {
/**
* Marks the current node as evicted by the the given selected IvyNodes, in the given parent and
* root module configuration, with the given {@link ConflictManager}
*
*
* @param parent
* the VisitNode in which eviction has been made
* @param conflictMgr

View File

@ -71,7 +71,12 @@ public class RetrieveEngine {
* localCacheDirectory to determine an ivy report file, used as input for the copy If such a
* file does not exist for any conf (resolve has not been called before ?) then an
* IllegalStateException is thrown and nothing is copied.
*
*
* @param mrid ModuleRevisionId
* @param destFilePattern String
* @param options RetrieveOptions
* @return int
* @throws IOException if something goes wrong
* @deprecated Use
* {@link #retrieve(org.apache.ivy.core.module.id.ModuleRevisionId, RetrieveOptions)}
* instead
@ -485,7 +490,7 @@ public class RetrieveEngine {
/**
* The returned comparator should consider greater the artifact which gains the conflict battle.
* This is used only during retrieve... prefer resolve conflict manager to resolve conflicts.
*
*
* @return Comparator&lt;ArtifactDownloadReport&gt;
*/
private Comparator<ArtifactDownloadReport> getConflictResolvingPolicy() {

View File

@ -38,6 +38,8 @@ public class RetrieveReport {
/**
* Returns the root directory to where the artifacts are retrieved.
*
* @return File
*/
public File getRetrieveRoot() {
return retrieveRoot;
@ -68,6 +70,8 @@ public class RetrieveReport {
/**
* Returns a collection of <tt>File</tt> objects who were actually copied during the retrieve
* process.
*
* @return Collection&lt;File&gt;
*/
public Collection<File> getCopiedFiles() {
return new ArrayList<File>(copiedFiles);
@ -76,6 +80,8 @@ public class RetrieveReport {
/**
* Returns a collection of <tt>File</tt> objects who were actually copied during the retrieve
* process.
*
* @return Collection&lt;File&gt;
*/
public Collection<File> getUpToDateFiles() {
return new ArrayList<File>(upToDateFiles);
@ -84,6 +90,8 @@ public class RetrieveReport {
/**
* Returns a collection of <tt>File</tt> objects who were retrieved during the retrieve process.
* This is the union of the files being copied and the files that were up-to-date.
*
* @return Collection&lt;File&gt;
*/
public Collection<File> getRetrievedFiles() {
Collection<File> result = new ArrayList<File>(upToDateFiles.size() + copiedFiles.size());
@ -94,6 +102,8 @@ public class RetrieveReport {
/**
* Get the mapping between the copied files and their corresponding download report
*
* @return Map&lt;File,ArtifactDownloadReport&gt;
*/
public Map<File, ArtifactDownloadReport> getDownloadReport() {
return downloadReport;

View File

@ -50,10 +50,10 @@ public class SearchEngine {
/**
* Returns an empty array when no token values are found.
*
*
* @param token
* ditto
* @param otherTokenValues
* @param otherTokenValues Map
* @return String[]
*/
public String[] listTokenValues(String token, Map<String, Object> otherTokenValues) {
@ -177,10 +177,9 @@ public class SearchEngine {
* <p>
* ModuleId are returned in the system namespace.
* </p>
*
* @param moduleCrit
* ModuleId
* @param matcher
*
* @param moduleCrit ModuleId
* @param matcher PatternMatcher
* @return ModuleId[]
*/
public ModuleId[] listModules(ModuleId moduleCrit, PatternMatcher matcher) {
@ -214,10 +213,9 @@ public class SearchEngine {
* <p>
* ModuleRevisionId are returned in the system namespace.
* </p>
*
* @param moduleCrit
* ModuleRevisionId
* @param matcher
*
* @param moduleCrit ModuleRevisionId
* @param matcher PatternMatcher
* @return ModuleRevisionId[]
*/
public ModuleRevisionId[] listModules(ModuleRevisionId moduleCrit, PatternMatcher matcher) {
@ -269,7 +267,7 @@ public class SearchEngine {
* <p>
* ModuleRevisionId are returned in the system namespace.
* </p>
*
*
* @param resolver
* the resolver in which modules should looked up
* @param moduleCrit

View File

@ -420,8 +420,8 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
* Default initialization of settings, useful when you don't want to load your settings from a
* settings file or URL, but prefer to set them manually. By calling this method you will still
* have the basic initialization done when loading settings.
*
* @throws IOException
*
* @throws IOException if something goes wrong
*/
public synchronized void defaultInit() throws IOException {
if (getVariable("ivy.default.ivy.user.dir") != null) {
@ -491,7 +491,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Sets a deprecated variable with the value of the new variable
*
*
* @param deprecatedKey
* the deprecated variable name
* @param newKey
@ -611,7 +611,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Substitute variables in the given string by their value found in the current set of variables
*
*
* @param str
* the string in which substitution should be made
* @return the string where all current ivy variables have been substituted by their value If
@ -624,7 +624,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Substitute variables in the given map values by their value found in the current set of
* variables
*
*
* @param strings
* the map of strings in which substitution should be made
* @return a new map of strings in which all current ivy variables in values have been
@ -641,7 +641,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Returns the variables loaded in configuration file. Those variables may better be seen as ant
* properties
*
*
* @return IvyVariableContainer
*/
public synchronized IvyVariableContainer getVariables() {
@ -775,6 +775,13 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* regular expressions as explained in Pattern class may be used in attributes
*
* @param attributes Map
* @param matcher PatternMatcher
* @param resolverName String
* @param branch String
* @param conflictManager String
* @param resolveMode String
*/
public synchronized void addModuleConfiguration(Map<String, String> attributes,
PatternMatcher matcher, String resolverName, String branch, String conflictManager,
@ -789,12 +796,12 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
* <p>
* If the specified file name is relative it is resolved with respect to the settings's base
* directory.
*
*
* @param fileName
* The name of the file to resolve. Must not be <code>null</code>.
*
*
* @return the resolved File.
*
*
*/
public synchronized File resolveFile(String fileName) {
return FileUtil.resolveFile(baseDir, fileName);
@ -1211,7 +1218,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Filters the names list by removing all names that should be ignored as defined by the listing
* ignore list
*
*
* @param names ditto
*/
public synchronized void filterIgnore(Collection<String> names) {
@ -1443,7 +1450,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Use a different variable container.
*
*
* @param variables IvyVariableContainer
*/
public synchronized void setVariableContainer(IvyVariableContainer variables) {
@ -1490,7 +1497,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Validates the settings, throwing an {@link IllegalStateException} if the current state is not
* valid.
*
*
* @throws IllegalStateException
* if the settings is not valid.
*/
@ -1508,7 +1515,7 @@ public class IvySettings implements SortEngineSettings, PublishEngineSettings, P
/**
* Validates all {@link Validatable} objects in the collection.
*
*
* @param values
* the collection of objects to validate.
* @throws IllegalStateException

View File

@ -32,8 +32,10 @@ import org.apache.ivy.plugins.version.VersionMatcher;
/**
* Wrap a collection of descriptors wrapped themselves in ModuleInSort elements. It contains some
* dedicated function to retrieve module descriptors based on dependencies descriptors.<br>
* dedicated function to retrieve module descriptors based on dependencies descriptors.
* <p>
* <i>This class is designed to be used internally by the ModuleDescriptorSorter.</i>
* </p>
*/
class CollectionOfModulesToSort implements Iterable<ModuleInSort> {
@ -86,7 +88,7 @@ class CollectionOfModulesToSort implements Iterable<ModuleInSort> {
/**
* Find a matching module descriptor in the list of module to sort.
*
*
* @param descriptor ditto
* @return a ModuleDescriptor from the collection of module descriptors to sort. If none exists
* returns null.

View File

@ -29,10 +29,12 @@ import org.apache.ivy.plugins.version.VersionMatcher;
import org.apache.ivy.util.Message;
/**
* Inner helper class for sorting ModuleDescriptors.<br>
* Inner helper class for sorting ModuleDescriptors.
* <p>
* ModuleDescriptorSorter use CollectionOfModulesToSort to find the dependencies of the modules, and
* use ModuleInSort to store some temporary values attached to the modules to sort.
*
* </p>
*
* @see ModuleInSort
* @see CollectionOfModulesToSort
*/
@ -54,9 +56,9 @@ public class ModuleDescriptorSorter {
/**
* Iterates over all modules calling sortModuleDescriptorsHelp.
*
*
* @return sorted module
* @throws CircularDependencyException
* @throws CircularDependencyException somehow
*/
public List<ModuleDescriptor> sortModuleDescriptors() throws CircularDependencyException {
Message.debug("Nbr of module to sort : " + moduleDescriptors.size());
@ -73,10 +75,10 @@ public class ModuleDescriptorSorter {
* When a loop is detected by a recursive call, the moduleDescriptors are not added immediately
* added to the sorted list. They are added as loop dependencies of the root, and will be added
* to the sorted list only when the root itself will be added.
*
*
* @param current
* Current module to add to sorted list.
* @throws CircularDependencyException
* @throws CircularDependencyException somehow
*/
private void sortModuleDescriptorsHelp(ModuleInSort current, ModuleInSort caller)
throws CircularDependencyException {

View File

@ -31,18 +31,21 @@ import org.apache.ivy.util.Message;
/**
* Decorates a ModuleDescriptor with some attributes used during the sort. Thus every instance of a
* ModuleInSort can be used in only one ModuleDescriptorSorter at a time.<br>
* The added fields are : <br>
* ModuleInSort can be used in only one ModuleDescriptorSorter at a time.
* <p>
* The added fields are:
* </p>
* <ul>
* <li><code>isSorted</code> : is true iff this module has already been added to the sorted list.
* </li>
* <li><code>isSorted</code> : is true iff this module has already been added to the sorted
* list.</li>
* <li><code>loopElements</code> : When the module is the root of a loop (=the first element of a
* loop met during the sort), <code>loopElements</code> contains all ModuleInSort of the loop
* (excluding the root itself.</li>
* <li><code>isLoopIntermediateElement</code> : When a loop is detected, all modules included in the
* loop (except the root) have <code>isLoopIntermediateElement</code> set to true.</li>
* <li><code>caller</code> : During the sort, we traverse recursively the graph. When doing that,
* caller point to the parent element.
* caller point to the parent element.</li>
* </ul>
*/
class ModuleInSort {
@ -103,7 +106,7 @@ class ModuleInSort {
* dependency. If it is, all the elements of the loop are flagged as 'loopIntermediateElement',
* and the loopElements of this module (which is the root of the loop) is updated. The
* depStrategy is invoked on order to report a correct circular loop message.
*
*
* @param futurCaller ModuleInSort
* @param depStrategy CircularDependencyStrategy
* @return true if a loop is detected.
@ -130,7 +133,7 @@ class ModuleInSort {
* Add this module to the sorted list except if this module is an intermediary element of a
* loop. If this module is the 'root' of a loop, then all elements of that loops are added
* before.
*
*
* @param sorted
* The list of sorted elements on which this module will be added
*/

View File

@ -77,11 +77,14 @@ public class BundleInfoAdapter {
}
/**
*
* @param parser ModuleDescriptorParser
* @param baseUri
* uri to help build the absolute url if the bundle info has a relative uri.
* @param bundle BundleInfo
* @param manifest Manifest
* @param profileProvider ExecutionEnvironmentProfileProvider
* @return DefaultModuleDescriptor ditto
* @throws ProfileNotFoundException
* @throws ProfileNotFoundException if descriptor is not found
*/
public static DefaultModuleDescriptor toModuleDescriptor(ModuleDescriptorParser parser,
URI baseUri, BundleInfo bundle, Manifest manifest,

View File

@ -107,7 +107,7 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
/**
* Return an sort of identifier of the current element being parsed. It will only be used for
* logging purpose.
*
*
* @return an empty string by default
*/
protected String getCurrentElementIdentifier() {
@ -160,10 +160,11 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @throws SAXException API told me so
*/
protected void doStartDocument() throws SAXException {
// by default do nothing
}
@Override
@ -179,10 +180,11 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @throws SAXException API told me so
*/
protected void doEndDocument() throws SAXException {
// by default do nothing
}
@Override
@ -231,23 +233,27 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* Called when the expected node is achieved
*
* Called when the expected node is achieved; nothing to do by default.
*
* @param atts
* the xml attributes attached to the expected node
* @exception SAXException
* in case the parsing should be completely stopped
*/
protected void handleAttributes(Attributes atts) throws SAXException {
// nothing to do by default
}
/**
* @throws SAXException
* By default do nothing.
*
* @param uri String
* @param localName String
* @param name String
* @param atts Attributes
* @throws SAXException API told me so
*/
protected void doStartElement(String uri, String localName, String name, Attributes atts)
throws SAXException {
// by default do nothing
}
@Override
@ -284,10 +290,14 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param uri String
* @param localName String
* @param name String
* @throws SAXException API told me so
*/
protected void doEndElement(String uri, String localName, String name) throws SAXException {
// by default do nothing
}
public static abstract class ChildElementHandler<DH extends DelegatingHandler> {
@ -315,7 +325,10 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* @param ch char[]
* @param start int
* @param length int
* @throws SAXException if something goes wrong
*/
protected void doCharacters(char[] ch, int start, int length) throws SAXException {
if (bufferingChar) {
@ -336,10 +349,13 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param prefix String
* @param uri String
* @throws SAXException API told me so
*/
protected void doStartPrefixMapping(String prefix, String uri) throws SAXException {
// by default do nothing
}
@Override
@ -355,10 +371,12 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param prefix String
* @throws SAXException API told me so
*/
protected void doEndPrefixMapping(String prefix) throws SAXException {
// by default do nothing
}
@Override
@ -374,10 +392,14 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing
*
* @param ch char[]
* @param start int
* @param length int
* @throws SAXException API told me so
*/
protected void doIgnorableWhitespace(char[] ch, int start, int length) throws SAXException {
// by default do nothing
}
@Override
@ -394,11 +416,15 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param name String
* @param publicId String
* @param systemId String
* @throws SAXException API told me so
*/
protected void doNotationDecl(String name, String publicId, String systemId)
throws SAXException {
// by default do nothing
}
@Override
@ -414,10 +440,13 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing
*
* @param target String
* @param data String
* @throws SAXException API told me so
*/
protected void doProcessingInstruction(String target, String data) throws SAXException {
// by default do nothing
}
@Override
@ -433,10 +462,12 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param name String
* @throws SAXException API told me so
*/
protected void doSkippedEntity(String name) throws SAXException {
// by default do nothing
}
@Override
@ -453,11 +484,16 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param name String
* @param publicId String
* @param systemId String
* @param notationName String
* @throws SAXException API told me so
*/
protected void doUnparsedEntityDecl(String name, String publicId, String systemId,
String notationName) throws SAXException {
// by default do nothing
}
// ERROR HANDLING
@ -475,10 +511,12 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param exception SAXParseException
* @throws SAXException API told me so
*/
protected void doWarning(SAXParseException exception) throws SAXException {
// by default do nothing
}
@Override
@ -494,10 +532,12 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param exception SAXParseException
* @throws SAXException API told me so
*/
protected void doError(SAXParseException exception) throws SAXException {
// by default do nothing
}
@Override
@ -513,10 +553,12 @@ public class DelegatingHandler extends DefaultHandler implements DTDHandler, Con
}
/**
* @throws SAXException
* By default do nothing.
*
* @param exception SAXParseException
* @throws SAXException API told me so
*/
protected void doFatalError(SAXParseException exception) throws SAXException {
// by default do nothing
}
// //////////////////////

View File

@ -34,7 +34,7 @@ public final class CircularDependencyHelper {
/**
* Returns a string representation of this circular dependency graph
*
*
* @param mrids
* in order of circular dependency
* @return a string representation of this circular dependency graph
@ -62,7 +62,8 @@ public final class CircularDependencyHelper {
/**
* @param loopElements
* a List<ModuleDescriptor>
* a List&lt;ModuleDescriptor&gt;
* @return String
*/
public static String formatMessageFromDescriptors(List loopElements) {
ModuleRevisionId[] mrids = new ModuleRevisionId[loopElements.size()];

View File

@ -46,17 +46,17 @@ import org.apache.ivy.util.Message;
* set of compatible dependencies, even if it requires stepping back to older revisions (as long as
* they are in the set of compatibility).
* <p>
* Here is an example of what this conflict manager is able to do:<br/>
* Here is an example of what this conflict manager is able to do:
* </p>
* <b>Available Modules</b>:
*
* <pre>
* #A;2-&gt;{ #B;[1.0,1.5] #C;[2.0,2.5] }
* #B;1.4-&gt;#D;1.5
* #B;1.5-&gt;#D;2.0
* #C;2.5-&gt;#D;[1.0,1.6]
* </pre>
*
* <b>Result</b>: #B;1.4, #C;2.5, #D;1.5<br/>
* <b>Result</b>: #B;1.4, #C;2.5, #D;1.5
* <p>
* <b>Details</b>The conflict manager finds that the latest matching version of #B (1.5) depends on
* a version of #D incompatible with what is expected by the latest matching version of #C. Hence
* the conflict manager blacklists #B;1.5, and the version range [1.0,1.5] is resolved again to end
@ -126,7 +126,7 @@ public class LatestCompatibleConflictManager extends LatestConflictManager {
* Handles an incompatible conflict
* <p>
* An incompatible conflicts is handled with this pseudo algorithm:
*
*
* <pre>
* take latest among two nodes in conflict
* for all callers
@ -139,9 +139,9 @@ public class LatestCompatibleConflictManager extends LatestConflictManager {
* else
* throw strict conflict exception
* </pre>
*
*
* </p>
*
*
* @param parent
* the parent node of nodes in conflict
* @param conflicts
@ -238,7 +238,7 @@ public class LatestCompatibleConflictManager extends LatestConflictManager {
/**
* Tries to blacklist exactly one version for all callers paths.
*
*
* @param versionMatcher
* the version matcher to use to interpret versions
* @param conflictParent

View File

@ -22,8 +22,8 @@ import java.util.List;
/**
* A strategy which delegate to another strategy, unless for the latest and working revisions which
* are considered as superior to any other revision. < br/>
* NB : it is for internal usage of Ivy only!
* are considered as superior to any other revision.
* <p>NB : it is for internal usage of Ivy only!</p>
*/
public class WorkspaceLatestStrategy extends AbstractLatestStrategy {

View File

@ -139,12 +139,12 @@ public abstract class FileBasedLockStrategy extends AbstractLockStrategy {
/**
* Determine the state of the lockfile.
*
*
* Must be called from within a synchronized block.
*
*
* Three possibilities exist: - The lock is held by the current thread (>0) - The lock is held
* by one or more different threads (-1) - The lock is not held at all (0).
*
*
* @param file
* file to lock
* @param forThread
@ -169,10 +169,10 @@ public abstract class FileBasedLockStrategy extends AbstractLockStrategy {
/**
* Record that this thread holds the lock.
*
*
* Asserts that the lock has been previously grabbed by this thread. Must be called from a
* synchronized block in which the lock was grabbed.
*
*
* @param file
* file which has been locked
* @param forThread
@ -193,11 +193,11 @@ public abstract class FileBasedLockStrategy extends AbstractLockStrategy {
/**
* Decrease depth of this thread's lock.
*
*
* Must be called within a synchronized block.
*
*
* If this returns 0, the caller is responsible for releasing the lock within that same block.
*
*
* @param file
* file for which lock depth is being decreased
* @param forThread
@ -225,6 +225,9 @@ public abstract class FileBasedLockStrategy extends AbstractLockStrategy {
/**
* Return a string naming the threads which currently hold this lock.
*
* @param file File
* @return String
*/
protected String getCurrentLockHolderNames(File file) {
StringBuilder sb = new StringBuilder();

View File

@ -28,10 +28,11 @@ import org.apache.ivy.core.module.descriptor.Artifact;
* Note that some implementations may actually choose to NOT perform locking, when no lock is
* necessary (cache not shared). Some other implementations may choose to lock the cache for the
* download of a whole module (not possible yet), or at the artifact level.
* <p>
* </p>
* <p>
* The lock methods should return true when the lock is either actually acquired or not performed by
* the strategy. </p>
* the strategy.
* </p>
* <p>
* Locking used in the locking strategy must support reentrant lock. Reentrant locking should be
* performed for the whole strategy.
@ -41,14 +42,14 @@ public interface LockStrategy {
/**
* Returns the name of the strategy
*
*
* @return the name of the strategy
*/
String getName();
/**
* Performs a lock before downloading the given {@link Artifact} to the given file.
*
*
* @param artifact
* the artifact about to be downloaded
* @param artifactFileToDownload
@ -62,7 +63,7 @@ public interface LockStrategy {
/**
* Release the lock acquired for an artifact download.
*
*
* @param artifact
* the artifact for which the lock was acquired
* @param artifactFileToDownload

View File

@ -20,11 +20,12 @@ package org.apache.ivy.plugins.matcher;
/**
* A pattern matcher that tries to match exactly the input with the expression, or match it as a
* pattern.
* <p/>
* <p>
* The evaluation for matching is perform first by checking if expression and input are equals (via
* equals method) else it attempts to do it by trying to match the input using the expression as a
* regexp.
*
* </p>
*
* @see ExactPatternMatcher
* @see RegexpPatternMatcher
*/

View File

@ -19,9 +19,10 @@ package org.apache.ivy.plugins.matcher;
/**
* Implementation of an exact matcher.
* <p/>
* <p>
* The matching will be performed against an expression being a string. It will only matches if both
* strings are equal (per equals()) rule or if both strings are null.
* </p>
*/
public/* @Immutable */final class ExactPatternMatcher extends AbstractPatternMatcher {

View File

@ -30,10 +30,12 @@ import org.apache.oro.text.regex.Perl5Matcher;
* <li>* - Matches zero or more characters</li>
* <li>? - Matches exactly one character.</li>
* </ul>
* <p/>
* <b> Note that this matcher is available only with <a href="http://jakarta.apache.org/oro"Apache
* Jakarta Oro 2.0.8</a> in your classpath.</b>
*
* <p>
* NOTE: this matcher is available only with
* <a href="http://jakarta.apache.org/oro">Apache Jakarta Oro 2.0.8</a>
* in your classpath.
* </p>
*
* @see <a href="http://jakarta.apache.org/oro/api/org/apache/oro/text/GlobCompiler.html">GlobCompiler</a>
*/
public/* @Immutable */final class GlobPatternMatcher extends AbstractPatternMatcher {

View File

@ -19,9 +19,10 @@ package org.apache.ivy.plugins.matcher;
/**
* Interface for a pattern matcher.
* <p/>
* <p>
* The pattern matcher is the main abstraction regarding the matching of an expression.
* Implementation may vary depending on the expression syntax handling that is desired.
* </p>
*/
public interface PatternMatcher {
@ -52,7 +53,7 @@ public interface PatternMatcher {
/**
* Return the matcher for the given expression.
*
*
* @param expression
* the expression to be matched. Cannot be null ?
* @return the matcher instance for the given expression. Never null.
@ -61,7 +62,7 @@ public interface PatternMatcher {
/**
* return the name of this pattern matcher
*
*
* @return the name of this pattern matcher. Never null.
* @see #EXACT
* @see #REGEXP

View File

@ -39,8 +39,12 @@ public interface ModuleDescriptorParser {
* Convert a module descriptor to an ivy file. This method MUST close the given input stream
* when job is finished
*
* @param is
* input stream with opened on original module descriptor resource
* @param is input stream with opened on original module descriptor resource
* @param res Resource
* @param destFile File
* @param md ModuleDescriptor
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
throws ParseException, IOException;

View File

@ -55,7 +55,7 @@ public interface ParserSettings {
String getDefaultBranch(ModuleId moduleId);
/**
* Returns the namespace context in which the current descriptor is parsed.
* @return the namespace context in which the current descriptor is parsed.
*/
Namespace getContextNamespace();

View File

@ -59,11 +59,13 @@ import org.xml.sax.SAXException;
/**
* A parser for Maven 2 POM.
* <p>
* The configurations used in the generated module descriptor mimics the behavior defined by maven 2
* scopes, as documented here:<br/>
* http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html The
* PomModuleDescriptorParser use a PomDomReader to read the pom, and the PomModuleDescriptorBuilder
* to write the ivy module descriptor using the info read by the PomDomReader.
* The configurations used in the generated module descriptor mimics the behavior defined by Maven 2
* scopes, as documented
* <a href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html">here</a>.
* The PomModuleDescriptorParser use a PomDomReader to read the pom, and the
* PomModuleDescriptorBuilder to write the ivy module descriptor using the info read by the
* PomDomReader.
* </p>
*/
public final class PomModuleDescriptorParser implements ModuleDescriptorParser {

View File

@ -156,6 +156,9 @@ public class PomReader {
* Add a property if not yet set and value is not null. This guarantees
* that property keeps the first value that is put on it and that the
* properties are never null.
*
* @param prop String
* @param val String
*/
public void setProperty(String prop, String val) {
if (!properties.containsKey(prop) && val != null) {

View File

@ -107,8 +107,8 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
* the real resource to parse, used for log only
* @param validate boolean
* @return ModuleDescriptor
* @throws ParseException
* @throws IOException
* @throws ParseException if something goes wrong
* @throws IOException if something goes wrong
*/
public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL xmlURL, Resource res,
boolean validate) throws ParseException, IOException {
@ -136,7 +136,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
* <p>
* Override this method if you want to use a custom Parser.
* </p>
*
*
* @param ivySettings
* the settings to use during parsing
* @return the Parser instance used for parsing Ivy files
@ -396,7 +396,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Default parent location to check (for dev ONLY)
*
*
* @return a relative path to a parent module descriptor
*/
protected String getDefaultParentLocation() {
@ -411,9 +411,9 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
* <li>cache to find a resolved parent descriptor</li>
* <li>ask repositories to retrieve the parent module descriptor</li>
* </ul>
*
*
* @param attributes Attributes
* @throws ParseException
* @throws ParseException if something goes wrong
*/
protected void extendsStarted(Attributes attributes) throws ParseException {
String parentOrganisation = settings.substitute(attributes.getValue("organisation"));
@ -482,7 +482,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Merge current module with a given module descriptor and specify what should be inherited
* through extendTypes argument
*
*
* @param extendTypes
* specify what should be inherited
* @param parent
@ -521,7 +521,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Merge everything from a given parent
*
*
* @param parent
* a given parent module descriptor
*/
@ -536,7 +536,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Explain how to inherit metadata related to info element
*
*
* @param parent
* a given parent module descriptor
*/
@ -589,7 +589,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describes how to merge configurations elements
*
*
* @param parent
* the module descriptor
*/
@ -612,7 +612,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describes how dependencies should be inherited
*
*
* @param dependencies
* array of dependencies to inherit
*/
@ -628,7 +628,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describes how to merge description
*
*
* @param description
* description going to be inherited
*/
@ -641,7 +641,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describes how to merge licenses
*
*
* @param licenses
* licenses going to be inherited
*/
@ -653,7 +653,7 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describes how to merge exclude rules
*
*
* @param excludeRules
* exclude rules going to be inherited
*/
@ -665,11 +665,11 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Returns the parent module using the location attribute (for dev purpose).
*
*
* @param location
* a given location
* @throws IOException
* @throws ParseException
* @throws IOException if something goes wrong
* @throws ParseException if something goes wrong
*/
private ModuleDescriptor parseParentModuleOnFilesystem(String location) throws IOException,
ParseException {
@ -702,12 +702,12 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
/**
* Describe how to parse a {@link ModuleDescriptor} by asking repositories
*
*
* @param parentMrid
* a given {@link ModuleRevisionId} to find
* @return a {@link ModuleDescriptor} if found. Return null if no {@link ModuleDescriptor}
* was found
* @throws ParseException
* @throws ParseException if something goes wrong
*/
protected ModuleDescriptor parseOtherIvyFile(ModuleRevisionId parentMrid)
throws ParseException {
@ -911,11 +911,12 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
String branch = settings.substitute(attributes.getValue("branch"));
String branchConstraint = settings.substitute(attributes.getValue("branchConstraint"));
// if (branchConstraint == null) {
// // there was no branch constraint before, so we should
// // set the branchConstraint to the current default branch
// branchConstraint = settings.getDefaultBranch(ModuleId.newInstance(org, name));
// }
/* if (branchConstraint == null) {
* // there was no branch constraint before, so we should
* // set the branchConstraint to the current default branch
* branchConstraint = settings.getDefaultBranch(ModuleId.newInstance(org, name));
* }
*/
String rev = settings.substitute(attributes.getValue("rev"));
String revConstraint = settings.substitute(attributes.getValue("revConstraint"));
@ -1167,15 +1168,12 @@ public class XmlModuleDescriptorParser extends AbstractModuleDescriptorParser {
protected void addConfiguration(String c) {
confAware.addConfiguration(c);
if (state == State.EXCLUDE) {
// we are adding a configuration to a module wide exclude rule
// we have nothing special to do here, the rule has already been added to the module
// descriptor
// we are adding a configuration to a module wide exclude rule we have nothing
// special to do here, the rule has already been added to the module descriptor
} else {
// we are currently adding a configuration to either an include, exclude or artifact
// element
// of a dependency. This means that we have to add this element to the corresponding
// conf
// of the current dependency descriptor
// element of a dependency. This means that we have to add this element to the
// corresponding conf of the current dependency descriptor
if (confAware instanceof DependencyArtifactDescriptor) {
dd.addDependencyArtifact(c, (DependencyArtifactDescriptor) confAware);
} else if (confAware instanceof IncludeRule) {

View File

@ -84,11 +84,15 @@ public final class XmlModuleDescriptorUpdater {
/**
* used to copy a module descriptor xml file (also known as ivy file) and update the revisions
* of its dependencies, its status and revision
*
*
* @param srcURL
* the url of the source module descriptor file
* @param destFile
* The file to which the updated module descriptor should be output
* @param options
* UpdateOptions
* @throws IOException if something goes wrong
* @throws SAXException if something goes wrong
*/
public static void update(URL srcURL, File destFile, UpdateOptions options) throws IOException,
SAXException {
@ -932,7 +936,7 @@ public final class XmlModuleDescriptorUpdater {
/**
* Write XML elements that do not appear in the source descriptor, but have been copied in
* from a parent module descriptor via &lt;extends&gt; declaration.
*
*
* @param merged
* child descriptor containing the merged data
* @param items
@ -1003,7 +1007,7 @@ public final class XmlModuleDescriptorUpdater {
* Collect the given list of inherited descriptor items into lists keyed by parent Id. Thus
* all of the items inherited from parent A can be written together, then all of the items
* from parent B, and so on.
*
*
* @param merged
* the merged child descriptor
* @param items
@ -1077,13 +1081,13 @@ public final class XmlModuleDescriptorUpdater {
* elements like "configurations" and "dependencies" appear in the parent descriptor, but
* are completely missing in the child descriptor.
* </p>
*
*
* <p>
* For example, if "moduleElement" is "dependencies", guarantees that "configurations" has
* been written. If <code>moduleElement</code> is <code>null</code>, then all missing merged
* elements will be flushed.
* </p>
*
*
* @param moduleElement
* a descriptor element name, for example "configurations" or "info"
*/
@ -1312,12 +1316,13 @@ public final class XmlModuleDescriptorUpdater {
protected static interface ItemPrinter {
/**
* Print an XML representation of <code>item</code> to <code>out</code>.
*
*
* @param parent
* the module descriptor containing <code>item</code>
* @param item
* subcomponent of the descriptor, for example a {@link DependencyDescriptor} or
* {@link Configuration}
* @param out PrintWriter
*/
public void print(ModuleDescriptor parent, Object item, PrintWriter out);
}

View File

@ -322,6 +322,8 @@ public class XmlReportParser {
/**
* Returns the <tt>ModuleRevisionId</tt> of the resolved module.
*
* @return ModuleRevisionId
*/
public ModuleRevisionId getResolvedModule() {
return parser.getResolvedModule();

View File

@ -26,28 +26,19 @@ import org.apache.ivy.core.module.descriptor.Artifact;
/**
* Represents a collection of resources available to Ivy. Ivy uses one or more repositories as both
* a source of resources for Ivy enabled build systems and as a distribution center for resources
* generated by Ivy enabled build systems. </p>
* <p>
* A repository supports the following fundamental operations
* generated by Ivy enabled build systems.
* <p>A repository supports the following fundamental operations</p>
* <ul>
* <li>retrieving a resource from the repository.</li>
* <li>transferring a resource to the repository.</li>
* <li>retrieving a listing of resources.</li>
* </ul>
* </p>
* <h4>Resource Retrieval</h4> </p>
* <p>
* {@link #get} retrieves a resource specified by a provided identifier creating a new file .
* </p>
* </p> <h4>resource Publication</h4> </p>
* <p>
* {@link #put} transfers a file to the repository.
* </p>
* </p> <h4>resource Listing</h4> </p>
* <p>
* {@link #list} returns a listing of file like objects belonging to a specified parent directory.
* </p>
* </p>
* <h3>Resource Retrieval</h3>
* <p>{@link #get} retrieves a resource specified by a provided identifier creating a new file.</p>
* <h3>Resource Publication</h3>
* <p>{@link #put} transfers a file to the repository.</p>
* <h2>resource Listing</h2>
* <p>{@link #list} returns a listing of file like objects belonging to a specified parent directory.</p>
*/
public interface Repository {
@ -55,7 +46,7 @@ public interface Repository {
* Return the resource associated with a specified identifier. If the resource does not exist,
* it should return a Resource with exists() returning false. An IOException should only be
* thrown when a real IO problem occurs, like the impossibility to connect to a server.
*
*
* @param source
* A string identifying the resource.
* @return The resource associated with the resource identifier.
@ -66,7 +57,7 @@ public interface Repository {
/**
* Fetch a resource from the repository.
*
*
* @param source
* A string identifying the resource to be fetched.
* @param destination
@ -78,7 +69,7 @@ public interface Repository {
/**
* Transfer a resource to the repository
*
*
* @param artifact
* The artifact to be transferred.
* @param source
@ -95,7 +86,7 @@ public interface Repository {
/**
* Return a listing of resources names
*
*
* @param parent
* The parent directory from which to generate the listing.
* @return A listing of the parent directory's file content
@ -106,7 +97,7 @@ public interface Repository {
/**
* Add a listener to the repository.
*
*
* @param listener
* The listener to attach to the repository.
*/
@ -114,7 +105,7 @@ public interface Repository {
/**
* Remove a listener on the repository
*
*
* @param listener
* The listener to remove
*/
@ -122,7 +113,7 @@ public interface Repository {
/**
* Determine if a given listener is attached to the repository.
*
*
* @param listener
* The listener being queried
* @return <code>true</code> if the provided listener is attached to the repository,
@ -132,14 +123,14 @@ public interface Repository {
/**
* Get the repository's file separator string.
*
*
* @return The repository's file separator delimiter
*/
String getFileSeparator();
/**
* Normalize a string.
*
*
* @param source
* The string to normalize.
* @return The normalized string.
@ -148,6 +139,8 @@ public interface Repository {
/**
* Return the name of the repository
*
* @return String name
*/
String getName();
}

View File

@ -29,18 +29,17 @@ import java.io.InputStream;
* <li>size of the resource in bytes.</li>
* <li>if the resource is available.</li>
* </ul>
* </p> <h4>Implementation Notes</h4> In implementing the interface you need to ensure the following
* behaviors:
* <h3>Implementation Notes</h3>
* In implementing the interface you need to ensure the following behaviors:
* <ul>
* <li>All of the methods specified in the interface fail by returning an empty value (
* <code>false</code>, <code>0</code>, <code>""</code>). In other words, the specified interface
* <li>All of the methods specified in the interface fail by returning an empty value
* (<code>false</code>, <code>0</code>, <code>""</code>). In other words, the specified interface
* methods should not throw RuntimeExceptions.</li>
* <li>Failure conditions should be logged using the {@link org.apache.ivy.util.Message#verbose}
* method.</li>
* <li>Failure of one of the interface's specified methods results in all other interface specified
* methods returning an empty value (<code>false</code>, <code>0</code>, <code>""</code>).</li>
* </ul>
* </p>
*/
public interface Resource {
@ -68,7 +67,7 @@ public interface Resource {
public long getContentLength();
/**
* Determine if the resource is available. </p> Note that this method only checks for
* Determine if the resource is available. Note that this method only checks for
* availability, not for actual existence.
*
* @return <code>boolean</code> value indicating if the resource is available.
@ -95,6 +94,7 @@ public interface Resource {
* Opens a stream on this resource
*
* @return the opened input stream
* @throws IOException if something goes wrong
*/
public InputStream openStream() throws IOException;
}

View File

@ -25,25 +25,25 @@ import org.apache.ivy.core.event.IvyEvent;
* TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to
* the repository This class is LARGELY inspired by org.apache.maven.wagon.events.TransferEvent
* released under the following copyright license:
*
*
* <pre>
*
*
* Copyright 2001-2005 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* </pre>
*
*
* Original class written by Michal Maczka.
*/
public class TransferEvent extends IvyEvent {
@ -184,9 +184,9 @@ public class TransferEvent extends IvyEvent {
/**
* Returns the request type.
*
*
* @return Returns the request type. The Request type is one of
* <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code>
* TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT
*/
public int getRequestType() {
return requestType;
@ -194,10 +194,10 @@ public class TransferEvent extends IvyEvent {
/**
* Sets the request type
*
*
* @param requestType
* The requestType to set. The Request type value should be either
* <code>TransferEvent.REQUEST_GET<code> or <code>TransferEvent.REQUEST_PUT<code>.
* TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT
* @throws IllegalArgumentException
* when
*/
@ -303,22 +303,16 @@ public class TransferEvent extends IvyEvent {
/**
* Returns the elapsed time (in ms) between when the event entered one type until it entered
* another event time.
* <p>
* This is especially useful to get the elapsed transfer time:
*
* <p>This is especially useful to get the elapsed transfer time:</p>
* <pre>
* getElapsedTime(TransferEvent.TRANSFER_STARTED, TransferEvent.TRANSFER_COMPLETED);
* </pre>
*
* </p>
* <p>
* Special cases:
* <p>Special cases:</p>
* <ul>
* <li>returns -1 if the event never entered the fromEventType or the toEventType.</li>
* <li>returns 0 if the event entered toEventType before fromEventType</li>
* </ul>
* </p>
*
*
* @param fromEventType
* the event type constant from which time should be measured
* @param toEventType
@ -345,7 +339,7 @@ public class TransferEvent extends IvyEvent {
/**
* Checks the given event type is a valid event type, throws an {@link IllegalArgumentException}
* if it isn't
*
*
* @param eventType
* the event type to check
*/

View File

@ -68,10 +68,11 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* get a new session using the default attributes if the given String is a full uri, use the
* data from the uri instead
*
*
* @param pathOrUri
* might be just a path or a full ssh or sftp uri
* @return matching Session
* @throws IOException if something goes wrong
*/
protected Session getSession(String pathOrUri) throws IOException {
URI uri = parseURI(pathOrUri);
@ -134,7 +135,7 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* Just check the uri for sanity
*
*
* @param source
* String of the uri
* @return URI object of the String or null
@ -170,7 +171,7 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* Called, when user was not found in URL. Maintain static hash of credentials and retrieve or
* ask credentials for host.
*
*
* @param host
* host for which we want to get credentials.
* @return credentials for given host
@ -194,7 +195,7 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* closes the session and remove it from the cache (eg. on case of errors)
*
*
* @param session
* key for the cache
* @param pathOrUri
@ -207,7 +208,7 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* set the default user to use for the connection if no user is given or a PEM file is used
*
*
* @param user
* to use
*/
@ -224,7 +225,7 @@ public abstract class AbstractSshBasedRepository extends AbstractRepository {
/**
* Sets the full file path to use for accessing a PEM key file
*
*
* @param filePath
* fully qualified name
*/

View File

@ -108,7 +108,7 @@ public final class SshCache {
/**
* attach an sftp channel to this cache entry
*
*
* @param newChannel
* to attach
*/
@ -150,7 +150,7 @@ public final class SshCache {
/**
* key is username / host / port
*
*
* @see #createCacheKey(String, String, int) for details
*/
private Map uriCacheMap = new HashMap();
@ -177,7 +177,7 @@ public final class SshCache {
/**
* Creates a combined cache key from the given key parts
*
*
* @param user
* name of the user
* @param host
@ -197,7 +197,7 @@ public final class SshCache {
/**
* retrieves a session entry for a given session from the cache
*
*
* @param session
* to retrieve cache entry for
* @return null or the existing entry
@ -209,7 +209,7 @@ public final class SshCache {
/**
* Sets a session to a given combined key into the cache If an old session object already
* exists, close and remove it
*
*
* @param user
* of the session
* @param host
@ -246,7 +246,7 @@ public final class SshCache {
/**
* discards session entries from the cache
*
*
* @param session
* to clear
*/
@ -259,10 +259,11 @@ public final class SshCache {
/**
* retrieves an sftp channel from the cache
*
*
* @param session
* to connect to
* @return channelSftp or null if not successful (channel not existent or dead)
* @throws IOException if something goes wrong
*/
public ChannelSftp getChannelSftp(Session session) throws IOException {
ChannelSftp channel = null;
@ -279,7 +280,7 @@ public final class SshCache {
/**
* attaches a channelSftp to an existing session cache entry
*
*
* @param session
* to attach the channel to
* @param channel
@ -295,7 +296,7 @@ public final class SshCache {
/**
* Attempts to connect to a local SSH agent (using either UNIX sockets or PuTTY's Pageant)
*
*
* @param jsch
* Connection to be attached to an available local agent
* @return true if connected to agent, false otherwise
@ -313,7 +314,7 @@ public final class SshCache {
/**
* Gets a session from the cache or establishes a new session if necessary
*
*
* @param host
* to connect to
* @param port
@ -331,6 +332,7 @@ public final class SshCache {
* @param allowedAgentUse
* Whether to communicate with an agent for authentication
* @return session or null if not successful
* @throws IOException if something goes wrong
*/
public Session getSession(String host, int port, String username, String userPassword,
File pemFile, String pemPassword, File passFile, boolean allowedAgentUse)

View File

@ -68,7 +68,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* Fetch the needed file information for a given file (size, last modification time) and report
* it back in a SshResource
*
*
* @param source
* ssh uri for the file to get info for
* @return SshResource filled with the needed information
@ -103,7 +103,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* Reads out the output of a ssh session exec
*
*
* @param channel
* Channel to read from
* @param strStdout
@ -157,7 +157,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/*
* (non-Javadoc)
*
*
* @see org.apache.ivy.repository.Repository#list(java.lang.String)
*/
public List list(String parent) throws IOException {
@ -211,7 +211,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* Replace the argument placeholder with argument or append the argument if no placeholder is
* present
*
*
* @param command
* with argument placeholder or not
* @param argument ditto
@ -229,7 +229,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/*
* (non-Javadoc)
*
*
* @see org.apache.ivy.repository.Repository#put(java.io.File, java.lang.String, boolean)
*/
public void put(File source, String destination, boolean overwrite) throws IOException {
@ -279,7 +279,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* Tries to create a directory path on the target system
*
*
* @param path
* to create
* @param session
@ -316,7 +316,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* check for existence of file or dir on target system
*
*
* @param filePath
* to the object to check
* @param session
@ -337,7 +337,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/*
* (non-Javadoc)
*
*
* @see org.apache.ivy.repository.Repository#get(java.lang.String, java.io.File)
*/
public void get(String source, File destination) throws IOException {
@ -373,7 +373,7 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* sets the list command to use for a directory listing listing must be only the filename and
* each filename on a separate line
*
*
* @param cmd
* to use. default is "ls -1"
*/
@ -422,7 +422,7 @@ public class SshRepository extends AbstractSshBasedRepository {
* The file separator is the separator to use on the target system On a unix system it is '/',
* but I don't know, how this is solved on different ssh implementations. Using the default
* might be fine
*
*
* @param fileSeparator
* The fileSeparator to use. default '/'
*/
@ -433,6 +433,8 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of
* the published files.
*
* @param permissions String
*/
public void setPublishPermissions(String permissions) {
this.publishPermissions = permissions;
@ -448,10 +450,11 @@ public class SshRepository extends AbstractSshBasedRepository {
/**
* Not really streaming...need to implement a proper streaming approach?
*
*
* @param resource
* to stream
* @return InputStream of the resource data
* @throws IOException if something goes wrong
*/
public InputStream openStream(SshResource resource) throws IOException {
Session session = getSession(resource.getName());

View File

@ -117,10 +117,10 @@ public class VfsRepository extends AbstractRepository {
/**
* Get a VfsResource
*
*
* @param vfsURI
* a <code>String</code> identifying a VFS Resource
* @throws <code>IOException</code> on failure
* @throws IOException on failure
* @see "Supported File Systems in the jakarta-commons-vfs documentation"
*/
public Resource getResource(String vfsURI) throws IOException {
@ -129,12 +129,12 @@ public class VfsRepository extends AbstractRepository {
/**
* Transfer a VFS Resource from the repository to the local file system.
*
*
* @param srcVfsURI
* a <code>String</code> identifying the VFS resource to be fetched
* @param destination
* a <code>File</code> identifying the destination file
* @throws <code>IOException</code> on failure
* @throws IOException on failure
* @see "Supported File Systems in the jakarta-commons-vfs documentation"
*/
public void get(String srcVfsURI, File destination) throws IOException {
@ -159,7 +159,7 @@ public class VfsRepository extends AbstractRepository {
/**
* Return a listing of the contents of a parent directory. Listing is a set of strings
* representing VFS URIs.
*
*
* @param vfsURI
* providing identifying a VFS provided resource
* @throws IOException
@ -188,14 +188,14 @@ public class VfsRepository extends AbstractRepository {
/**
* Transfer an Ivy resource to a VFS repository
*
*
* @param source
* a <code>File</code> identifying the local file to transfer to the repository
* @param vfsURI
* a <code>String</code> identifying the destination VFS Resource.
* @param overwrite
* whether to overwrite an existing resource.
* @throws <code>IOException</code> on failure.
* @throws IOException on failure.
* @see "Supported File Systems in the jakarta-commons-vfs documentation"
*/
public void put(File source, String vfsURI, boolean overwrite) throws IOException {

View File

@ -83,7 +83,7 @@ public class VfsResource implements Resource {
* Get a list of direct descendants of the given resource. Note that attempts to get a list of
* children does <em>not</em> result in an error. Instead an error message is
* logged and an empty ArrayList returned.
*
*
* @return A <code>ArrayList</code> of VFSResources
*/
public List getChildren() {
@ -112,7 +112,7 @@ public class VfsResource implements Resource {
/**
* Get the name of the resource.
*
*
* @return a <code>String</code> representing the Resource URL.
*/
public String getName() {
@ -126,9 +126,9 @@ public class VfsResource implements Resource {
/**
* The VFS FileName getURI method seems to have a bug in it where file: URIs will have 4 forward
* slashes instead of 3.
*
*
* @param vfsURI ditto
* @return a normalized <class>String</class> representing the VFS URI
* @return a normalized String representing the VFS URI
*/
public static String normalize(String vfsURI) {
if (vfsURI == null) {
@ -143,7 +143,7 @@ public class VfsResource implements Resource {
/**
* Get the last modification time of the resource.
*
*
* @return a <code>long</code> indicating last modified time.
*/
public long getLastModified() {
@ -153,7 +153,7 @@ public class VfsResource implements Resource {
/**
* Get the size of the resource
*
*
* @return a <code>long</code> representing the size of the resource (in bytes).
*/
public long getContentLength() {
@ -163,7 +163,7 @@ public class VfsResource implements Resource {
/**
* Flag indicating whether a resource is available for querying
*
*
* @return <code>true</code> if the resource is available for querying, <code>false</code>
* otherwise.
*/
@ -174,7 +174,7 @@ public class VfsResource implements Resource {
/**
* Return a flag indicating whether a provided VFS resource physically exists
*
*
* @return <code>true</code> if the resource physically exists, <code>false</code> otherwise.
*/
public boolean physicallyExists() {

View File

@ -306,6 +306,11 @@ public class VsftpRepository extends AbstractRepository {
* we compare the response with the expected message and deal with it. The problem is that this
* is very specific to the version of vsftp used for the test, That's why expected messages are
* obtained using overriddable protected methods.
*
* @param command String
* @param expectedResponse Pattern
* @param timeout long
* @throws IOException if something goes wrong
*/
protected void sendCommand(String command, Pattern expectedResponse, long timeout)
throws IOException {
@ -638,7 +643,7 @@ public class VsftpRepository extends AbstractRepository {
/**
* Parses a ls -l line and transforms it in a resource
*
*
* @param file ditto
* @param responseLine ditto
* @return Resource
@ -729,7 +734,7 @@ public class VsftpRepository extends AbstractRepository {
/**
* Sets the reuse connection time. The same connection will be reused if the time here does not
* last between two commands. O indicates that the connection should never be reused
*
*
* @param time long
*/
public void setReuseConnection(long time) {

View File

@ -47,7 +47,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
/**
* Sets the location of the Public Key file to use for authentication
*
*
* @param filePath
* full file path name
*/
@ -57,7 +57,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
/**
* Determines whether a local SSH agent may be used for authentication
*
*
* @param allowedAgentUse
* true if an agent may be used if available
*/
@ -69,6 +69,8 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
* Optional password file. If set the repository will use it as an encrypted property file, to
* load username and passwd entries, and to store them if the user choose to do so. Defaults to
* user.dir/.ivy/[host].sftp.passwd, set it to null to disable this feature.
*
* @param passfile File
*/
public void setPassfile(File passfile) {
getSshBasedRepository().setPassFile(passfile);
@ -89,7 +91,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
* set and password based login is used, user will be prompted for it the password can also be
* set by using a full url for the pattern, like
* "sftp://user:password@myserver.com/path/to/repos/[artifact].[ext]"
*
*
* @param password
* to use
*/
@ -101,7 +103,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
* Sets the password to use for decrypting key file (if it is encrypted) if no password is set
* and the keyfile is encrypted, the user will be prompted for the password if the keyfile is
* passwordless, this parameter will be ignored if given
*
*
* @param password
* to use
*/
@ -112,7 +114,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
/**
* sets the user to use for the ssh communication the user can also be set by using a full url
* for the pattern, like "ssh://user@myserver.com/path/to/repos/[artifact].[ext]"
*
*
* @param user
* on the target system
*/
@ -123,7 +125,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
/**
* sets the host to use for the ssh communication the host can also be set by using a full url
* for the pattern, like "ssh://myserver.com/path/to/repos/[artifact].[ext]"
*
*
* @param host
* of the target system
*/
@ -135,7 +137,7 @@ public abstract class AbstractSshBasedResolver extends RepositoryResolver {
* sets the port to use for the ssh communication port 22 is default the port can also be set by
* using a full url for the pattern, like
* "sftp://myserver.com:8022/path/to/repos/[artifact].[ext]"
*
*
* @param port
* of the target system
*/

View File

@ -46,7 +46,7 @@ public interface DependencyResolver {
/**
* Should only be used by configurator
*
*
* @param name
* the new name of the resolver
*/
@ -57,8 +57,11 @@ public interface DependencyResolver {
* latest one (i.e. a revision uniquely identifying the revision of a module in the current
* environment - If this revision is not able to identify uniquely the revision of the module
* outside of the current environment, then the resolved revision must begin by ##)
*
* @throws ParseException
*
* @param dd DependencyDescriptor
* @param data ResolveData
* @return ResolvedModuleRevision
* @throws ParseException if something goes wrong
*/
ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data)
throws ParseException;
@ -66,7 +69,7 @@ public interface DependencyResolver {
/**
* Finds the module descriptor for the specified <tt>DependencyDescriptor</tt>. If this resolver
* can't find the module descriptor, <tt>null</tt> is returned.
*
*
* @param dd
* the dependency descriptor
* @param data
@ -86,7 +89,7 @@ public interface DependencyResolver {
* The returned DownloadReport is never <code>null</code>, and always contain an
* {@link ArtifactDownloadReport} for each requested Artifact.
* </p>
*
*
* @param artifacts
* an array of artifacts to download. Must not be <code>null</code>.
* @param options
@ -102,7 +105,7 @@ public interface DependencyResolver {
* locates and downloads a set of artifacts. This method uses an {@link ArtifactOrigin}, and as
* such is only used to materialize an already located Artifact.
* </p>
*
*
* @param artifact
* the location of the artifact to download. Must not be <code>null</code>.
* @param options
@ -114,7 +117,7 @@ public interface DependencyResolver {
/**
* Returns <code>true</code> if the given artifact can be located by this resolver and actually
* exist.
*
*
* @param artifact
* the artifact which should be tested.
* @return <code>true</code> if the given artifact can be located by this resolver and actually
@ -125,7 +128,7 @@ public interface DependencyResolver {
/**
* Locates the given artifact and returns its location if it can be located by this resolver and
* if it actually exists, or <code>null</code> in other cases.
*
*
* @param artifact
* the artifact which should be located
* @return the artifact location, or <code>null</code> if it can't be located by this resolver
@ -148,7 +151,7 @@ public interface DependencyResolver {
/**
* Reports last artifact download failure as Messages
*
*
* @param art Artifact
*/
void reportFailure(Artifact art);
@ -159,21 +162,26 @@ public interface DependencyResolver {
// are registered in ivy too.
/**
* List all the values the given token can take if other tokens are set as described in the
* otherTokenValues map. For instance, if token = "revision" and the map contains
* "organisation"->"foo" "module"->"bar" The results will be the list of revisions of the module
* bar from the org foo.
* List all the values the given token can take if other tokens are set as
* described in the otherTokenValues map. For instance, if
* token = "revision" and the map contains "organisation"-&gt;"foo" "module"-&gt;"bar"
* The results will be the list of revisions of the module bar from the org foo.
* <p>
* Note that listing does not take into account namespaces, and return raw information without
* any namespace transformation. The caller is responsible for calling namespace transformation
* with the Namespace returned by {@link #getNamespace()}.
* Note that listing does not take into account namespaces, and return raw
* information without any namespace transformation. The caller is
* responsible for calling namespace transformation with the Namespace
* returned by {@link #getNamespace()}.
* </p>
*
* @param token String
* @param otherTokenValues Map
* @return String[]
*/
String[] listTokenValues(String token, Map<String, String> otherTokenValues);
/**
* Same as {@link #listTokenValues(String, Map)} but more generic.
*
*
* @param tokens
* the tokens of the query
* @param criteria
@ -190,7 +198,7 @@ public interface DependencyResolver {
/**
* Returns the namespace associated with this resolver.
*
*
* @return the namespace associated with this resolver.
*/
Namespace getNamespace();
@ -202,7 +210,7 @@ public interface DependencyResolver {
/**
* Returns the {@link RepositoryCacheManager} used to manage the repository cache associated
* with this dependency resolver.
*
*
* @return the {@link RepositoryCacheManager} used to manage the repository cache associated
* with this dependency resolver.
*/

View File

@ -31,6 +31,8 @@ public class SshResolver extends AbstractSshBasedResolver {
/**
* A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of
* the published files.
*
* @param permissions String
*/
public void setPublishPermissions(String permissions) {
((SshRepository) getRepository()).setPublishPermissions(permissions);
@ -39,7 +41,7 @@ public class SshResolver extends AbstractSshBasedResolver {
/**
* sets the path separator used on the target system. Not sure if this is used or if '/' is used
* on all implementation. default is to use '/'
*
*
* @param sep
* file separator to use on the target system
*/
@ -57,6 +59,8 @@ public class SshResolver extends AbstractSshBasedResolver {
* the term %arg can be used in the command to substitute the path to be listed (e.g.
* "ls -1 %arg | grep -v CVS" to get a listing without CVS directory) if %arg is not part of the
* command, the path will be appended to the command default is: "ls -1"
*
* @param cmd String
*/
public void setListCommand(String cmd) {
((SshRepository) getRepository()).setListCommand(cmd);
@ -65,9 +69,11 @@ public class SshResolver extends AbstractSshBasedResolver {
/**
* set the command to check for existence of a file the command has to be a shell command
* working on the target system and has to create an exit status of 0 for an existent file and
* <> 0 for a non existing file given as argument the term %arg can be used in the command to
* substitute the path to be listed if %arg is not part of the command, the path will be appended
* to the command default is: "ls"
* &lt;&gt; 0 for a non existing file given as argument the term %arg can be used in the command
* to substitute the path to be listed if %arg is not part of the command, the path will be
* appended to the command default is: "ls"
*
* @param cmd String
*/
public void setExistCommand(String cmd) {
((SshRepository) getRepository()).setExistCommand(cmd);
@ -78,6 +84,8 @@ public class SshResolver extends AbstractSshBasedResolver {
* command working on the target system and has to create a directory with the given argument
* the term %arg can be used in the command to substitute the path to be listed if %arg is not
* part of the command, the path will be appended to the command default is: "mkdir"
*
* @param cmd String
*/
public void setCreateDirCommand(String cmd) {
((SshRepository) getRepository()).setExistCommand(cmd);

View File

@ -20,9 +20,9 @@ package org.apache.ivy.plugins.resolver;
import org.apache.ivy.core.settings.IvySettings;
/**
* Resolver which decorate normal resolver so that the workspace resolver can hijack the resolve
* process <br />
* NB : it is for internal usage of Ivy only!
* Resolver which decorate normal resolver so that the workspace resolver can
* hijack the resolveprocess
* <p>NB : it is for internal usage of Ivy only!</p>
*/
public class WorkspaceChainResolver extends ChainResolver {

View File

@ -81,14 +81,14 @@ public class PackagerCacheEntry {
/**
* Attempt to build this entry.
*
*
* @param packagerResource
* packager metadata resource
* @param properties
* a map of properties to pass to the child Ant build responsible for dependency
* packaging
*
* @throws IllegalStateException
*
* @throws IOException
* if this entry has already been built
*/
public synchronized void build(Resource packagerResource, Map properties) throws IOException {
@ -176,6 +176,8 @@ public class PackagerCacheEntry {
/**
* Has this entry been successfully built?
*
* @return boolean
*/
public synchronized boolean isBuilt() {
return this.built;
@ -183,7 +185,9 @@ public class PackagerCacheEntry {
/**
* Get a built artifact.
*
*
* @param artifact ditto
* @return ResolvedResource
* @throws IllegalStateException
* if this entry's built has not (yet) completed successfully
*/

View File

@ -36,10 +36,11 @@ import org.apache.ivy.util.Message;
/**
* Resolver that performs a "build" operation to resolve artifacts.
*
*
* <p>
* The resolver is configured with a base URL, from which the "ivy.xml" and "packager.xml" files are
* resolved. The latter file contains instructions describing how to build the actual artifacts.
* </p>
*/
public class PackagerResolver extends URLResolver {
@ -93,6 +94,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set root directory under which builds take place.
*
* @param buildRoot File
*/
public void setBuildRoot(File buildRoot) {
this.buildRoot = buildRoot;
@ -100,6 +103,8 @@ public class PackagerResolver extends URLResolver {
/**
* Returns root directory under which builds take place.
*
* @return File
*/
public File getBuildRoot() {
return buildRoot;
@ -107,6 +112,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set resource cache directory.
*
* @param resourceCache File
*/
public void setResourceCache(File resourceCache) {
this.resourceCache = resourceCache;
@ -114,6 +121,8 @@ public class PackagerResolver extends URLResolver {
/**
* Get resource cache directory.
*
* @return File
*/
public File getResourceCache() {
return resourceCache;
@ -121,6 +130,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set base resource override URL pattern.
*
* @param resourceURL String
*/
public void setResourceURL(String resourceURL) {
this.resourceURL = resourceURL;
@ -128,6 +139,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set pattern for locating "packager.xml" files.
*
* @param pattern String
*/
public void setPackagerPattern(String pattern) {
ArrayList list = new ArrayList();
@ -137,6 +150,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set whether to preserve build directories. Default is false.
*
* @param preserve boolean
*/
public void setPreserveBuildDirectories(boolean preserve) {
this.preserve = preserve;
@ -144,6 +159,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set whether to enable restricted mode. Default is true.
*
* @param restricted boolean
*/
public void setRestricted(boolean restricted) {
this.restricted = restricted;
@ -151,6 +168,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set whether to run ant with the -verbose flag. Default is false.
*
* @param verbose boolean
*/
public void setVerbose(boolean verbose) {
this.verbose = verbose;
@ -158,6 +177,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set whether to run ant with the -quiet flag. Default is false.
*
* @param quiet boolean
*/
public void setQuiet(boolean quiet) {
this.quiet = quiet;
@ -165,6 +186,8 @@ public class PackagerResolver extends URLResolver {
/**
* Set whether to validate downloaded packager.xml files. Default is true.
*
* @param validate boolean
*/
public void setValidate(boolean validate) {
this.validate = validate;
@ -185,7 +208,7 @@ public class PackagerResolver extends URLResolver {
/**
* Sets a property to be passed to the child Ant build responsible for packaging the dependency.
*
*
* @param propertyKey
* the property to pass
* @param propertyValue

View File

@ -45,7 +45,7 @@ public interface VersionMatcher {
/**
* Indicates if the given asked ModuleRevisionId should be considered as dynamic for the current
* VersionMatcher or not.
*
*
* @param askedMrid
* the dependency module revision id as asked by a module
* @return true if this revision is considered as a dynamic one, false otherwise
@ -55,7 +55,7 @@ public interface VersionMatcher {
/**
* Indicates if this version matcher considers that the module revision found matches the asked
* one.
*
*
* @param askedMrid ModuleRevisionId
* @param foundMrid ModuleRevisionId
* @return boolean
@ -66,7 +66,9 @@ public interface VersionMatcher {
* Indicates if this VersionMatcher needs module descriptors to determine if a module revision
* matches the asked one. Note that returning true in this method may imply big performance
* issues.
*
*
* @param askedMrid ModuleRevisionId
* @param foundMrid ModuleRevisionId
* @return boolean
*/
public boolean needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid);
@ -76,7 +78,7 @@ public interface VersionMatcher {
* method can be called even needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId
* foundMrid) returns false, so it is required to implement it in any case, a usual default
* implementation being: return accept(askedMrid, foundMD.getResolvedModuleRevisionId());
*
*
* @param askedMrid ModuleRevisionId
* @param foundMD ModuleDescriptor
* @return boolean
@ -88,7 +90,7 @@ public interface VersionMatcher {
* should be considered the greater. If there is not enough information to know which one is the
* greater, the dynamic one should be considered greater and this method should return 0. This
* method should never be called with a askedMrid for which isDynamic returns false.
*
*
* @param askedMrid
* the dynamic revision to compare
* @param foundMrid
@ -103,7 +105,7 @@ public interface VersionMatcher {
/**
* Returns the version matcher name identifying this version matcher
*
*
* @return the version matcher name identifying this version matcher
*/
public String getName();

View File

@ -57,9 +57,9 @@ public final class FileUtil {
// Utility class
}
// according to tests by users, 64kB seems to be a good value for the buffer used during copy
// according to tests by users, 64kB seems to be a good value for the buffer used during copy;
// further improvements could be obtained using NIO API
private static final int BUFFER_SIZE = 64 * 1024;
private static final int BUFFER_SIZE = 64 * 1024;
private static final byte[] EMPTY_BUFFER = new byte[0];
@ -67,13 +67,12 @@ public final class FileUtil {
public static void symlinkInMass(Map<File, File> destToSrcMap, boolean overwrite)
throws IOException {
// This pattern could be more forgiving if somebody wanted it to be...
// ...but this should satisfy 99+% of all needs, without letting unsafe operations be done.
// This pattern could be more forgiving if somebody wanted it to be... but this should
// satisfy 99+% of all needs, without letting unsafe operations be done.
// If you paths is not supported, you then skip this mass option.
// NOTE: A space inside the path is allowed (I can't control other programmers who like them
// in their working directory names)...
// but trailing spaces on file names will be checked otherwise and refused.
// in their working directory names)... but trailing spaces on file names will be checked
// otherwise and refused.
try {
StringBuffer sb = new StringBuffer();
@ -456,10 +455,14 @@ public final class FileUtil {
/**
* Returns a list of Files composed of all directories being parent of file and child of root +
* file and root themselves. Example: getPathFiles(new File("test"), new
* File("test/dir1/dir2/file.txt")) => {new File("test/dir1"), new File("test/dir1/dir2"), new
* File("test/dir1/dir2/file.txt") } Note that if root is not an ancestor of file, or if root is
* null, all directories from the file system root will be returned.
* file and root themselves. Example: <code>getPathFiles(new File("test"), new
* File("test/dir1/dir2/file.txt")) =&gt; {new File("test/dir1"), new File("test/dir1/dir2"),
* new File("test/dir1/dir2/file.txt") }</code> Note that if root is not an ancestor of file, or
* if root is null, all directories from the file system root will be returned.
*
* @param root File
* @param file File
* @return List&lt;File&gt;
*/
public static List<File> getPathFiles(File root, File file) {
List<File> ret = new ArrayList<File>();
@ -475,15 +478,13 @@ public final class FileUtil {
}
/**
* Returns a collection of all Files being contained in the given directory, recursively,
* including directories.
*
* @param dir
* The directory from which all files, including files in subdirectory) are
* extracted.
* @param ignore
* a Collection of filenames which must be excluded from listing
* @return A collection containing all the files of the given directory and it's subdirectories.
* @return a collection containing all the files of the given directory and it's subdirectories,
* recursively.
*/
public static Collection<File> listAll(File dir, Collection<String> ignore) {
return listAll(dir, new ArrayList<File>(), ignore);
@ -534,12 +535,9 @@ public final class FileUtil {
* Unlike {@link File#getCanonicalPath()} this method specifically does not resolve symbolic
* links.
*
* @param path
* the path to be normalized.
* @param path the path to be normalized.
* @return the normalized version of the path.
*
* @throws java.lang.NullPointerException
* if path is null.
* @throws NullPointerException if path is null.
*/
public static File normalize(final String path) {
Stack<String> s = new Stack<String>();
@ -577,21 +575,20 @@ public final class FileUtil {
/**
* Dissect the specified absolute path.
*
* @param path
* the path to dissect.
* @param path the path to dissect.
* @return String[] {root, remaining path}.
* @throws java.lang.NullPointerException
* if path is null.
* @throws NullPointerException if path is null.
* @since Ant 1.7
*/
private static String[] dissect(String path) {
char sep = File.separatorChar;
path = path.replace('/', sep).replace('\\', sep);
// // make sure we are dealing with an absolute path
// if (!isAbsolutePath(path)) {
// throw new BuildException(path + " is not an absolute path");
// }
/* // make sure we are dealing with an absolute path
* if (!isAbsolutePath(path)) {
* throw new BuildException(path + " is not an absolute path");
* }
*/
String root = null;
int colon = path.indexOf(':');
if (colon > 0) { // && (ON_DOS || ON_NETWARE)) {
@ -627,8 +624,8 @@ public final class FileUtil {
/**
* Get the length of the file, or the sum of the children lengths if it is a directory
*
* @param file
* @return
* @param file File
* @return long
*/
public static long getFileLength(File file) {
long l = 0;

View File

@ -47,8 +47,7 @@ public final class StringUtils {
* will try to be as precise as possible, handling cases where e.getMessage() is not meaningful,
* like {@link NullPointerException} for instance.
*
* @param t
* the throwable to get the error message from
* @param t the throwable to get the error message from
* @return the error message of the given exception
*/
public static String getErrorMessage(Throwable t) {
@ -89,7 +88,7 @@ public final class StringUtils {
* Example:
*
* <pre>
* join(new String[] {"one", "two", "three"}, ", ") -> "one, two, three"
* join(new String[] {"one", "two", "three"}, ", ") -&gt; "one, two, three"
* </pre>
*
* @param objs
@ -110,7 +109,9 @@ public final class StringUtils {
}
// basic string codec (same algo as CVS passfile, inspired by ant CVSPass class
/** Array contain char conversion data */
/**
* Array containing char conversion data
*/
private static final char[] SHIFTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 114, 120, 53, 79, 96, 109,
72, 108, 70, 64, 76, 67, 116, 74, 68, 87, 111, 52, 75, 119, 49, 34, 82, 81, 95, 65,
@ -130,7 +131,7 @@ public final class StringUtils {
* Encrypt the given string in a way which anybody having access to this method algorithm can
* easily decrypt. This is useful only to avoid clear string storage in a file for example, but
* shouldn't be considered as a real mean of security. This only works with simple characters
* (char < 256).
* (char &lt; 256).
*
* @param str
* the string to encrypt

View File

@ -95,6 +95,9 @@ public abstract class XMLHelper {
/**
* Convert an URL to a valid systemId according to RFC 2396.
*
* @param url URL
* @return String
*/
public static String toSystemId(URL url) {
try {
@ -105,9 +108,9 @@ public abstract class XMLHelper {
}
// IMPORTANT: validation errors are only notified to the given handler, and
// do not cause exception
// implement warning error and fatalError methods in handler to be informed
// of validation errors
// do not cause exception implement warning error and fatalError methods in
// handler to be informed of validation errors
public static void parse(URL xmlURL, URL schema, DefaultHandler handler) throws SAXException,
IOException, ParserConfigurationException {
parse(xmlURL, schema, handler, null);
@ -177,12 +180,12 @@ public abstract class XMLHelper {
/**
* Escapes invalid XML characters in the given character data using XML entities. For the
* moment, only the following characters are being escaped: (<), (&), (') and (").
*
* Remark: we don't escape the (>) character to keep the readability of the configuration
* mapping! The XML spec only requires that the (&) and (<) characters are being escaped inside
* character data.
*
* moment, only the following characters are being escaped: (&lt;), (&amp;), (') and (&quot;).
*
* Remark: we don't escape the (&gt;) character to keep the readability of the configuration
* mapping! The XML spec only requires that the (&amp;) and (&lt;) characters are being escaped
* inside character data.
*
* @param text
* the character data to escape
* @return the escaped character data

View File

@ -54,19 +54,19 @@ public final class FilterHelper {
}
/**
* Returns a new collection containing only the items from the given collection, which are
* accepted by the filter.
*
* @param <T> The type parameter
* @param col
* The collection to filter.
* @param filter
* The filter to use.
* @return A new collection instance containing the only the instance accepted by the filter.
* @return a new collection instance containing the only the the items from the given
* collection, which are accepted by the filter.
*
* <br />
* Comment: We could have used
* <a href="http://jakarta.apache.org/commons/collections/">Commons-Collections</a>
* facility for this. If we accepted to add dependencies on third party jars.
* <p>
* Comment: We could have used
* <a href="http://jakarta.apache.org/commons/collections/">Commons Collections</a> facility for
* this, if we accepted additional dependencies on third party jars.
* </p>
*/
public static <T> Collection<T> filter(Collection<T> col, Filter<T> filter) {
if (filter == null) {

View File

@ -83,48 +83,44 @@ public interface URLHandler {
/**
* Please prefer getURLInfo when several infos are needed.
*
* @param url
* the url to check
*
* @param url the url to check
* @return true if the target is reachable
*/
public boolean isReachable(URL url);
/**
* Please prefer getURLInfo when several infos are needed.
*
* @param url
* the url to check
*
* @param url the url to check
* @param timeout the timeout in milliseconds
* @return true if the target is reachable
*/
public boolean isReachable(URL url, int timeout);
/**
* Returns the length of the target if the given url is reachable, and without error code in
* case of http urls. Please prefer getURLInfo when several infos are needed.
*
* @param url
* the url to check
* @return the length of the target if available, 0 if not reachable
* Please prefer getURLInfo when several infos are needed.
*
* @param url the url to check
* @return the length of the target if the given url is reachable, 0 otherwise. No error code in
* case of http urls.
*/
public long getContentLength(URL url);
/**
* Returns the length of the target if the given url is reachable, and without error code in
* case of http urls.
*
* @param url
* the url to check
* @param timeout
* the maximum time before considering an url is not reachable a timeout of zero
* indicates no timeout
* @return the length of the target if available, 0 if not reachable
* the maximum time before considering an url is not reachable a
* timeout of zero indicates no timeout
* @return the length of the target if the given url is reachable, 0 otherwise. No error code in
* case of http urls.
*/
public long getContentLength(URL url, int timeout);
/**
* Please prefer getURLInfo when several infos are needed.
*
*
* @param url
* the url to check
* @return last modified timestamp of the given url
@ -133,33 +129,28 @@ public interface URLHandler {
/**
* Please prefer getURLInfo when several infos are needed.
*
* @param url
* the url to check
*
* @param url the url to check
* @param timeout the timeout in milliseconds
* @return last modified timestamp of the given url
*/
public long getLastModified(URL url, int timeout);
/**
* Returns the URLInfo of the given url or a {@link #UNAVAILABLE} instance, if the url is not
* reachable.
*
* @param url
* The url from which information is retrieved.
* @return The URLInfo extracted from the given url, or {@link #UNAVAILABLE} when the url is not
* available.
* @return The URLInfo extracted from the given url, or {@link #UNAVAILABLE} instance when the
* url is not reachable.
*/
public URLInfo getURLInfo(URL url);
/**
* never returns null, return UNAVAILABLE when url is not reachable
*
* @param url
* The url from which information is retrieved.
* @param timeout
* The timeout in milliseconds.
* @return The URLInfo extracted from the given url, or {@link #UNAVAILABLE} when the url is not
* available.
* reachable, never null.
*/
public URLInfo getURLInfo(URL url, int timeout);

View File

@ -39,7 +39,7 @@ public final class URLHandlerRegistry {
/**
* This method is used to get appropriate http downloader depending on Jakarta Commons
* HttpClient availability in classpath, or simply use jdk url handling in other cases.
*
*
* @return most accurate http downloader
*/
public static URLHandler getHttp() {