Short story: java/jakarta-commons-cli won't build as commons-lang is not in the classpath and there is a problem with dependency fetching (which I suspect is related to Ant rather than commons-cli). Now the long story: When I tried to upgrade my java/jakarta-commons-cli port I had a build error. So I tried to build it directly with Ant as a normal user and I get errors while fetching dependencies. I am able to fetch them using wget so I wonder if someone already experienced such a problem. Anyway, here is the output just in case: > Buildfile: build.xml > > init: > > get-deps: > [get] Getting: http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.jar > [get] Error getting http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.jar to /export/andouillette/home/rv/src/commons-cli-1.0/lib/commons-logging-1.0.jar > [get] Getting: http://www.ibiblio.org/maven/commons-lang/jars/commons-lang-SNAPSHOT.jar > [get] Error getting http://www.ibiblio.org/maven/commons-lang/jars/commons-lang-SNAPSHOT.jar to /export/andouillette/home/rv/src/commons-cli-1.0/lib/commons-lang-SNAPSHOT.jar > [get] Getting: http://www.ibiblio.org/maven/junit/jars/junit-3.7.jar > [get] Error getting http://www.ibiblio.org/maven/junit/jars/junit-3.7.jar to /export/andouillette/home/rv/src/commons-cli-1.0/lib/junit-3.7.jar > > jar: > > BUILD SUCCESSFUL > Total time: 1 second But then I realized that the build is successful as user (using jdk-1.4.2) but not as root while building the port (using 1.4.2 also). I've just realized that the problem comes from my classpath that is set to "all JARs in ${JAVAJARDIR}" as user but not as root. The most important point here being that building commons-cli requires commons-lang... Now we've got two way of dealing with it: - Install from binary version and set commons-lang as RUN_DEPENDS - Build from source but then add commons-lang in BUILD_DEPENDS and RUN_DEPENDS and add ${JAVAJARDIR}/commons-lang.jar in the classpath while building the port. - Build from source but fix the dependency fetching. However IMHO fecthing additional dependencies at build time is not good. First because of redundancy (in this case JUnit and commons-lang may already be installed as a port), and then because with this scheme you cannot build a "distfiles" distribution CD-ROM so you can build ports while disconnected from the network. I prefer the first one but I'm not the maintainer. And that would resolve the Javadoc/pkg-plist issue... I suspect dependency fetching problems may have something to do with the new version of Ant (1.6.0)... in which case we should probably send another different PR to work on this particular issue. Fix: Nothing yet, as we need to know what the opinion of the maintainer. I can submit a fix in either case however. How-To-Repeat: unset CLASSPATH cd /usr/ports/java/jakarta-commons-cli make build
Okay, I have a fix with PORTDOCS macro (for Javadoc issues) and Ant classpath issues. Unfortunately, I'm too late to submit the patch right now. I'll commit tomorrow (hopefuly). Herve
Here is the patch. What it changes: - use the PORTDOCS macro to build dynamically pkg-plist (no more Javadoc 1.3/1.4 issues hopefully, and pkg-plist is now one line long) - define the ANT_INCLUDE_SHARED_JARS variable so Ant now correctly gets JARs from ${JAVAJARDIR} No need for a binary port after all. Herve
Responsible Changed From-To: freebsd-java->znerd Over to maintainer.
State Changed From-To: open->feedback Does the maintainer approve of the changes in this PR?
State Changed From-To: feedback->closed Committed, thanks!
PORTDOCS must be relative to DOCSDIR. -Oliver
On Fri, Apr 16, 2004 at 04:40:42AM +0200, Oliver Eikemeier wrote: > PORTDOCS must be relative to DOCSDIR. > > -Oliver Indeed. Here is a patch: - Fix PORTDOCS - bsd.java.mk 2.0 compliant - Removed pkg-plist - Done some cleanning (PLIST_SUB statement) Herve diff -ur jakarta-commons-cli.original/Makefile jakarta-commons-cli/Makefile --- jakarta-commons-cli.original/Makefile Fri Apr 16 08:50:05 2004 +++ jakarta-commons-cli/Makefile Fri Apr 16 08:56:10 2004 @@ -20,10 +20,10 @@ BUILD_DEPENDS= ${ANT}:${PORTSDIR}/devel/apache-ant \ ${LOCALBASE}/share/java/classes/commons-lang.jar:${PORTSDIR}/java/jakarta-commons-lang -USE_JAVA= 1.2+ +USE_JAVA= yes +JAVA_VERSION= 1.2+ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} -PLIST_SUB+= T=${TARGET_DIR:S/^${PREFIX}\///} ANT?= ${LOCALBASE}/bin/ant .if defined(NOPORTDOCS) ANT_TARGET= jar -Dnoget @@ -34,9 +34,10 @@ JARDIR= ${JAVASHAREDIR}/classes JARFILE= ${PORTNAME}-${PORTVERSION}-beta-2-dev.jar DESTJARFILE= ${PORTNAME}.jar +PLIST_FILES+= ${JAVAJARDIR:S,^${PREFIX}/,,}/${DESTJARFILE} .if !defined(NOPORTDOCS) -PORTDOCS= ${WRKSRC}/target/docs/apidocs +PORTDOCS= apidocs LICENSE.txt .endif do-build: @@ -51,7 +52,8 @@ .if !defined(NOPORTDOCS) @${ECHO} -n ">> Installing documentation in ${DOCSDIR}..." @${MKDIR} ${DOCSDIR} - @${CP} -r ${WRKSRC}/target/docs/apidocs/* ${DOCSDIR} + @${CP} -r ${WRKSRC}/target/docs/apidocs ${DOCSDIR}/ + @${CP} -r ${WRKSRC}/LICENSE.txt ${DOCSDIR}/ @${ECHO} " [ DONE ]" .endif Only in jakarta-commons-cli.original: pkg-plist
State Changed From-To: closed->open Re-opened.
State Changed From-To: open->closed Committed, thanks!