- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用外部配置文件制作 jar 文件。在使用 poi-ooxml 库之前一切正常。之后我遇到了资源提供的问题。我使用下一个 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xxx</groupId>
<artifactId>yyy</artifactId>
<version>0.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>zzz</mainClass>
</manifest>
<manifestEntries>
<Class-Path>./configs/</Class-Path>
</manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
<configuration>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
<archive>
<manifestEntries>
<Class-Path>configs/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/configs</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xxx</groupId>
<artifactId>core</artifactId>
<version>LATEST</version>
</dependency>
</dependencies>
</project>
我在这一行失败了:
LogManager.getLogManager().readConfiguration(MethodHandles.lookup().lookupClass().getClassLoader().getResourceAsStream(fileName));
getResourceAsStream 返回 null,但是当我从 pom 文件中删除 poi-ooxml 依赖项时,一切正常。
最佳答案
问题出在 Apache Assembly 插件中。请改用 Apache Shade 插件。 https://maven.apache.org/plugins/maven-shade-plugin/
关于java - 使用 poi-ooxml 破坏了资源提供,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39510759/
上下文: 尝试使用 Apache POI 的 poi 和 poi-ooxml 4.0.0 版本 jar 打开 XLSX 文件 问题: 程序抛出错误,如下所示。当我使用 4.0.0 版本时,我发现此错误
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
我收到了奇怪的 XLSX 文件 (OOXML)。以下是其工作表 (xl/worksheets/sheet1.xml) 的一些代码片段: 33
我正在调试 Word Office js 加载项。它需要做的一件事是在 Word 文档中创建一个隐藏部分。为此,我将一些信息传递给创建 OoXML 字符串的 JavaScript 函数。我让用户能够在
我在使用 MS 的 Open XML SDK 2.0 创建 XLSX 文档时遇到问题。 我的问题是我需要在 Excel 工作表中显示其中一些非法字符,但如果我只是将它们添加到工作表中,文档将不会加载。
在 OOXML 中,诸如粗体、斜体等格式可以(并且常常令人烦恼地)在多个元素之间分割,如下所示: This
我正在尝试从 .docx 翻译一些格式规范模板到 LaTeX, 并且正在努力使其准确应对学术挑战。 考虑以下 Office Open XML 片段:
我需要能够根据文件的内容而不是文件的扩展名来识别给定文件是 OOXML 文件。 OOXML 文件实际上是 zip 容器中的 XML 和文本文件的集合,这意味着我不能使用文件的魔数(Magic Numb
如何创建启用跟踪更改的 .docx?里面有人告诉我word/settings.xml我应该修改 w:proofState但是我发现 OOXML 在线文档中的所有信息都与语法和拼写检查有关,但与启用跟踪
ElementTree (Python 2.7) 看不到根元素的属性,例如标签 - 拿一本空字典。我想要“即时”获取用于处理标签的 namespace 。库 xml.dom.minidom 工作正常
系统说明 使用 OOXML 生成文档的绘图组件。 绘图组件由几个部分组成。所有部分都用 C++ 编写为 exe + dll,但 OOXML 文档的接口(interface)除外。后一个组件是在 C#/
我无法获取 header 的 OOXML。根据documentation getHeader”方法将返回 Body 类型。 Body 有一个获取 OOXML 的方法。但看起来它没有返回 OOXML。也
我正在尝试使用外部配置文件制作 jar 文件。在使用 poi-ooxml 库之前一切正常。之后我遇到了资源提供的问题。我使用下一个 pom.xml: 4.0.0 xxx y
我一直在尝试通过 office-js insertOoXML() 方法将 OOXML 插入到 word 文档的正文内容中。我什至尝试了最简单的实现(认为我在尝试替换 XML 本身中的 fieldCod
我下载了 OOXML SDK。我需要创建一个简单的 Excel 电子表格,其中包含 x 个工作表,每个工作表有 4 列和 y 行数据。这很简单,但我找不到任何地方如何创建工作表的示例。 最佳答案 根据
我有一个很大的 XML 文件(来自 Microsoft Word),其中包含表格、段落等。我试图获取两个元素之间的所有 XML。例如,我想获取这两者之间的所有 XML #StartHe
我一直在查看 excel 生成的一些 xml 文件,发现要定义单元格的内容,它会执行如下操作: 1 在别处引用 sharedString.xml 文件的地方。 所以我的问题是,是否可以将文本内容直
好吧,这有点奇怪。我已经从 apache-poi 3.9 版源代码 http://archive.apache.org/dist/poi/release/src/ 但是我找不到 poi-xml-sch
当我尝试使用 apache poi 3.17 读取 doc 文件的内容时,出现以下错误: java.lang.IllegalArgumentException: The document is rea
我正在学习使用 Selenium 和 Excel 进行数据驱动测试。我正在参加一门在线类(class),要求在 Maven 中添加 Apache poi 和 poi-ooxml 依赖项。 我正在努力理
我是一名优秀的程序员,十分优秀!