- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个具有以下结构的项目:
.
├── bundleA
│ ├── pom.xml
│ └── src
├── bundleB
│ ├── pom.xml
│ └── src
├── distribution
│ ├── pom.xml
│ └── src
│ └── assemble
│ └── example.xml
└── pom.xml
bundleA
和 bundleB
poms 很简单,不会影响此问题。
分发pom.xml
:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<artifactId>testproject</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.example</groupId>
<artifactId>distribution</artifactId>
<version>1.0-SNAPSHOT</version>
<name>distribution</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>distro-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assemble/example.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
example.xml
程序集描述符:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>example</id>
<formats>
<format>dir</format>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<includes>
<include>org.lwjgl.lwjgl:lwjgl</include>
</includes>
<outputDirectory>/libs</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>com.example:bundleA</include>
<include>com.example:bundleB</include>
</includes>
<binaries>
<outputDirectory>/bundles</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
这里的问题:当我将 lwjgl (或几乎任何其他带有打包在分类子项目中的 native 库的项目)包含到 distribution
项目的依赖项中并在程序集描述符中引用它时 - 我得到分发构建后的疯狂:
distribution/target/distribution-1.0-SNAPSHOT-example
├── bundles
│ ├── bundleA-1.0-SNAPSHOT-natives-linux.jar
│ ├── bundleA-1.0-SNAPSHOT-natives-osx.jar
│ ├── bundleA-1.0-SNAPSHOT-natives-windows.jar
│ ├── bundleA-1.0-SNAPSHOT.jar
│ ├── bundleB-1.0-SNAPSHOT-natives-linux.jar
│ ├── bundleB-1.0-SNAPSHOT-natives-osx.jar
│ ├── bundleB-1.0-SNAPSHOT-natives-windows.jar
│ └── bundleB-1.0-SNAPSHOT.jar
└── libs
└── lwjgl-2.9.0.jar
换句话说,lwjgl 的每个本地 * 分类子项目都会根据我项目中的包数量神奇地复制为唯一的名称(但 jar 的大小和内容完全相同),这太疯狂了。
我想要的是一种指定 lwjgl 平台无关的 jar 的方法(不包含 native )或某种其他方法来从生成的分发中排除此 native -* jar。
这个项目在 github 上:https://github.com/iamtakingiteasy/maven-assembly-plugin-insanity
最佳答案
嗯,这可能不是最好或直接的解决方案,但使用
<moduleSets>
<moduleSet>
...
<binaries>
...
<includeDependencies>false</includeDependencies>
...
</binaries>
...
</moduleSet>
</moduleSets>
似乎有帮助。关键是开始查看捆绑选项,而不是尝试对 lwjgl 本身做一些事情。
此外,直接排除 * 平台依赖项(再次在 bundle 部分中)可能是解决方案:
<moduleSets>
<moduleSet>
...
<binaries>
...
<excludes>
<exclude>org.lwjgl.lwjgl:lwjgl-platform</exclude>
<exclude>net.java.jinput:jinput-platform</exclude>
</excludes>
...
</binaries>
...
</moduleSet>
</moduleSets>
关于java - 如何防止 maven- assembly-plugin 以疯狂的方式从 dependencySet 复制 natives-* 分类器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20380273/
尝试熟悉 Maven 并参加在线类(class),但陷入困境......感谢提供的任何帮助。 我正在运行站点阶段,虽然它已完成并且我能够在浏览器中实际查看index.html,但我在此过程中遇到了很多
基本上就是标题。。我在任何地方都找不到一个简单的比较,来解释这两者之间的差异:。我知道Gradle中可以有3种类型的插件:。我认为这三种类型的插件在某种程度上与它们可以在settings.gradle
我是 maven 的初学者,现在我对这些 maven 插件之间的区别感到困惑。这些都是创建jar文件吗?现在我的问题是 各个插件创建的jar有什么区别。(组装插件、jar-plugin、shaded插
我使用 tycho-packaging-plugin 来设置 jar 的输出文件夹。这是我的 pom 的缩短版本: 0.21.0 org.eclipse.
When starting the server, refuses to load my plugin with an error:启动服务器时,拒绝加载我的插件,并出现错误: Could n
为什么卸载以下(空)插件会导致错误? 这是my-plugin/my-plugin.php : : my-plugin 关于wordpress - 由于错误 : Could not fully remo
我使用 sbt 与 playframework 和 activator 来构建一个 Web 应用程序。我的 sbt 版本是 0.13.0 我将plugin.sbt 文件更改为: logLevel :=
这是我运行 atlas-create-jira-plugin 时得到的结果后跟 atlas-create-jira-plugin-module选择选项1: Component Import . 问题是
我正在尝试使用 Maven 构建我的 Java 项目,但它失败了,并且出现以下错误: 从存储库 [local (C:\Users\Vinita.Gupta.m2\repository), centra
我正在使用 eclipse mars-2。我想在 Windows 中创建一个新的 Maven Spring Boot 项目。但我遇到了类似 的错误 Could not calculate build
最近开发的产品,我们是有四五个maven模块,开发阶段一直是在eclipse中运行的,然后快发版的时候,需要把这些项目打成jar包,通过命令去启动,那首先就得把这些模块项目打包,或者拷贝一些资源文件等
我想使用 maven-resources-plugin 复制 Excel 并使用 exec-maven-plugin 从该 Excel 创建一些属性文件。并且新创建的属性需要附加到构建中。我可以创建属
当我尝试构建项目时出现此错误。 Errors occurred during the build. Errors running builder 'Maven Project Builder' on
当我在执行 Maven 时从 eclipse 内部 -> 更新项目我遇到以下问题 Unable to update Maven configuration Could not calculate bu
我之前问过一个关于延迟处理事件的问题:Grails non time based queuing .我开始使用 rabbitmq 插件:http://grails.org/plugin/rabbitm
我正在尝试使用 maven 构建一个 java spring 项目(来自 heroku 入门指南的默认项目)。出于某种原因,我不断收到以下错误。机器上网应该没有问题。 Failed to execut
操作系统:OSX 10.11 Cordova :5.4.1(也尝试过 6.0)节点:4.2.6使用的cordova插件:crosswalk-project/cordova-plugin-crosswa
org.sonatype.maven.plugin :emma-maven-plugin:1.2 org.codehaus.mojo :emma-maven-plugin:1.0-alpha-3 or
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我是一名优秀的程序员,十分优秀!