构建两个版本的 Maven 人工制品

时间:2021-05-27 07:01:18

标签: maven dependencies

we 依赖的依赖项 (https://github.com/bytedeco/javacpp-presets/tree/master/ffmpeg) 最近拆分为 LGPL 和 GPL 版本,具体取决于底层 ffmpeg 的配置方式。 发布了两组不同的工件(例如 https://mvnrepository.com/artifact/org.bytedeco/ffmpeg-platform-gpl/4.3.2-1.5.5https://mvnrepository.com/artifact/org.bytedeco/ffmpeg-platform/4.3.2-1.5.5)。

API 与我们的目的相同 - 我们无需更改代码。就支持的内容而言,它在运行时是动态的,但没关系。鉴于不同的硬件支持,它已经很灵活了。

我想构建两组工件作为通过我们的树的并行路径(例如两个版本的核心、api、查看器、示例等)作为具有不同许可证依赖项的 jar,以允许用户选择哪一个他们更喜欢。目标是用户可以选择我们代码的特定版本和依赖项“正常工作”,因为正确的依赖项要么包含在 uber-jar 中,要么通过 maven 获取。

所以我有一个 jmisb-api-lgpl-${version}.pom/jar(可能还有 jar-with-dependency uber-jar),它依赖于 jmisb-core-lgpl-${version}.[pom, jar],而 ffmpeg-platform-${other version}.[pon,jar] 又依赖于 jmisb-api-gpl-${version}.pom/jar。同时构建的 jmisb-core-gpl-${version}.[pom,jar] 依赖于 ffmpeg-platform-gpl-${other version}.jar,而 var attachments = new List<Attachments>(); foreach (var attachment in msg.attachments) //msg.attachments is a Dictionary<string, FileAttachment> type { var attach = new Attachments(); attach.name = attachment.Value.name; attach.type = attachment.Value.type; attachments.Add(attach); } 又依赖于 Option Explicit Public Sub MakeShapeNamesUniqueInActiveSheet() MakeShapeNamesUnique InWorksheet:=ActiveSheet End Sub Public Sub MakeShapeNamesUnique(ByVal InWorksheet As Worksheet) Dim Dict As Object Set Dict = CreateObject("Scripting.Dictionary") ' collect all shape names and how often they occur Dim Shp As Shape For Each Shp In InWorksheet.Shapes If Dict.Exists(Shp.Name) Then Dict(Shp.Name) = Dict(Shp.Name) + 1 Else Dict.Add Shp.Name, 1 End If Next Shp ' check which need to be renamed (duplicates) and rename them Dim Key As Variant For Each Key In Dict.keys If Dict(Key) > 1 Then ' rename only if dupicate names exist Dim iCount As Long iCount = 1 Dim iShp As Long For iShp = 1 To Dict(Key) Dim NewName As String NewName = Key & iCount ' make sure already existing new names get jumped Do While ShapeExists(NewName, InWorksheet) iCount = iCount + 1 NewName = Key & iCount Loop InWorksheet.Shapes(Key).Name = NewName ' rename the shape iCount = iCount + 1 Next iShp End If Next Key End Sub Public Function ShapeExists(ByVal ShapeName As String, ByVal InWorksheet As Worksheet) As Boolean ' Test if a shape exists in a worksheet On Error Resume Next Dim Shp As Shape Set Shp = InWorksheet.Shapes(ShapeName) On Error GoTo 0 ShapeExists = Not Shp Is Nothing End Function

首选/推荐的方法是什么,或者,什么是一种相对干净的方法,无需手动选择生成哪一个?

0 个答案:

没有答案
相关问题