maven 相关问题

Apache Maven是一个构建自动化和项目管理工具,主要用于Java项目。此标记用于与特定Maven版本无关的问题。使用gradle标签代替与Gradle相关的问题。

android studio中的gradle找不到本地maven依赖

Android studio 找不到显然在我的本地存储库中的依赖项。错误: 错误:找不到:com.poppy:tutti-frutti-dtos:1.0.0-SNAPSHOT 在项目结构中打开 FileOpen 迪...

回答 0 投票 0

kotlin Junit 的 pom.xml 文件失败,并显示“ClassSelector [className = 'InventoryTest'] 解析失败”

我正在尝试使用 JUnit 设置一些 kotlin 测试,但是当尝试运行测试时,出现以下错误: 发生内部错误。 org.junit.platform.commons.JUnitException:带有...的 TestEngine

回答 1 投票 0

为 javax.persistence 编写 Maven 依赖项

有人可以帮我写javax.persistence的依赖吗?我用谷歌搜索过但没有任何效果。 我偶然发现了这个页面,其中提供了有关如何编写依赖项的一些详细信息,但我是...

回答 5 投票 0

自从 Chrome 124 更新以来,Selenium-java 冻结并崩溃了我同时运行多个测试的计算机

提前道歉,这是我的第一个问题。 4 月 16 日 Google Chrome 更新到 v124 后,我现在无法运行包含 64 个测试的 XML 文件,而不会使我的计算机冻结和崩溃。 我有

回答 1 投票 0

来自 ch.fortysix 的 Maven-postman-plugin 配置用于目标 Surefire-mail 获取 SurefireMailMojo 未知来源

我正在尝试发送一封电子邮件,其中包含 surfire-report 作为附件。我按照文档描述进行了 Surefire-mail 的配置,但出现以下错误: com.google.inject.

回答 1 投票 0

Surefire 不会在更高版本的 Maven 3.9.6 上从测试输出目录执行测试

我已经将maven从3.5升级到3.9.6。到目前为止,我没有更改 pom.xml 中的其他配置或升级了 Surefire 版本。 我的项目 pom.xml 中的 Surefire 配置如下所示: <

回答 1 投票 0

Maven JavaDoc 插件不尊重语言偏好

我已经设置了 Maven JavaDoc 插件来将我的 JavaDoc 注释转换为静态 HTML 站点。但是,即使我已将语言首选项设置为英语,生成的网站仍是德语。请注意我的

回答 1 投票 0

Mule Maven 插件 3.8.0 未按预期工作

当我使用 mule-maven-plugin 版本 3.5.4 时,我能够在 Anypoint Studio 中成功构建和运行项目,但是当我将 mule-maven-plugin 版本更新到 3.8.0 时,对于同一个项目,. ..

回答 2 投票 0

Spring Cloud 配置服务器 - 用于刷新密钥的空数组

我有一个 Spring Cloud 配置服务器,如本存储库中所示 以及这个仓库中的一个客户端 以下是我的POM文件 我有一个 Spring Cloud 配置服务器,如这个 repo 还有这个 repo 中的客户 以下是我的POM文件 <?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> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.8.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.ali.wassouf.spring.cloud.client</groupId> <artifactId>cloud-config-app</artifactId> <version>0.0.1-SNAPSHOT</version> <name>cloud-config-app</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version> </properties> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-stream-rabbit</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-monitor</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 配置服务器的application.yml server: port: 8081 spring: application: name: cloud-config-server cloud: config: server: monitor: github: enabled: true gitee: enabled: true git: password: ${PASSWORD} username: ${USERNAME} uri: https://github.com/Ali-Wassouf/springcloudconfigrepo search-paths: '{application}' 该服务器提供的配置存储库具有以下结构 . +-- serviceA | +-- application-dev.properties | +-- application-prod.properties +-- serviceB | +-- application-dev.properties | +-- application-prod.properties 我为配置存储库配置了一个 Webhook。 我还有一个本地运行的rabbitMQ镜像。 当我将更改推送到配置存储库时,我会在控制台上看到这些行 o.s.c.c.monitor.PropertyPathEndpoint : Refresh for: *:prod s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f: startup date [Mon Nov 23 18:55:19 CET 2020]; root of context hierarchy o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on [class org.springframework.cloud.config.client.ConfigServiceBootstrapConfiguration$RetryConfiguration]: java.lang.IllegalStateException: Could not obtain annotation attribute value for public abstract java.lang.Class[] org.springframework.boot.autoconfigure.condition.ConditionalOnClass.value() trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$aacb9e64] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7d2d9a8f: startup date [Mon Nov 23 18:55:20 CET 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f o.s.boot.SpringApplication : Started application in 1.515 seconds (JVM running for 31.102) s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@7d2d9a8f: startup date [Mon Nov 23 18:55:20 CET 2020]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c943d8f: startup date [Mon Nov 23 18:55:19 CET 2020]; root of context hierarchy o.s.cloud.bus.event.RefreshListener : Received remote refresh request. Keys refreshed [] 刷新的键数组为空 我尝试更改为较旧版本的 Spring Boot/Cloud 以及较新版本,但这不起作用。 我见过与我的情况类似的问题,但没有一个有任何答案。 在您的 application.yml 中,您已定义 spring.cloud.config.server.git.search-paths 配置键。然而,从 spring 官方文档中查看this doc,关键似乎应该是 searchPaths(snakeCase,没有破折号)。 因此,我认为你的application.yml应该看起来像这样: server: port: 8081 spring: application: name: cloud-config-server cloud: config: server: monitor: github: enabled: true gitee: enabled: true git: password: ${PASSWORD} username: ${USERNAME} uri: https://github.com/Ali-Wassouf/springcloudconfigrepo searchPaths: '{application}' 问题出在客户端,缺少 Spring Cloud 配置以及 Spring Cloud 的依赖管理。 将此依赖项添加到客户端代码中 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> 并添加此依赖管理 <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 解决了问题。

