Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1D1A9CDC for ; Wed, 4 Apr 2012 16:47:48 +0000 (UTC) Received: (qmail 68548 invoked by uid 500); 4 Apr 2012 16:47:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 68459 invoked by uid 500); 4 Apr 2012 16:47:48 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 68442 invoked by uid 99); 4 Apr 2012 16:47:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 16:47:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2012 16:47:44 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3A4083580BB for ; Wed, 4 Apr 2012 16:47:23 +0000 (UTC) Date: Wed, 4 Apr 2012 16:47:23 +0000 (UTC) From: "Darren Hartford (Issue Comment Edited) (JIRA)" To: issues@commons.apache.org Message-ID: <1592973679.12690.1333558043285.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (FILEUPLOAD-183) commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FILEUPLOAD-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246450#comment-13246450 ] Darren Hartford edited comment on FILEUPLOAD-183 at 4/4/12 4:45 PM: -------------------------------------------------------------------- Just recently ran into this exact issue with 1.2.2 as well. Commons-io should not be optional. The 'common usecases' always need commons-io. EDIT: researched, there is an older ticket https://issues.apache.org/jira/browse/FILEUPLOAD-172 that identifies that if you do not use DiskFileItem, then you do not need commons-io. Unfortunately, this is where maven dependency management and based-on-code-used dependencies fall apart. Doesn't sound like a commons-fileupload issue as much as a Maven issue for them to be more verbose about showing/listing transitive optional dependencies (instead, you always have to dig to find them). was (Author: dhartford): Just recently ran into this exact issue with 1.2.2 as well. Commons-io should not be optional. The 'common usecases' always need commons-io. > commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified > -------------------------------------------------------------------------------------------------------- > > Key: FILEUPLOAD-183 > URL: https://issues.apache.org/jira/browse/FILEUPLOAD-183 > Project: Commons FileUpload > Issue Type: Bug > Affects Versions: 1.2.1 > Environment: Maven 2.2.1 > Reporter: Roman Arkadijovych Muntyanu > > If commons-fileupload is added as dependency (without commons-io explicitly defined) like the following > {code:xml} > > commons-fileupload > commons-fileupload > 1.2.1 > compile > > {code} > and fileupload is referenced in the code like > {code:java} > // Create a factory for disk-based file items > FileItemFactory factory = new DiskFileItemFactory(); > // Create a new file upload handler > ServletFileUpload upload = new ServletFileUpload(factory); > // Parse the request > List /* FileItem */ items = upload.parseRequest(request); > {code} > then NoClassDefFoundError occurs > {code:none} > java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream > at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196) > at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358) > at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) > {code} > The reason is that commons-fileupload artifact has *optional* dependency to commons-io in its pom-file > {code:xml} > > commons-io > commons-io > 1.3.2 > true > > {code} > Which results in commons-io not being downloaded and added to the project by maven. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira