maven-3 相关问题

Apache Maven是一个用于项目管理和构建自动化的工具。此标记用于与Maven版本3.x相关的问题。对于非特定版本的问题,请使用[maven]标记。

GitHub Actions:缓存存储库以加速 Maven 构建

每次触发构建工作流程时都会下载 Maven 依赖项。 Travis CI 提供了一种缓存 Maven 存储库的方法。 GitHub Actions 是否提供类似的功能,允许缓存...

回答 7 投票 0

无法运行 git-commit-id-plugin 一次并在子项目中使用

在我的项目的根目录中是pom.xml和.git。我的 maven pom.xml 如下所示: git .gi...

回答 1 投票 0

Maven spring boot 带参数运行调试

通常我使用以下命令运行 Spring Boot 应用程序: mvn spring-boot:run -Drun.arguments=--server.port=9090 \ -Dpath.to.config.dir=/var/data/my/config/dir 我想将自定义端口设置为 d...

回答 6 投票 0

将 Maven 依赖项声明为仅测试运行时

将 Maven 依赖项声明为仅用于测试运行时(但不用于测试编译)类路径的最佳方法是什么? 具体来说,我希望 slf4j-api(日志记录门面)作为典型的合作...

回答 5 投票 0

Maven 无法从本地存储库找到包

我遇到了一个奇怪的问题。 我有两个使用 Maven 构建的 spring-boot 项目。他们被称为客户和休息客户。 它们基于 spring-boot 3.2.2 并使用 Maven 作为构建工具。 妈...

回答 2 投票 0

Maven 命令行选项有哪些?

我正在寻找 Maven 2.2 的选项列表,但找不到它。如果有人知道位置请留言。谢谢。 我发现了以下内容,但我对 Maven 的了解还不够,不知道哪个...

回答 2 投票 0

有办法控制Surefire插件的Report吗?

如果我们不想生成它,是否可以控制 Maven 项目(目标文件夹)列出的文件夹? 其中一个名为“surefire-reports”的项目来自“maven-surefire-plugin”,我们可以拥有

回答 2 投票 0

未找到有效的 Maven 安装。在配置对话框中设置主目录或在系统上设置 M2_HOME 环境变量

我正在使用intellij,我的M2和M2_HOME已设置并位于.bash_profile中,但是我有这个错误: 未找到有效的 Maven 安装。在配置对话框中设置主目录...

回答 5 投票 0

Tomcat 10 的 Maven 插件

我正在尝试在新的 Maven 项目中更新我的插件,如下所示 org.apache.tomcat.maven 我正在尝试在我的新 Maven 项目中更新我的插件,如下所示 <!-- Tomcat Maven Plugin --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat10-maven-plugin</artifactId> <version>10.1.2</version> <configuration> <server>TomcatServer</server> <url>http://localhost:8080/manager/text</url> <path>/foundraising</path> </configuration> </plugin> 但是出现错误 Could not find artifact org.apache.tomcat.maven:tomcat-maven-plugin:pom:10.1.2 in central (https://repo.maven.apache.org/maven2) 我使用的是maven 3.8.1 IntellijIDEa 2023.1.2 感谢您的帮助 官方存储库中不存在这样的tomcat10-maven-plugin(也许您的公司有自己的私有存储库,其中可能提供此类专有依赖项。 基于官方 Tomcat Maven 插件 Github 存储库,有两个 Maven 模块,每个模块对应一个单独的工件: tomcat7-maven-plugin:https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat7-maven-plugin <dependency> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> </dependency> tomcat8-maven-plugin:https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin <dependency> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat8-maven-plugin</artifactId> <version>3.0-r1756463</version> </dependency> 目前还没有 tomcat9-maven-plugin 或 tomcat10-maven-plugin 之类的东西。 另一方面,有一个讨论对 Tomcat 9 支持的问题:#30。

回答 1 投票 0

为什么Maven更新时自动下载Log4j 1.2.16

我正在做一个JAVA Maven项目,主要是使用logback和slf4j进行配置。我在 Maven 依赖关系树中看不到任何 Log4j 依赖关系,这意味着 Log4j 不是传递性地来自...

回答 1 投票 0

如何在 Maven 中从具有不同模块的同一项目中创建 2 个原型

我有一个包含模块 A 和模块 B 的项目,我想分别创建 2 个工件,1. 打包了模块 A + 模块 B,另一个项目仅打包了模块 B。这两者都会有所不同...

回答 1 投票 0

Jenkins SVN 插件在删除文件时失败(校验和不匹配)

今天我们在 Jenkin 中遇到了一个奇怪的错误。经过排查,发现是由于我们删除了SVN中的一些文件,导致Jenkin SVN插件出现问题。 当我调查时...

回答 2 投票 0

为什么以及如何避免Maven在mvn包上替换jsp中的${id}

当我“mvn package”我的web应用程序时,jsp中所有出现的${id}都被替换为 com.domainname.projectname:project-warname:war:0.0.1-SNAPSHOT Maven 版本 3.0.5 pom.xml: <

回答 4 投票 0

在哪里可以找到 spring boot 3.1.3 属性名称来覆盖reactor-netty-http版本

在哪里可以找到正确的 spring boot (v3.1.3) 属性名称 - 我可以在 pom.xml 中使用它来覆盖默认的reactor-netty-http版本(在“spring-boot-starter-reactor-netty”中) ”)...

回答 1 投票 0

Java的Maven工具,如何使用mvn卸载包?

