maven 相关问题

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

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

将 java.util.logging 级别设置为 FINER,但不会打印“log.fine()”,仅打印“log.severe()”

我正在尝试在 slf4j 过滤器中使用 java.util.logging,因为我无法在那里使用 slf4j 记录器。 我正在使用 Java 11 并使用 Maven 进行构建。 由于某种原因,我可以将 SEVERE、INFO 和 WARNING 日志发送到

回答 1 投票 0

Tomcat webapp 类加载器不支持运行时编译

我有一些在运行时生成并使用 JavaCompiler.CompilationTask。 生成的代码引用其他项目中依赖 Maven 的类...

回答 3 投票 0

注册后,将打开以下页面:https://myApp.by/assets/inputmask/jquery.inputmask.min.js

用户注册并登录后,打开以下页面: https://myApp.by/assets/inputmask/jquery.inputmask.min.js 在此输入图像描述 为什么当你第一次登录时它不会进入 h...

回答 1 投票 0

无法获取 Liquibase 的 ChangeLogParser 的公共无参数构造函数

使用maven,我的pom.xml中有liquibase-core依赖项: org.liquibase liquibase 核心 <

回答 1 投票 0

StreamCorruptedException 仅在 Spring Boot 应用程序中读取资源文件

在 Spring Boot 应用程序 (2.3.3) 上,我依赖于我公司开发的模块。从服务中,我从该依赖项调用一个方法,该方法需要从资源加载文件(src ...

回答 1 投票 0

在open-api-maven-plugin中,生成客户端jar时如何标记特定参数不生成?

我有这个配置,如何避免在最终的openapi客户端中添加Test-Token,因此这个方法签名不会是test(String testToken)而是test() ... “路径”...

回答 1 投票 0

使用 Intellij IDEA 构建项目时 Maven Surefire 插件“启动 fork 时出错”

我尝试使用 Intellij IDEA 构建一个带有 Maven 的 Java 插件,直到遇到错误: [信息] ---------------------------------------------------------- ------------------------ [信息] 构建失败 [

回答 2 投票 0

Maven 错误 - 需要 START_TAG 或 END_TAG,而不是 TEXT

我正在使用 Eclipse Indigo 从头开始设置 spring mvc Web 应用程序 + hibernate jpa + maven。我在进行 Maven 构建时遇到了这个错误。 [错误] 构建错误 [信息] --------------...

回答 12 投票 0

如何使用maven从现有数据库生成美人鱼ERD图?

我想将 mermaid ERD 图添加到项目文档中,但它需要在架构更改时自动更新。 数据库模式是使用 liquibase 定义的,我使用 Maven 进行构建。

回答 1 投票 0

Eclipse Maven 项目摆脱了 wb 资源警告

我的 Eclipse Luna 中的 Maven 项目给了我这两个警告: 破坏单根规则:Web 项目或 EAR 项目仅允许一个部署路径为“/”的元素 和 坏了...

回答 5 投票 0

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