maven-plugin 相关问题

不要将此标记用于特定Maven插件的使用。仅用于Maven插件开发相关问题。

编译protobuf后缺少类

我创建了一个基本的原型文件,其中包含 2 条消息和 1 个服务。 Hellorequest 和 Helloresponse 以及 Hello 服务。 我正在 [Visual Studio Code][2] 中开发 [Maven][1] 项目。 [1]:https://

回答 0 投票 0

现在将工件部署到 archiva maven 存储库时,在 jenkins 中会出现 401 未经授权的情况

在我将 Jenkins 升级到 1.494 之前,这曾经有效。现在,当使用构建升级插件将 war 工件复制到快照存储库时,我在 Jenkins 中收到此错误: 错误:部署失败

回答 6 投票 0

无法初始化主类com.itranswarp.learnjava.Main

我跑了一个廖雪峰的MVC开发实例:(https://www.liaoxuefeng.com/wiki/1252599548343744/1337408645759009) 网页末尾有一个下载包的链接 但是

回答 0 投票 0

将工件复制到ear lib文件夹时更改jar的文件名

我有以下 maven-ear-plugin,它可以更改运行 mvn clean install 时复制到 lib 文件夹的 jar 文件的文件名(通过在其前面添加 1)。这可行,但是有没有...

回答 1 投票 0

Wildfly Maven 插件:添加资源 - 未提供资源

是否可以通过执行 wildfly:add-resource 目标来添加数据源或 jdbc 驱动程序。我只在执行“未提供资源”的目标时收到警告。 我用过...

回答 0 投票 0

maven-remote-resources-plugin 不将资源复制到其他模块

我正在尝试使用 maven-remote-resources-plugin 将资源从一个模块(合同商店)复制到多模块 maven 项目中的其他模块(api-合同)。复制所需的资源存在......

回答 0 投票 0

如何使用 Maven Assembly 插件创建包含特定文件夹及其所有文件的 ZIP 存档?

我有一个这样结构的项目 我目前正在尝试创建一个名为“wso2mi.zip”的压缩 zip 文件夹,我的目标是包括所有连续的文件和目录...

回答 1 投票 0

OpenAPI 生成器(jaxrs-spec)为 AllOf 枚举对象生成单独的类

我创建了一个规范,其中包含具有枚举值的对象。有些方法应该支持所有枚举值,因此我想只是将枚举对象作为 allOf 引用,但是那确实......

回答 0 投票 0

Maven:依赖文件夹的权限被拒绝异常?

下面是pom.xml 下面是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> <parent> <groupId>com.test</groupId> <artifactId>tel-test-parent</artifactId> <version>1.0</version> </parent> <properties> <artifactoryPackageName>wso2-esb-dist</artifactoryPackageName> <artifactoryPackageVersion>5.0.0</artifactoryPackageVersion> <artifactoryPackageClassifier>bin</artifactoryPackageClassifier> <artifactoryPackageExtension>zip</artifactoryPackageExtension> <wso2esbname>wso2esb</wso2esbname> <wso2esbversion>5.0.0</wso2esbversion> <wso2esbext>zip</wso2esbext> </properties> <groupId>com.test.cip.ff.platform</groupId> <artifactId>wso2mi</artifactId> <version>4.2.0-m1</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <id>copy-dependencies</id> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/my-dependencies-directory</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <includeBaseDirectory>false</includeBaseDirectory> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>${project.basedir}/assembly/zip.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <!-- Change file permission for all files in dependency folder (Eg. installer) --> <execution> <id>build</id> <phase>validate</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo>Creating directory for chmod command</echo> <mkdir dir="${project.build.directory}/dependency"/> <echo>Creating directory for chmod command</echo> <mkdir dir="${project.build.directory}/dependency/installer"/> <echo>run chmod in ${project.build.directory}</echo> <chmod file="${project.build.directory}/dependency" perm="ugo+rx"/> <chmod file="${project.build.directory}/dependency/**" perm="ugo+rx"/> <chmod file="${project.build.directory}/dependency/installer" perm="ugo+rx"/> </target> </configuration> </execution> <execution> <id>replace-tokens</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target name="replace-tokens"> <replace file="${project.build.directory}/bin/configure" token="@WSO2ESB_PACKAGE@" value="${wso2esbname}-${wso2esbversion}.${wso2esbext}"/> </target> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <!-- Change file permission for all files in dependency folder (Eg. installer) --> <execution> <id>build</id> <phase>validate</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo>run chmod in ${project.build.directory}</echo> <chmod file="${project.build.directory}/dependency" perm="ugo+rx"/> </target> </configuration> </execution> <!-- Replace tokens in file --> <execution> <id>replace-tokens</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <target name="replace-tokens"> <replace file="${project.build.directory}/bin/configure" token="@WSO2ESB_PACKAGE@" value="${wso2esbname}-${wso2esbversion}.${wso2esbext}"/> </target> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>run-ls-command</id> <goals> <goal>exec</goal> </goals> <configuration> <target> <echo>Logging a message from Maven!</echo> </target> <executable>ls</executable> <arguments> <argument>-lrt</argument> <argument>-R</argument> </arguments> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <!-- Copy specification file to target directory --> <execution> <id>copy-specification</id> <phase>compile</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}</outputDirectory> <resources> <resource> <directory>${project.basedir}/src/main/config</directory> <filtering>true</filtering> <include>wso2esb.specification</include> </resource> </resources> </configuration> </execution> <!-- Copy packinglist file to target directory --> <execution> <id>copy-packinglist</id> <phase>compile</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/resources</outputDirectory> <resources> <resource> <directory>${project.basedir}/src/main/config</directory> <filtering>true</filtering> <include>.packinglist</include> </resource> </resources> </configuration> </execution> <!-- Copy wso2esb configuration file to target directory --> <execution> <id>copy-wso2esb-config</id> <phase>compile</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/resources</outputDirectory> <resources> <resource> <directory>${project.basedir}/src/main/config</directory> <filtering>true</filtering> <include>wso2esb.config</include> </resource> </resources> </configuration> </execution> <!-- Copy wso2esb startup script to target directory --> <execution> <id>copy-startup-script</id> <phase>compile</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/resources</outputDirectory> <resources> <resource> <directory>${project.basedir}/src/main/config</directory> <filtering>true</filtering> <include>wso2esb_control.sh</include> </resource> </resources> </configuration> </execution> <!-- Copy validate & configure scripts to target directory --> <execution> <id>copy-installer-scripts</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/bin</outputDirectory> <resources> <resource> <directory>${project.basedir}/src/main/bin</directory> <filtering>true</filtering> <include>validate</include> </resource> <resource> <directory>${project.basedir}/src/main/bin</directory> <filtering>true</filtering> <include>configure</include> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> <profiles> <profile> <id>unix</id> <activation> <os> <family>unix</family> </os> </activation> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <!-- Build cpio package --> <executions> <execution> <id>build_package</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${project.build.directory}/dependency/installer</executable> <arguments> <argument>${project.build.directory}/resources/.packinglist -cpio ${project.artifactId}-${project.version}.cpio -unlabelled -rdir ${project.build.directory}</argument> </arguments> </configuration> </execution> </executions> </plugin> <!--<plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> Rename cpio file <execution> <phase>package</phase> <configuration> <tasks> <move file="${project.build.directory}/UNLABELLED-${project.artifactId}-${project.version}.cpio.Z" tofile="${project.build.directory}/${project.artifactId}-${project.version}.cpio.Z"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> --> </plugins> </build> </profile> </profiles> </project> 但是 mvn clean install 因错误而失败 [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (build_package) on project wso2mi: Command execution failed.: Cannot run program "/home/my_account/Desktop/CodeBase/test/test1/platform/target/dependency/installer" (in directory "/home/my_account/Desktop/CodeBase/test/test1/platform"): error=13, Permission denied 即使我尝试使用一个小型的基本 Maven,这也失败了 <?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> <!-- This is often your domain name (reversed.) --> <groupId>com.yourorganization</groupId> <!-- The name of this project (actually, the name of the artifact, which is the thing that this project produces. A jar in this case.) --> <artifactId>javaparser-maven-sample</artifactId> <!-- The version of this project. SNAPSHOT means "we're still working on it" --> <version>1.0-SNAPSHOT</version> <properties> <!-- Tell Maven we want to use Java 8 --> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <!-- Tell Maven to treat all source files as UTF-8 --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <!-- Here are all your dependencies. Currently only one. These are automatically downloaded from https://mvnrepository.com/ --> <dependency> <groupId>com.github.javaparser</groupId> <artifactId>javaparser-core</artifactId> <version>3.25.3</version> </dependency> </dependencies> <!-- This blob of configuration tells Maven to make the jar executable. You can run it with: mvn clean package java -jar target/javaparser-maven-sample-1.0-SNAPSHOT-shaded.jar --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.4.1</version> <executions> <execution> <goals> <goal>shade</goal> </goals> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.yourorganization.maven_sample.LogicPositivizer</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <id>copy-dependencies</id> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/my-dependencies-directory</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <!-- Build cpio package --> <executions> <execution> <id>build_package</id> <phase>package</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${project.build.directory}/dependency/installer</executable> <arguments> <argument> ${project.build.directory}/resources/.packinglist -cpio ${project.artifactId}-${project.version}.cpio -unlabelled -rdir ${project.build.directory}</argument> </arguments> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> 同样的错误 [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exec (build_package) on project javaparser-maven-sample: Command execution failed.: Cannot run program "C:\Users\subodhc\Downloads\javaparser-maven-sample-master\target\dependency\installer" (in directory "C:\Users\subodhc\Downloads\javaparser-maven-sample-master"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]

回答 0 投票 0

OWASP 依赖检查:将 modelVersion 版本添加到依赖检查报告

我在多模块项目中使用 OWASP 依赖检查的 Maven 插件。 目前,依赖检查提供的 XML 报告只包含以下信息,不在...

回答 1 投票 0

hbm2java 3 - 找不到映射类

我使用下面的插件生成我的实体类。 当我执行命令 mvn hibernate3:hbm2java 我确实收到了这个错误: There was an error creating the AntRun task.: An Ant BuildException has oc...

回答 1 投票 0

maven-war-plugin 在构建期间将文件复制为目录

pom.xml 片段: ${project.basedir}/src/main/resources/${dbEnv}/ pom.xml 片段: <build> <resources> <resource> <directory>${project.basedir}/src/main/resources/${dbEnv}/</directory> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> <configuration> <webResources> <resource> <directory>src\WEB-INF\</directory> <targetPath>WEB-INF</outputDirectory> <includes> <include>*.xml</include> </includes> </resource> </webResources> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> 我希望这会将文件 /src/WEB-INF/jboss-web.xml 复制到 /target/blahblahblah/WEB-INF/ 问题是它不会将其创建为 .xml 文件,而是创建一个名为 jboss-web.xml 的目录 我该如何解决这个问题?我在 RHEL 8.7 和 maven 3.5.4. 它在 Windows 上正常工作。

回答 0 投票 0

无法执行目标 org.springframework.boot:spring-boot-maven-plugin:3.0.6:repackage

我正在尝试运行示例 Maven 项目。下面是我的 pom.xml 文件 我正在尝试运行示例 Maven 项目。下面是我的 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 https://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>3.0.6</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</name> <description>Demo project for Spring Boot</description> <properties> <java.version>17</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.2.2.RELEASE</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <executable>true</executable> </configuration> </plugin> </plugins> </build> </project> 我遇到了以下错误。试图从 Spring boot maven 插件的官方文档中找到解决方案,不确定我在这里做错了什么。 错误: [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 13.835 s [INFO] Finished at: 2023-04-23T09:30:45Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.6:repackage (repackage) on project demo: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:3.0.6:repackage failed: Unable to find main class -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.6:repackage (repackage) on project demo: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:3.0.6:repackage failed: Unable to find main class at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) 我尝试根据 Spring Boot Maven 插件文档修改 pom.xml 文件,但还没有找到任何答案。

回答 0 投票 0

How to run Liquibase on jar execution using Maven?

我有一个带有 Liquibase 的 Maven 项目,我想通过执行 jar 文件来运行它。目前,我只能使用 Liquibase Maven 插件的版本 3.10.3 使其在构建阶段工作。我...

回答 0 投票 0

maven maven-antrun-plugin插件是否也可以像maven-install-plugin一样运行

请参考https://maven.apache.org/plugins/maven-antrun-plugin/plugin-info.html 在 Maven 中使用 antrun 插件时,我似乎被迫在 build/plugins 中定义一个插件块。还有……

回答 0 投票 0

org.apache.maven.plugins 目标执行失败

我正在尝试使用 maven 生成一个 war 文件,但出现此错误(省略了大部分下载日志输出以使日志更清晰): 下载地址:http://repo.maven.apache.org/maven2/org/ap...

回答 2 投票 0

如何在不破坏完整性检查的情况下对包装的罐子进行数字签名?

我有一个用maven构建的java项目。在打包阶段,代码被构建到一个 jar (maven-jar-plugin 3.1.1) 中并被包装到一个 .exe (launch4j-maven-plugin 1.7.25) 我的一部分...

回答 1 投票 0

JMeter 在测试 10k+ 用户时由于 OutOfMemoryError 无法创建新线程

我的测试发出一个 POST 请求,然后发出 N 个 PUT 请求,其中 N 是用户数。我还将响应保存在目标中 当测试超过 10,000 个用户时,JMeter 失败并显示: 未捕获异常...

回答 0 投票 0

列出依赖项的所有可用版本

我想列出给定依赖项的所有可用版本。 原因:当发现漏洞时,依赖项会被我们基于 JFrog Xray 构建的机制阻止。我想生成一个

回答 2 投票 0

Maven openshift 插件 - 自定义位置的 kubeconfig 文件

我在 java 项目中使用带有 docker-local 配置文件的 maven-openshift-plugin 1.9.1 将整个项目作为 docker 映像上传到 OpenShift。 我在默认位置有 kubeconfig 文件:~/.kube/config w...

回答 0 投票 0

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