我正在尝试从我的 Maven 项目构建 RPM。我有 5 个不同的模块,每个模块都有自己的 pom.xml,在根目录中我有一个 pom.xml,它构建所有模块(典型的 Maven 设置)。当我构建 RPM 时,我想包含一个不属于 Maven 目录的目录。它位于一个目录之上 [来自包含我的 Maven 模块的根文件夹]。将其包含在我的 RPM 中的最佳方式是什么?或者更确切地说,引用目录而不对路径进行硬编码的最佳方法是什么?我对 ${baseDir} 及其含义感到困惑?
谢谢。
尝试在http://rgladwell.github.com/m2e-android/上安装Android M2e插件,但没有运气.我得到了"Android Configurator for M2E 0.4.2"的例外情况
无法完成安装,因为找不到一个或多个必需的项目.正在安装的软件:适用于M2E 0.4.2的Android配置器(me.gladwell.eclipse.m2e.android.feature.feature.group 0.4.2)缺少要求:适用于M2E 0.4.2的Android配置器(me.gladwell.eclipse.m2e. android.feature.feature.group 0.4.2)需要'org.eclipse.persistence.moxy 2.1.0',但无法找到
我正在使用Eclipse Juno for Mobile Developers.我试过"Eclipse IDE for Java EE Developers",它也给了我同样的错误.
这是我的日食信息
Eclipse for Mobile Developers版本:Juno Release Build id:20120614-1722
我也直接访问了github上的插件网站https://github.com/rgladwell/m2e-android/blob/master/me.gladwell.eclipse.m2e.android.feature/feature.xml,发现它需要以下插件
<requires>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.jdt.core" version="3.5.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.launching" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.filesystem" version="1.2.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.console" version="3.4.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.persistence.moxy" version="2.1.0" match="greaterOrEqual"/>
<import plugin="javax.xml.bind"/>
<import plugin="org.eclipse.osgi"/>
<import feature="org.eclipse.m2e.feature" version="1.0.200.20111228-1245"/>
<import feature="com.android.ide.eclipse.adt" version="17.0.0.v201203161636-291853"/>
</requires>
Run Code Online (Sandbox Code Playgroud)
有谁知道如何安装org.eclipse.persistence.moxy插件?我怀疑这必须与其他一些插件捆绑在一起.任何帮助赞赏.
如何在构建或部署期间忽略我的插件 ( maven-antrun-plugin)?
我正在从 IDL 工具(用 C 编写)生成源文件。我使用maven-antrun-plugin来进行源生成并将其应用到generate-sources阶段。与 一起build-helper-maven-plugin,IDL 工具生成的 java 源代码存放在生成的源文件夹中,并最终作为源代码包含在 jar 包中。完美的!
这是我在 Maven 构建中使用的内容:
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="target/generated-sources/" />
<!-- other task stuff here -->
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/gen-java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin> …Run Code Online (Sandbox Code Playgroud) 我无法从.properties文件中检索到我的值context.xml
pom.xml(没有提到依赖项)
<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>
<groupId>com</groupId>
<artifactId>myproj</artifactId>
<version>0.1.1</version>
<packaging>war</packaging>
<name>myproj</name>
<url>http://maven.apache.org</url>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<env>dev</env>
<build.number>0</build.number>
<svn.revision.number>0</svn.revision.number>
</properties>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/environment</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8</version>
<configuration>
<printSummary>false</printSummary>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<excludes>
<exclude>**/*_Roo_*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId> …Run Code Online (Sandbox Code Playgroud) 我使用maven打包我的web应用程序,但我发现很多maven jar都在我的war的lib目录中.我不认为它们对我在tomcat下的Web应用程序有用,所以如何排除它们呢?

<dependencies>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.13</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.whalin</groupId>
<artifactId>Memcached-Java-Client</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.imgscalr</groupId>
<artifactId>imgscalr-lib</artifactId>
<version>4.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope> …Run Code Online (Sandbox Code Playgroud) 对于第一部分:我想在构建 maven 项目时生成多个 war 文件。第二部分:我想动态重命名这些文件。
例如:现在生成的文件名为 test.war。如果我想在单个构建中多次生成此文件,我希望文件的名称如下: test_1.war, test_2.war , test_3.war ...
你们有什么想法如何实现?我也可以创建一个 .bat 文件来做这些事情,但我不太确定如何:)
谢谢
我正在尝试在spring boot应用程序中构建阴影jar但有一些问题.我不知道我在这里做错了什么.我还阅读了以下链接,但没有运气 maven-shade-plugin错误:在'资源'的org.apache.maven.plugins.shade.resource.ManifestResourceTransformer中找不到setter,adder和field
这是我的Pom.xml
<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>
<groupId>dashboard</groupId>
<artifactId>dashboard</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.2.7.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>jira.widgets</groupId>
<artifactId>jira-widgets</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.5.RELEASE</version>
</parent>
<!-- Additional lines to be added here... -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<!-- Run shade goal on package phase …Run Code Online (Sandbox Code Playgroud) 我有一个 maven 模块,它被打包为一个 zip,使用maven-shade-plugin命名为my-artifact-1.0-SNAPSHOT.zip。
将工件安装到本地 maven 存储库后,我需要:
这个过程应该是跨平台的,可以在 Windows、Linux、MacOS 机器上工作。
我读到它可以通过使用来完成:
实现这种流程的最佳方法是什么?任何例子都非常感谢。
我正在将简单的 java 项目(它很旧)移动到基于 Maven 的,并且在当前项目中,所有需要的 jars 都保存在lib文件夹中。
对于lib文件夹中的每个 jar ,我在 maven 中央存储库中搜索各自的依赖项 - https://mvnrepository.com/并将该依赖项添加到pom.xml
但是我无法在中央 Maven 存储库中找到某些 jar,并且团队中没有资源可以帮助我确定位置(如果是第三方)。
一种方法是我可以将这些 jars 上传到一些存储库,如 Nexus 和 pom.xml,我可以在repository标签下提及它的 url,因此在点击mvn install它们后将被添加到.m2
但目前,我也没有任何可以上传这些罐子的位置。所以我会把它们放在我机器上的一个文件夹中。
只是想知道 maven 中是否有任何方法(在 中提及某些内容pom.xml)将指向该文件夹(以防 jar 在中央 maven repo 中不可用)并将其下载到.m2
我的系统上安装了 pom 和 jdk 11 中的 aspectj-maven-plugin:1.11。Jdk 11 在 lib 目录中没有 tools.jar。这导致 maven 构建失败并出现错误:
[错误] 无法执行目标 org.codehaus.mojo:aspectj-maven-plugin:1.11:compile (default) on project groundtruth-storage-writer: 目标 org.codehaus.mojo 的执行默认:aspectj-maven-plugin:1.11 :compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 或其依赖项之一无法解析:在指定路径找不到工件 com.sun:tools:jar:11.0.7 ...\ Java\jdk-11.0.7/../lib/tools.jar
如何解决这个问题?
有一个答案在这里,但超过2岁。