- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建自定义标签,我希望将其作为单个 jar 文件提供。我似乎遇到了 tld 文件以及如何将其包含到构建过程中的问题。
我当前的文件夹结构:
src
license.md
main
java
my.package
class1.java
class2.java
resources
META-INF
customtag.tld
部分pom.xml(.tld
文件默认不包含在构建过程中)
<resources>
<resource>
<directory>${basedir}/src/main/resources/META-INF</directory>
<targetPath>META-INF</targetPath>
<filtering>true</filtering>
<includes>
<include>customtag.tld</include>
</includes>
</resource>
上面的工作但是:
第一个问题:Maven 中是否有一些设置默认包含 ${basedir}/src/main/resources/META-INF
文件夹内容?
替代方法:
src
license.md
ckeditor.tld
main
java
my.package
class1.java
class2.java
部分pom.xml(.tld
文件默认不包含在构建过程中)
<resource>
<directory>${basedir}</directory>
<targetPath>META-INF</targetPath>
<filtering>true</filtering>
<includes>
<include>customtag.tld</include>
</includes>
</resource>
通过这种方法,pom.xml
中没有长路径,也没有在 Netbeans 项目 View 中创建额外的分支,但我不确定该位置是否正确。我找到了很多这样的链接 Where do I put the .tld file so that the resulting JAR file built with maven2 is properly packaged?其中表示项目代码中的 tld 文件应放入 src/main/resources/META-INF
。
第二个问题:Maven 项目中 .tld
文件的正确/推荐位置是什么?请注意,我问的是项目位置,而不是创建的 jar 文件中的位置(它必须是 META-INF
,我知道)。
最佳答案
我想我已经设法解决了我的问题,以下是答案:
First Question: Is there some setting in Maven which will include
${basedir}/src/main/resources/META-INF
folder contents by default?
我花了相当多的时间在互联网上搜索,我可以说不,没有,你需要在pom.xml
中写条目这将做到这一点。
Second Question: What is the correct/recommended location of the tld file inside the Maven project?
似乎正确或推荐的位置是 src/main/resources/META-INF
毕竟。
我的问题的解决方案:我复制了我的 .tld
<resources>
中定义的文件在 <build>
level .
<resources>
<resource>
<directory>${basedir}/src/main/resources/META-INF</directory>
<targetPath>META-INF</targetPath>
<filtering>true</filtering>
<includes>
<include>customtag.tld</include>
</includes>
</resource>
<resources>
我已将该资源移至 <resources>
的 maven-resources-plugin .目录的路径仍然很长,但这是我可以接受的,尤其是通过这种方法我可以保留我的 .tld
。文件在 src/main/resources/META-INF
Netbeans Project View 中那个烦人的额外分支现在消失了。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources/META-INF</directory>
<targetPath>META-INF</targetPath>
<filtering>true</filtering>
<includes>
<include>customtag.tld</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
关于java - Maven 项目中 TLD 文件的正确/推荐位置是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32568966/
我似乎明白 TLD 后的点无关紧要,例如: http://example.com/somepage/ == http://example.com./somepage/ (注意 TLD 后面的点) 我的
我正在尝试运行一个简单的自定义 jsp 程序,但它不起作用,我使用的是 tomcat 8.5 和 ubuntu 14.04,我还将 custom.tld 放在 WEB-INF older这是我的代码
我正在尝试将应用程序发布到门户服务器上,由于无法在 WEB-INF 目录中找到 .tld 文件,因此 pu8blication 失败。 tld is 文件实际上不在 WEB-INF 目录中,我们将 t
这些文件应该提交给版本控制,还是重新生成: web-app/WEB-INF/tld/c.tld web-app/WEB-INF/tld/fmt.tld grails integrate-with --
我一直在 tomcat 7.30 (eclipse juno) 上得到这个 At least one JAR was scanned for TLDs yet contained no TLDs. E
TL;DR 我应该从 www.domain.tld 重定向到 domain.tld 还是相反? 我正在运行一个处理多个域的 CMS。到目前为止,CMS 负责将 www.domain.tld 重定向到
过去几天我一直在纠结这个 JSTL 问题。任何帮助表示赞赏。 Tomcat 6.0.28 eclipse :太阳神 pom.xml: javax.servlet jstl 1.1
我在使用 JSP 编写的新项目中遇到了问题。一些细节:- 使用 tomcat6。- 使用 Java 甲骨文 6。- 开发智能。 当通过 Inteliji 解聚和运行应用程序时,我总是遇到这个错误:
在将我们的 Web 应用程序主要升级到 ivy 以进行构建管理之后,我遇到了一些不寻常的错误,其中还包括更新所有涉及的主要库。当我们设法通过单元测试时,当我们将 Web 应用程序部署到 Tomcat
我使用 STS 插件从 Spring 模板创建一个 Spring MVC 项目。但是,当我运行该应用程序时出现错误: org.apache.jasper.JasperException: /WEB-I
是否可以使用 .htaccess 重写规则将子子域重定向到子域,并将子子域作为新文件夹? 例如...当我访问 2013.archive.example.com 时,我希望最终到达 archive.ex
我创建了一个自定义标签并包含以下 Maven 依赖项,以便获取所需的 java 类(标签支持等) javax.servlet jsp-api
我在 tomcat 8 上遇到问题,在 Tomcat 7 中运行 Web 应用程序时不会出现此问题。错误的详细信息 org.apache.jasper.JasperException: Mandato
感谢专家的帮助。 我被要求将客户的 WordPress 主页放在一个 TLD(即 domain.eu)上,并将所有其他页面/目录 301 到不同的 TLD 扩展名(即 domain.com/every
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Internal subdomain to folder redirect 我希望它是自动的,因为我正在为
我安装了 Magento,想知道如何将 domain.tld/index.php 重定向到 domain.tld? 我想删除 index.php 然后 301 回到 root。我有很多旧链接,这些链接
我正在尝试将 nginx 配置为: http://www.domain.tld --> https://domain.tld http://domain.tld --> https://domain.
我需要匹配主机名 - 但不需要 tld: example.com =~/regex/=> 示例 sub.example.com =~/regex/=> sub.example sub.sub.exam
我想将此函数导出到我的 custom-functions.tld 文件: package com.site.vo; public class Utils { public static Str
我已经创建了一个自定义 tld 文件。并包含在我的jsp中。 myJsp ... pageContext.setAttribute("pageBean", myPageBean); pageCont
我是一名优秀的程序员,十分优秀!