Java、mvn工具,如何使用mvn卸载包?有一些插件、工具、shell脚本和命令方法吗?

回答 3 投票 0

无法使用maven解决依赖关系

我正在运行 Maven 3.8.9,这就是我在 pom.xml 中的内容 中央 Maven 存储库切换...

回答 2 投票 0

Maven pom.properties 文件中的自定义值

我正在尝试在 Maven 在 META-INF/maven/${groupId}/${artifactId} 位置生成的 pom.properties 文件中添加自定义值 org.apache.maven.plugins 我正在尝试在 Maven 在 META-INF/maven/${groupId}/${artifactId} 位置生成的 pom.properties 文件中添加自定义值 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration> <archive> <manifestEntries> <build>${BUILD_TAG}</build> </manifestEntries> <addMavenDescriptor>true</addMavenDescriptor> <pomPropertiesFile>${project.build.directory}\interface.properties</pomPropertiesFile> </archive> </configuration> </plugin> interface.properties文件的内容是 # Build Properties buildId=746 使用文档我已将pomPropertiesFile元素指向外部属性,但运行后生成的pom.properties文件仍然具有默认内容mvn install pomPropertiesFile元素的正确用法是什么? 编辑 我认为问题出在 org.apache.maven.archiver.PomPropertiesUtil 上。如果您查看 source 中的方法 sameContents,如果外部文件中的属性与默认值相同,则返回 true;如果不同,则返回 false。如果 sameContents 的结果为 false,则忽略外部文件的内容。 果然,这已经被记录为错误 我认为你需要在 src/main/resources/META-INF/${groupId}/${artifactId}/interface.properties 下放置一个文件,并让 maven 执行过滤工作(配置过滤)。该文件将自动复制到 target/META-INF/maven/${groupId}/${artifactId}/ 位置。 参见 https://issues.apache.org/jira/browse/MNG-4998 Maven 3 在读取 pom.xml 时将立即解析属性占位符以获取此时可用的所有属性值。稍后修改这些属性不会影响 pom.xml 中已解析的值。 但是,如果属性值不可用(没有默认值),则占位符将不会被该值替换,并且稍后仍可以将其作为占位符进行处理。例如,如果插件将在构建过程中生成某些属性,或者如果插件在某个构建步骤中读取并处理占位符。

回答 2 投票 0

使用 maven 构建时 jar 文件被损坏

在构建 war 文件时,我将一组 jar 从某个位置复制到 war 内的文件夹中。虽然文件确实被复制,但我认为它们被损坏了,因为 t 的相同类文件...

回答 6 投票 0

Apache POI 与 Apache Felix 的使用

我正在尝试将 Apache POI 导入 Atlassian Jira 插件以读取 excel 文件。 一开始,我开始只是添加 org.apache.poi 我正在尝试将 Apache POI 导入 Atlassian Jira 插件以读取 excel 文件。 一开始,我只是添加了 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> poi.版本是3.14 然后当我启动插件时它给出了 Unresolved constraint in bundle com.tezExtensions [165]: Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=com.sun.javadoc) 然后我用一些指令编辑了 pom,这些指令是我在另一个 StackOverflow 问题中找到的 Pax Exam 问题与 Apache POI 包装的捆绑包 <instructions> <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key> <!-- Add package to export here --> <Export-Package>com.sony.poc.api,</Export-Package> <_exportcontents> org.apache.poi.*;version=${poi.version}, org.openxmlformats.schemas.*;version=${poi.schema.version}, schemasMicrosoftComOfficeExcel.*;version=${poi.schema.version}, schemasMicrosoftComOfficeOffice.*;version=${poi.schema.version}, schemasMicrosoftComOfficePowerpoint.*;version=${poi.schema.version}, schemasMicrosoftComVml.*;version=${poi.schema.version}, org.etsi.uri.*;version=${poi.security.version} </_exportcontents> <!-- Add package import here --> <Import-Package> com.sun.javadoc;resolution:=optional, com.sun.tools.javadoc;resolution:=optional, org.apache.crimson.jaxp;resolution:=optional, org.apache.tools.ant;resolution:=optional, org.apache.tools.ant.taskdefs;resolution:=optional, org.apache.tools.ant.types;resolution:=optional, junit.framework.*;resolution:=optional, junit.textui.*;resolution:=optional, org.junit.*;resolution:=optional, org.apache.xml.security.*;resolution:=optional, org.apache.jcp.xml.dsig.internal.dom.*;resolution:=optional, org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package> <DynamicImport-Package> org.apache.xmlbeans.*, schemaorg_apache_xmlbeans.* </DynamicImport-Package> 使用此配置,我收到此错误; Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver) 有人有想法吗? 终于找到解决办法了。 我已将它们添加为依赖项 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> <exclusions> <exclusion> <groupId>stax</groupId> <artifactId>stax-api</artifactId> </exclusion> <exclusion> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>woodstox-core-asl</artifactId> <version>4.4.1</version> </dependency> 还将这些添加到 Import-Package 标签内部 *;resolution:=optional, com.ctc.wstx.stax.* 仅此而已。 我应该将 Atlassian Jira 的 pom.xml 放在哪里?

回答 2 投票 0

mvn 安装因“类型不兼容”而失败

我从“mvn clean install”中收到以下错误 [错误] /private/tmp/framework/src/main/java/org/jboss/narayana/txframework/api/annotation/transaction/WSBA.java:[21,65] 不兼容...

回答 3 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.