You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Steve Lopez <st...@regattacentral.com> on 2021/05/20 16:11:15 UTC

4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Upgrading from v4.1 to 5.0 has resulted in an additional 24MB of dependencies.  This adds significant bulk to our war file and difficult to believe it is correct. 

it looks like the majority of this bloat is from from batik.   Is there a build or version that allows removing all of this without jeopardizing core XLSX generation?

This is the pom being used (Old v4)

	<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>4.1.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>4.1.2</version>
			<exclusions>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

And upgrading to 5 (resulting in addl 24MB of jars!)

	<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>5.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>5.0.0</version>
			<exclusions>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: 4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Posted by Dominik Stadler <do...@gmx.at>.
Hi,

Is there more output? Especially which class it cannot load while
initializing SharedStringsTable and some code-snippet that is used to
trigger the problem?

When I try to read and write a simple XSLX-file via Gradle it works fine
with the following excludes:

configurations {
    compile {
        exclude group: 'com.github.virtuald'
        exclude group: 'xml-apis'
        exclude group: 'org.apache.xmlgraphics'
        exclude group: 'org.apache.santuario'
        exclude group: 'org.bouncycastle'
        exclude group: 'org.apache.pdfbox'
        exclude group: 'de.rototor.pdfbox'
    }
}

Dominik.


On Mon, May 24, 2021 at 3:29 PM Steve Lopez <st...@regattacentral.com>
wrote:

> Thank you for the quick reply. unfortunately I get the following error
> after adjusting the pom
>
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.poi.xssf.model.SharedStringsTable
>
> My updated pom has the following for POI (and war file increased about 6MB
> compared with POI 4.1.2)
>
> <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi</artifactId>
>                         <version>5.0.0</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi-ooxml</artifactId>
>                         <version>5.0.0</version>
>                         <exclusions>
>                                 <exclusion>
>                                         <groupId>xml-apis</groupId>
>                                         <artifactId>xml-apis</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                             <groupId>org.apache.xmlgraphics</groupId>
>                             <artifactId>batik-all</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.apache.santuario</groupId>
>                                     <artifactId>xmlsec</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.bouncycastle</groupId>
>                                     <artifactId>*</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.apache.pdfbox</groupId>
>                                     <artifactId>pdfbox</artifactId>
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
>
> On 2021/05/21 12:30:01, Yegor Kozlov <ye...@gmail.com> wrote:
> > Adding the following exclusions should make your war smaller:
> >
> > <exclusion>
> >     <groupId>org.apache.xmlgraphics</groupId>
> >     <artifactId>batik-all</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.apache.santuario</groupId>
> >     <artifactId>xmlsec</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.bouncycastle</groupId>
> >     <artifactId>*</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.apache.pdfbox</groupId>
> >     <artifactId>pdfbox</artifactId>
> > </exclusion>
> >
> > Apache Batik is only required to render WMF/EMF images.
> > Apache XML Security for Java and Bouncy Castle are only required to sign
> or
> > validate signed Office documents.
> > PDFBox is only required to render to PDF documents. The required jars can
> > be downloaded from:
> >
> > Core XLSX generation should work fine without them.
> >
> > Yegor
> >
> > On Thu, May 20, 2021 at 7:27 PM Steve Lopez <st...@regattacentral.com>
> > wrote:
> >
> > > Upgrading from v4.1 to 5.0 has resulted in an additional 24MB of
> > > dependencies.  This adds significant bulk to our war file and
> difficult to
> > > believe it is correct.
> > >
> > > it looks like the majority of this bloat is from from batik.   Is
> there a
> > > build or version that allows removing all of this without jeopardizing
> core
> > > XLSX generation?
> > >
> > > This is the pom being used (Old v4)
> > >
> > >         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi</artifactId>
> > >                         <version>4.1.2</version>
> > >                 </dependency>
> > >                 <dependency>
> > >                         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi-ooxml</artifactId>
> > >                         <version>4.1.2</version>
> > >                         <exclusions>
> > >                                 <exclusion>
> > >                                         <groupId>xml-apis</groupId>
> > >
>  <artifactId>xml-apis</artifactId>
> > >                                 </exclusion>
> > >                         </exclusions>
> > >                 </dependency>
> > >
> > > And upgrading to 5 (resulting in addl 24MB of jars!)
> > >
> > >         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi</artifactId>
> > >                         <version>5.0.0</version>
> > >                 </dependency>
> > >                 <dependency>
> > >                         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi-ooxml</artifactId>
> > >                         <version>5.0.0</version>
> > >                         <exclusions>
> > >                                 <exclusion>
> > >                                         <groupId>xml-apis</groupId>
> > >
>  <artifactId>xml-apis</artifactId>
> > >                                 </exclusion>
> > >                         </exclusions>
> > >                 </dependency>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > > For additional commands, e-mail: user-help@poi.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: 4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Posted by Yegor Kozlov <ye...@gmail.com>.
Try excluding only Batik:

<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.xmlgraphics</groupId>
                    <artifactId>batik-all</artifactId>
                </exclusion>
            </exclusions>
 </dependency>