回答 2 投票 0

使用 SBT 发布到 SFT 解析器时更新 maven-metadata.xml

我正在尝试将工件发布到 SFTP 解析器。经过一些初步的努力,以下配置工作正常: publishTo := Some(Resolver.sftp("foo-resolver", "domain", 22, "path/to/rep...

回答 2 投票 0

Gradle 构建无法从 master 以外的分支获取 Bitbucket maven 存储库的依赖关系

所以,我在 BitBucket 上创建了一个自定义 Maven 存储库。 这些是我遵循的步骤: 首先我创建了库的aar ./gradlew:设计系统:组装 然后我发布到本地仓库 评估后...

回答 1 投票 0

org.apache.maven.plugin.MojoExecutionException:maven 安装时

在 springboot 项目的调试中运行 maven 命令时,我收到 NullPointerException。我添加了 spring kafka 依赖项。 org.apache.maven.lifecycle.LifecycleExecutionException:...

回答 2 投票 0

尽管启用了 Lombok,Eclipse 仍报告“未使用该字段的值”警告

我在 Eclipse 项目中有 2 个类。 包com.example; 导入 lombok.Getter; 导入 lombok.experimental.Accessors; @Accessors(流畅= true) @盖特 公共类 MyBean { 私有字符串...

回答 4 投票 0

启动测试运行时时发生意外错误

我正在使用 org.eclipse.tycho:tycho-surefire-plugin:4.0.7:test 启动 eclipse 插件项目的测试套件。 该进程在能够运行任何测试之前崩溃。 Windows 上的错误: [错误]F...

回答 1 投票 0

在多模块项目中发现错误/Maven 构建

在将 Spotbug 添加到我的多模块项目期间,我遇到了一个问题: 无法在项目 %X 上执行目标:无法解析项目 %X:war:1.0.1-SNAPSHOT 的依赖项:找不到 %Y。 1-

回答 2 投票 0

将 spring boot 应用导入到另一个项目中

所以我尝试在另一个项目(测试框架)中添加一个 spring boot 可执行 jar 作为依赖项。 但是一旦添加到 pom 并导入。 Java 导入无法正常工作。如果我看的话

回答 2 投票 0

我在.m2目录中找不到本地.jar文件

我想使用publishToMavenLocal创建一个本地存储库,但是在使用此命令后(即使使用IntelliJ IDEA IDE中的内置按钮),我仍然找不到最终目录(测试):&...

回答 1 投票 0

我的 POM 有什么问题吗? “解析表达式..检测到递归表达式循环”

所以我有一些包含运行时参数的 TestNG SuiteXML 文件,如下所示:- 所以我有一些包含运行时参数的 TestNG SuiteXML 文件,如下所示:- <!--SERVER AND TARGET PARAMS--> <parameter name="environment" value="${environment}"/> <parameter name="port" value="${port}"/> 我的 POM 看起来像这样: <?xml version="1.0" encoding="UTF-8"?> http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 <groupId>co.uk.multicom.test.project</groupId> <artifactId>fab-handler-automation</artifactId> <version>1.0-SNAPSHOT</version> <properties> <sl4j.version>1.7.7</sl4j.version> <suiteFile>${suiteFile}</suiteFile> <environment>${environment}</environment> <port>${port}</port> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> <configuration> <systemProperties> <property> <name>javax.xml.parsers.SAXParserFactory</name> <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value> </property> <property> <name>user.language</name> <value>en</value> </property> </systemProperties> <!--<testFailureIgnore>true</testFailureIgnore>--> <suiteXmlFiles> <suiteXmlFile>${suiteFile}</suiteXmlFile> </suiteXmlFiles> <systemPropertyVariables> <environment>${environment}</environment> <port>${port}</port> </systemPropertyVariables> <properties> <property> <name>parallel</name> <value>methods</value> </property> <property> <name>threadCount</name> <value>1</value> </property> <property> <name>dataproviderthreadcount</name> <value>1</value> </property> </properties> </configuration> </plugin> </plugins> </build> <dependencies> <!-- https://mvnrepository.com/artifact/com.jayway.restassured/rest-assured --> <dependency> <groupId>com.jayway.restassured</groupId> <artifactId>rest-assured</artifactId> <version>2.9.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.6</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.9.10</version> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>htmlunit-driver</artifactId> <version>2.21</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>net.sourceforge.jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6.12</version> </dependency> <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.21</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.21</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <!-- pom.xml --> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>3.0.0</version> </dependency> </dependencies> 我的错误是: [ERROR] Resolving expression: '${environment}': Detected the following recursive expression cycle in 'environment': [environment] -> [Help 2] [ERROR] Resolving expression: '${port}': Detected the following recursive expression cycle in 'port': [port] -> [Help 2] 我是不是傻了?可能我毕竟只是一个测试人员,脑子很小。谁能帮我解决问题吗?我的 POM 看起来湿漉漉的吗? 在我可以修复它之前,它不会将我所需的 jar 下载到本地 .m2 - 我尝试过吹走 .m2 并执行 mvn install 等......没有喜悦。 你的错误来自这部分: <properties> <sl4j.version>1.7.7</sl4j.version> <suiteFile>${suiteFile}</suiteFile> <environment>${environment}</environment> <port>${port}</port> </properties> 当您使用 ${port} Maven 会在 <port>X</port> 中查找值,此处 X=${port} 等等...这就是为什么您会在这里遇到递归问题 我不确定,因为我只有时间快速查看,但定义一个属性然后将该属性分配给自身是我认为您所做的事情,也是导致错误的原因。 你不能在你的pom中使用${suiteFile}而不在你的<properties></properties>中定义它吗? 或者你可以在pom中使用另一个属性名称吗? 例如: <properties> <suiteFile1>${suiteFile}</suiteFile> <environment1>${environment}</environment> <port1>${port}</port> </properties> 并在你的 pom 中进一步使用它们? 也许你可以阅读maven文档,它会告诉我们不支持你写的格式。 https://maven.apache.org/pom.html#Properties 也许可以尝试以下方法: <profiles> <profile> <id>test</id> <activation> <activeByDefault>true</activeByDefault> <os> <family>mac</family> </os> </activation> <properties> <suiteFile>${suiteFile}</suiteFile> <environment>${environment}</environment> <port>${port}</port> </properties> </profile> </profiles> 并执行: clean package -pl ${project_name} -am -Denv=prod -DskipTests=true 注意: ${project_name} 是您的项目名称 我描述可能有错误,你可以试试 我在 pom.xml 的以下配置中遇到了同样的问题 <properties> <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> </properties> .... <profiles> <profile> <id>envTestsXml</id> <properties> <suiteXmlFile>testngEnv.xml</suiteXmlFile> </properties> </profile> <profile> <id>pipelineTestsXml</id> <properties> <suiteXmlFile>testngPipeline.xml</suiteXmlFile> </properties> </profile> </profiles> ...... <configuration> <suiteXmlFiles> <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> </suiteXmlFiles </configuration> 我的目标是根据运行测试的环境动态选择所需的 testng.xml,maven 命令如下所示: mvn test -PpipelineTestsXml -Duri=http://localhost:8000/api 或 mvn test -PenvTestsXml -Duri=https://some-url.com 即使我收到错误:解析表达式:'${suiteXmlFile}':在'suiteXmlFile'中检测到以下递归表达式循环:[suiteXmlFile] 测试仍然可以成功运行,但我同意 pom.xml 上出现此错误看起来不太好。 或者我尝试删除 <suiteXmlFile>${suiteXmlFile}</suiteXmlFile> 来自属性部分,它仍然导致此错误 无法解析符号“suiteXmlFile” 一切都再次按预期进行。 我无法找出实现我的目标的方法,而且 pom.xml 文件没有错误,所以如果有人遇到同样的问题,请随时分享您是如何解决的。 我今天也遇到了同样的问题。更有趣的是,这是在我几分钟前成功执行同一个项目之后。事实证明,构建配置有错误,其中命令(清理包等)被写入配置文件中。 愚蠢的错误,但让我花了一些时间,而它早些时候工作的原因是因为我手动输入命令而不是使用保存的构建配置。

回答 5 投票 0

不同版本的spring boot项目作为依赖

我有一个场景,服务A在Spring Boot 3.x版本中运行,我有一个独立的通用jar(服务B),它使用Spring Boot 2.x版本。 我想使用/添加服务 B 作为依赖项...

回答 1 投票 0

创建 quarkus 项目在解析扩展目录时失败

我用巧克力安装了quarkus cli。我还安装了 Zulu 11 作为我的 Java 11,以及 maven 3.9.5。这些是按照教程创建一个简单的 quarkus 应用程序所需的要求...

回答 2 投票 0

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