在nexus中找不到maven-metadata.xml

时间:2018-05-10 06:29:06

标签: maven nexus

我应该在maven-metadata.xml中添加任何内容以生成Maven-metadata.xml吗? 我无法在Nexus中找到Option Explicit ''****************************************************************** '' folderInfo returns: '' folderInfo(0) = PATH_FOLDER - folder path used '' folderInfo(1) = AllFileProperties - Dictionary of arrays containing all the file properties of each file within the folder '' folderInfo(2) = totalPropertiesSetInFolder - total count of extended properties <> vbNullString in the folder '' folderInfo(3) = filePropertyCounts - dictionary of each file with its respective set property count '' folderInfo(4) = AllFilesHaveSamePropertyCount - Boolean to say if all files in folder have same # extended properties set ''****************************************************************** Public Sub test() Const PATH_FOLDER As String = "C:\Users\User\Desktop\TestFolder\" Dim resultsArray() resultsArray() = folderInfo(PATH_FOLDER) '<== All the info is now returned here ''*************************************************************************************** '' Examples of extracting the retrieved information from the array ''*************************************************************************************** 'Example: folderInfo(0) = folderPath Debug.Print "Folderpath = " & resultsArray(0) Debug.Print String$(20, Chr$(60)) Debug.Print vbNewLine ''*************************************************************************************** 'Example: folderInfo(1) = AllFileProperties Debug.Print "AllFileProperties:" Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") Set dict = resultsArray(1) Dim key As Variant, arr(), i As Long For Each key In dict.keys Debug.Print "FileName = " & key arr() = dict(key) For i = LBound(arr, 1) To UBound(arr, 1) Debug.Print arr(i, 1), arr(i, 2) Next i Debug.Print String$(20, Chr$(60)) Debug.Print vbNewLine Next key ''*************************************************************************************** ''Example: folderInfo(2) = totalPropertiesSetInFolder MsgBox "Total properties set in folder = " & resultsArray(2) ''*************************************************************************************** ''Example: folderInfo(3) = filePropertyCounts Dim dict2 As Object Set dict2 = CreateObject("Scripting.Dictionary") Set dict2 = resultsArray(3) Dim key2 As Variant For Each key2 In dict2.keys Debug.Print key2 & " set property count = " & dict2(key2) Next key2 ''*************************************************************************************** ''Example: folderInfo(4) = AllFilesHaveSamePropertyCount MsgBox "All files have the same # of set properties? = " & resultsArray(4) End Sub Public Function folderInfo(ByVal PATH_FOLDER As String) As Variant Dim objShell As Object Dim objFolder As Object Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(Left$(PATH_FOLDER, Len(PATH_FOLDER) - 1)) 'Retrieving Extended File Properties Dim i As Long Dim arrHeaders(35) For i = 0 To 34 arrHeaders(i) = objFolder.GetDetailsOf(objFolder.items, i) Next Dim fileName As Object, setPropertyCount As Long, filePropertyCounts As Object, totalPropertiesSetInFolder As Long Set filePropertyCounts = CreateObject("Scripting.Dictionary") Dim AllFileProperties As Object Set AllFileProperties = CreateObject("Scripting.Dictionary") For Each fileName In objFolder.items setPropertyCount = 0 Dim fileProperties(0 To 35, 0 To 35) fileProperties(0, 0) = fileName For i = 0 To 34 If objFolder.GetDetailsOf(fileName, i) <> vbNullString Then setPropertyCount = setPropertyCount + 1 fileProperties(i + 1, 1) = arrHeaders(i) fileProperties(i + 1, 2) = objFolder.GetDetailsOf(fileName, i) ' Debug.Print i & vbTab & arrHeaders(i) _ ' & ": " & objFolder.GetDetailsOf(fileName, i) ' Debug.Print vbNewLine Next i 'Debug.Print fileName & ": setpropertyCount = " & setPropertyCount filePropertyCounts.Add fileName.Name, setPropertyCount AllFileProperties.Add fileName.Name, fileProperties Next fileName totalPropertiesSetInFolder = Application.WorksheetFunction.Sum(filePropertyCounts.items) folderInfo = Array(PATH_FOLDER, AllFileProperties, totalPropertiesSetInFolder, filePropertyCounts, AllFilesHaveSamePropertyCount(filePropertyCounts)) End Function Public Function AllFilesHaveSamePropertyCount(ByVal filePropertyCounts As Object) As Boolean AllFilesHaveSamePropertyCount = True Dim key As Variant For Each key In filePropertyCounts.Keys If filePropertyCounts(key) <> Application.WorksheetFunction.Max(filePropertyCounts.items) Then AllFilesHaveSamePropertyCount = False Exit Function End If Next key End Function 。 我必须从Nexus提供任何配置吗?

1 个答案:

答案 0 :(得分:1)

如果您使用的是maven(而不是curl或上载ui),它应该在上载时自动生成。

在发生错误的情况下,有计划的任务可以使它重新生成,应根据所运行的NXRM版本进行记录。

NXRM2任务:https://help.sonatype.com/display/NXRM2/Managing+Scheduled+Tasks

NXRM3任务:https://help.sonatype.com/display/NXRM3/System+Configuration#SystemConfiguration-TypesofTasksandWhentoUseThem