Egor

On Mon, May 24, 2021 at 4:29 PM Steve Lopez <st...@regattacentral.com>
wrote:

> Thank you for the quick reply. unfortunately I get the following error
> after adjusting the pom
>
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.poi.xssf.model.SharedStringsTable
>
> My updated pom has the following for POI (and war file increased about 6MB
> compared with POI 4.1.2)
>
> <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi</artifactId>
>                         <version>5.0.0</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi-ooxml</artifactId>
>                         <version>5.0.0</version>
>                         <exclusions>
>                                 <exclusion>
>                                         <groupId>xml-apis</groupId>
>                                         <artifactId>xml-apis</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                             <groupId>org.apache.xmlgraphics</groupId>
>                             <artifactId>batik-all</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.apache.santuario</groupId>
>                                     <artifactId>xmlsec</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.bouncycastle</groupId>
>                                     <artifactId>*</artifactId>
>                                 </exclusion>
>                                 <exclusion>
>                                     <groupId>org.apache.pdfbox</groupId>
>                                     <artifactId>pdfbox</artifactId>
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
>
> On 2021/05/21 12:30:01, Yegor Kozlov <ye...@gmail.com> wrote:
> > Adding the following exclusions should make your war smaller:
> >
> > <exclusion>
> >     <groupId>org.apache.xmlgraphics</groupId>
> >     <artifactId>batik-all</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.apache.santuario</groupId>
> >     <artifactId>xmlsec</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.bouncycastle</groupId>
> >     <artifactId>*</artifactId>
> > </exclusion>
> > <exclusion>
> >     <groupId>org.apache.pdfbox</groupId>
> >     <artifactId>pdfbox</artifactId>
> > </exclusion>
> >
> > Apache Batik is only required to render WMF/EMF images.
> > Apache XML Security for Java and Bouncy Castle are only required to sign
> or
> > validate signed Office documents.
> > PDFBox is only required to render to PDF documents. The required jars can
> > be downloaded from:
> >
> > Core XLSX generation should work fine without them.
> >
> > Yegor
> >
> > On Thu, May 20, 2021 at 7:27 PM Steve Lopez <st...@regattacentral.com>
> > wrote:
> >
> > > Upgrading from v4.1 to 5.0 has resulted in an additional 24MB of
> > > dependencies.  This adds significant bulk to our war file and
> difficult to
> > > believe it is correct.
> > >
> > > it looks like the majority of this bloat is from from batik.   Is
> there a
> > > build or version that allows removing all of this without jeopardizing
> core
> > > XLSX generation?
> > >
> > > This is the pom being used (Old v4)
> > >
> > >         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi</artifactId>
> > >                         <version>4.1.2</version>
> > >                 </dependency>
> > >                 <dependency>
> > >                         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi-ooxml</artifactId>
> > >                         <version>4.1.2</version>
> > >                         <exclusions>
> > >                                 <exclusion>
> > >                                         <groupId>xml-apis</groupId>
> > >
>  <artifactId>xml-apis</artifactId>
> > >                                 </exclusion>
> > >                         </exclusions>
> > >                 </dependency>
> > >
> > > And upgrading to 5 (resulting in addl 24MB of jars!)
> > >
> > >         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi</artifactId>
> > >                         <version>5.0.0</version>
> > >                 </dependency>
> > >                 <dependency>
> > >                         <groupId>org.apache.poi</groupId>
> > >                         <artifactId>poi-ooxml</artifactId>
> > >                         <version>5.0.0</version>
> > >                         <exclusions>
> > >                                 <exclusion>
> > >                                         <groupId>xml-apis</groupId>
> > >
>  <artifactId>xml-apis</artifactId>
> > >                                 </exclusion>
> > >                         </exclusions>
> > >                 </dependency>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > > For additional commands, e-mail: user-help@poi.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: 4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Posted by Steve Lopez <st...@regattacentral.com>.
Thank you for the quick reply. unfortunately I get the following error after adjusting the pom

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.xssf.model.SharedStringsTable

My updated pom has the following for POI (and war file increased about 6MB compared with POI 4.1.2)

<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>5.0.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>5.0.0</version>
			<exclusions>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
				<exclusion>
			    <groupId>org.apache.xmlgraphics</groupId>
			    <artifactId>batik-all</artifactId>
				</exclusion>
				<exclusion>
				    <groupId>org.apache.santuario</groupId>
				    <artifactId>xmlsec</artifactId>
				</exclusion>
				<exclusion>
				    <groupId>org.bouncycastle</groupId>
				    <artifactId>*</artifactId>
				</exclusion>
				<exclusion>
				    <groupId>org.apache.pdfbox</groupId>
				    <artifactId>pdfbox</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

