我为一些开源运行我自己的小Maven仓库.我没有专用服务器,所以我使用谷歌代码库,部署到文件系统,然后提交和推送.适合我的作品.
但是一些Maven工具正在寻找a nexus-maven-repository-index.properties
和索引(在GZ中).我想生成这个索引
我怎样才能做到这一点?是否有能够生成索引的工具(Java main)?还提示如何使用适当的Nexus Jars和一些命令行工具.
我正在尝试将代理添加到公共存储库(特别是camel-extra).但是,我的Nexus日志中出现以下错误:
无法获取存储库camel-extra的远程索引
然后再往下走
我们请求的remoteURL在远程服务器上不存在(remoteUrl ="http://camel-extra.googlecode.com/svn/maven2/releases/.index/nexus-maven-repository-index.properties")
我确保'下载远程索引'是'真',修复索引,更新索引,一切都无济于事.浏览到提供的URL会显示工件存在.
因此,如果存储库没有此文件,是否通过Nexus无法代理?
TIA,罗伊
UPDATE
感谢大家的答案 - 能够在没有索引的情况下拉出文物.再次感谢!
我们使用Sonatype的Nexus 1.9.2.2来代理maven存储库.我们的问题是索引正在吃掉这么多的磁盘空间.我们所有的存储库都占用了大约25GB的空间,而且还在增长.
例如,这个目录有大约4GB的索引文件,如下所示:
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.825.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.826.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.827.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.828.gz
...
Run Code Online (Sandbox Code Playgroud)
是否有任何干净的方法来清除这些文件?例如,使用计划任务?
提前致谢!
我正在开发一套Java工具,用于验证和使用信用卡.到目前为止,我支持:
LUHN验证.
日期验证(简单到期).
基于品牌(Visa,MasterCard等)的卡代码长度验证(CVV,CVC,CID).
信用卡号码长度验证(基于品牌).
BIN/IIN验证(针对有效数字的数据库).
隐藏数字(425010******1234)
为了使工具集更加完整,我想基于不同的卡品牌创建一个信用卡随机数生成器.此功能(希望)可以使我的测试用例更可靠.
基本上,我希望能够生成以下数字:
LUHN有效
根据品牌前缀有效
基于BIN/IIN前缀号有效
对于BIN/IIN有效卡号,我正在考虑从数据库中查找随机BIN/IIN号码(基于当然的品牌),然后使用添加剩余数字Random
.显然,这在大多数时候都不会有效,我将不得不增加其中一个数字,直到它通过LUHN验证.
我似乎无法想到一个更好的方法.也许有人可以建议一些更聪明的东西......?
期待您的建议!提前致谢!:)
我有一个Map<String, String>
.
每个人的第一个想法是将其转换为List<Pair<String,String>>
(Pair
作为自定义类).
我试过@XmlAdapter
这样的:
public class MapPropertiesAdapter extends XmlAdapter<List<Property>, Map<String,String>> { ... }
Run Code Online (Sandbox Code Playgroud)
但Eclipse MOXy,我使用的JAXB impl,最终得到了ClassCastException
- "无法将HashMap转换为Collection".
JAXB是否支持此转换?或者我忽略了一些文档部分,它解释了为什么不是?
PS:我想得到这样的XML:
<properties>
<property name="protocol"/>
<property name="marshaller"/>
<property name="unmarshaller"/>
<property name="timeout"/>
...
</properties>
Run Code Online (Sandbox Code Playgroud)
我明白了,只需要使用中级课程.还在XMLCompositeObjectMappingNodeValue.marshalSingleValue(XMLCompositeObjectMappingNodeValue.java:161)中的Handle NPE中进行了描述
是否有可能将代码覆盖率结果(存储在SonarQube中)嵌入到Github项目中,作为其中一个可嵌入的图标小工具(不确定它们的名称是什么;如果有人告诉我这个也很好)......?例如,我指的是显示构建状态的那些.
我必须把我的集成测试下src/test
用我的单元测试的休息,只是一个模式区别开来,例如*Integr*Test
,*ITTest
或者它们可以在src/it
(如开发Maven插件和使用时的情况maven-invoker-plugin
)?
我问这个是因为,对我来说,如果单元和集成测试都在同一个地方,它看起来不够干净(即使它们是通过Maven配置文件控制的).
aether有一个函数来获取给定工件的所有版本,如下所示:
org.sonatype.aether.impl.VersionRangeResolver.resolveVersionRange(
RepositorySystemSession session,
VersionRangeRequest request )
Run Code Online (Sandbox Code Playgroud)
是否有一个以太函数来列出存储库中的所有工件?
或者如何获得该列表?
ps:我知道大多数maven存储库提供了一个人类可读的索引,你可以解析和爬行.这不是一个安全的解决方案,只是一种解决方法,我不是在寻找这种类型的解决方案.
我想使用它license-maven-plugin
来为我的项目生成许可证头.
所以我有以下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>
<groupId>org.foo</groupId>
<artifactId>bar-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Bar: Parent</name>
<licenses>
<license>
<name>Apache 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<organization>
<name>My Corp.</name>
<url>http://www.mycorp.org/</url>
</organization>
<inceptionYear>2014</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<license.licenseName>apache_v2</license.licenseName>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<verbose>false</verbose>
<includes>
<includes>**/*.java</includes>
</includes>
</configuration>
<executions>
<execution>
<id>generate-license-headers</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<licenseName>Apache 2.0</licenseName>
<roots>
<root>src/main/java</root>
<root>src/test/java</root>
</roots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
...
</project>
Run Code Online (Sandbox Code Playgroud)
我从命令行调用以下内容:
mvn license:update-file-header …
Run Code Online (Sandbox Code Playgroud) 我们正在使用Artifactory 3.9.2
并且必须合并两个存储库的部分(通过复制工件),这些存储库具有相同的(SNAPSHOT
-versioned)工件.这搞砸了maven-metadata.xml
.在Nexus中,可以简单地重建此工件的元数据,并让存储库管理器为您排序.我似乎无法找到关于如何使用Artifactory执行此操作的任何链接/解释.有人可以告诉我怎么做到这一点?
maven ×6
java ×5
nexus ×3
artifactory ×1
credit-card ×1
diskspace ×1
github ×1
jaxb ×1
junit4 ×1
markdown ×1
marshalling ×1
moxy ×1
purge ×1
repository ×1
sonarqube ×1
space ×1
xmladapter ×1