On 2021/05/21 12:30:01, Yegor Kozlov <ye...@gmail.com> wrote: 
> Adding the following exclusions should make your war smaller:
> 
> <exclusion>
>     <groupId>org.apache.xmlgraphics</groupId>
>     <artifactId>batik-all</artifactId>
> </exclusion>
> <exclusion>
>     <groupId>org.apache.santuario</groupId>
>     <artifactId>xmlsec</artifactId>
> </exclusion>
> <exclusion>
>     <groupId>org.bouncycastle</groupId>
>     <artifactId>*</artifactId>
> </exclusion>
> <exclusion>
>     <groupId>org.apache.pdfbox</groupId>
>     <artifactId>pdfbox</artifactId>
> </exclusion>
> 
> Apache Batik is only required to render WMF/EMF images.
> Apache XML Security for Java and Bouncy Castle are only required to sign or
> validate signed Office documents.
> PDFBox is only required to render to PDF documents. The required jars can
> be downloaded from:
> 
> Core XLSX generation should work fine without them.
> 
> Yegor
> 
> On Thu, May 20, 2021 at 7:27 PM Steve Lopez <st...@regattacentral.com>
> wrote:
> 
> > Upgrading from v4.1 to 5.0 has resulted in an additional 24MB of
> > dependencies.  This adds significant bulk to our war file and difficult to
> > believe it is correct.
> >
> > it looks like the majority of this bloat is from from batik.   Is there a
> > build or version that allows removing all of this without jeopardizing core
> > XLSX generation?
> >
> > This is the pom being used (Old v4)
> >
> >         <groupId>org.apache.poi</groupId>
> >                         <artifactId>poi</artifactId>
> >                         <version>4.1.2</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.poi</groupId>
> >                         <artifactId>poi-ooxml</artifactId>
> >                         <version>4.1.2</version>
> >                         <exclusions>
> >                                 <exclusion>
> >                                         <groupId>xml-apis</groupId>
> >                                         <artifactId>xml-apis</artifactId>
> >                                 </exclusion>
> >                         </exclusions>
> >                 </dependency>
> >
> > And upgrading to 5 (resulting in addl 24MB of jars!)
> >
> >         <groupId>org.apache.poi</groupId>
> >                         <artifactId>poi</artifactId>
> >                         <version>5.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.poi</groupId>
> >                         <artifactId>poi-ooxml</artifactId>
> >                         <version>5.0.0</version>
> >                         <exclusions>
> >                                 <exclusion>
> >                                         <groupId>xml-apis</groupId>
> >                                         <artifactId>xml-apis</artifactId>
> >                                 </exclusion>
> >                         </exclusions>
> >                 </dependency>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: 4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Posted by Andreas Beeker <ki...@apache.org>.
The exclusion Yegor mentioned only work flawless on the classpath-mode.
In JPMS only Batik is optional (and need to be added via module-info or --add-modules), the rest of the dependencies should be on the module-path.

see [1] for the optional modules - we discussed the current setup in [2]


[1] https://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java9/module-info.java?view=markup

[2] http://apache-poi.1045710.n5.nabble.com/Optional-dependencies-and-JPMS-td5736219.html


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: 4.1 -> 5.0 results in enormous increase in dependencies and WAR file size

Posted by Yegor Kozlov <ye...@gmail.com>.
Adding the following exclusions should make your war smaller:

<exclusion>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>batik-all</artifactId>
</exclusion>
<exclusion>
    <groupId>org.apache.santuario</groupId>
    <artifactId>xmlsec</artifactId>
</exclusion>
<exclusion>
    <groupId>org.bouncycastle</groupId>
    <artifactId>*</artifactId>
</exclusion>
<exclusion>
    <groupId>org.apache.pdfbox</groupId>
    <artifactId>pdfbox</artifactId>
</exclusion>

Apache Batik is only required to render WMF/EMF images.
Apache XML Security for Java and Bouncy Castle are only required to sign or
validate signed Office documents.
PDFBox is only required to render to PDF documents. The required jars can
be downloaded from:

Core XLSX generation should work fine without them.

Yegor

On Thu, May 20, 2021 at 7:27 PM Steve Lopez <st...@regattacentral.com>
wrote:

> Upgrading from v4.1 to 5.0 has resulted in an additional 24MB of
> dependencies.  This adds significant bulk to our war file and difficult to
> believe it is correct.
>
> it looks like the majority of this bloat is from from batik.   Is there a
> build or version that allows removing all of this without jeopardizing core
> XLSX generation?
>
> This is the pom being used (Old v4)
>
>         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi</artifactId>
>                         <version>4.1.2</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi-ooxml</artifactId>
>                         <version>4.1.2</version>
>                         <exclusions>
>                                 <exclusion>
>                                         <groupId>xml-apis</groupId>
>                                         <artifactId>xml-apis</artifactId>
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
>
> And upgrading to 5 (resulting in addl 24MB of jars!)
>
>         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi</artifactId>
>                         <version>5.0.0</version>
>                 </dependency>
>                 <dependency>
>                         <groupId>org.apache.poi</groupId>
>                         <artifactId>poi-ooxml</artifactId>
>                         <version>5.0.0</version>
>                         <exclusions>
>                                 <exclusion>
>                                         <groupId>xml-apis</groupId>
>                                         <artifactId>xml-apis</artifactId>
>                                 </exclusion>
>                         </exclusions>
>                 </dependency>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>