标签: nexus

如何强制Sonatype Nexus更新?

我想在我的pom.xml中使用onejar-maven-plugin:

<plugin>
    <groupId>org.dstovall</groupId>
    <artifactId>onejar-maven-plugin</artifactId>
    <version>1.4.4</version>
    <executions>
        <execution>
            <configuration>
                <mainClass>com.exmaple.myproj.MpPort_MpSoapPort_Client</mainClass>
                <onejarVersion>0.97</onejarVersion>
                <attachToBuild>true</attachToBuild>
                <classifier>onejar</classifier>
            </configuration>
            <goals>
                <goal>one-jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

<pluginRepositories>
    <pluginRepository>
        <id>onejar-maven-plugin.googlecode.com</id>
        <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
    </pluginRepository>
</pluginRepositories>
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,尝试通过Eclipse Maven插件(Maven安装)构建它会导致BUILD ERROR:

Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's …
Run Code Online (Sandbox Code Playgroud)

maven-2 nexus m2eclipse sonatype maven

17
推荐指数
1
解决办法
3万
查看次数

如何克服IntelliJ中的"找不到存储库"错误

IntelliJ中的"找不到存储库"错误不仅适用于我们自己的存储库,而且即使是Maven配置下默认列出的大多数存储库也是如此.只有jfrog.org和jboss.org报告可以使用工件.

其余的存储库是在线的,如果使用浏览器或从命令行使用Maven访问,则包含工件.

JetBrains网站上有一个错误报告:三个月前提交的http://youtrack.jetbrains.com/issue/IDEA-122332.

有解决方法吗?

在此输入图像描述

在此输入图像描述

intellij-idea nexus maven

17
推荐指数
1
解决办法
4372
查看次数

Nexus Docker Registry - Failling anonymous pull

我正在使用Sonatype Nexus作为私有Docker注册表.

虽然它适用于经过身份验证的用户,但尝试使用匿名用户来提取图像却不起作用.这只发生在docker客户端上.

使用Nexus UI(未登录)我可以浏览我的仓库中的图像.但是试图拉动图像我得到了"未经授权"的错误.

以下是Docker Client和Nexus存储库之间通信的捕获流:

Wireshark数据包捕获

这很奇怪,因为启用了匿名访问,并且根据文档,我可能有一个Docker托管注册表(通过HTTPs端口进行RW访问)和Docker组注册表,指向Docker托管注册表,具有RO /匿名访问权限.

nexus

17
推荐指数
3
解决办法
4968
查看次数

Nexus Repository版本3.2.0-01中的OrientDB损坏状态

我们正在使用Nexus Repository版本3.2.0-01并开始在nexus.log中收到以下错误.OrientDB已损坏.Nexus不再开始了.

2017-03-21 13:00:36,329+0000 INFO  [FelixStartLevel] *SYSTEM org.sonatype.nexus.internal.orient.DatabaseServerImpl - OrientDB version: 2.2.13
2017-03-21 13:00:36,348+0000 INFO  [FelixStartLevel] *SYSTEM com.orientechnologies.orient.server.OServer - OrientDB Server v2.2.13 is starting up...
2017-03-21 13:00:36,355+0000 INFO  [FelixStartLevel] *SYSTEM com.orientechnologies.orient.server.OServer - Databases directory: /c9/setup/apps/nexus/sonatype-work/nexus3/db
2017-03-21 13:00:36,647+0000 WARN  [FelixStartLevel] *SYSTEM com.orientechnologies - Not enough physical memory available for DISKCACHE: 1,873MB (heap=1,161MB direct=2,048MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now running with DISKCACHE=256MB
2017-03-21 13:00:36,648+0000 INFO  [FelixStartLevel] *SYSTEM com.orientechnologies - OrientDB config DISKCACHE=256MB (heap=1,161MB direct=2,048MB os=1,873MB) …
Run Code Online (Sandbox Code Playgroud)

nexus orientdb nexus3

17
推荐指数
4
解决办法
1万
查看次数

在本地网络中使用Sonatype nexus

我已经成功地为Java应用程序创建了一个小型软件工程环境(SEE),其中包括基于maven和nexus的其他工具.我的实际问题是 - 并不是一个真正的惊喜 - nexus通常需要访问互联网才能从中央存储库获取所请求的工件.但SEE必须严格脱机,并且无法改变它(安全原因).

我的第一个快速解决方案是镜像连接到互联网的机器上的nexus/maven安装,运行一些标准的pom来填充镜像连接并通过CD-ROM将缓存迁移到目标系统.蛮丑的.我真的不希望调整该过程来获取工件或新工件的更新.实际上,我们现在通常只是导入我们需要的库并使用来自中央和其他人的官方库来创建新的工件(使用nexus).

有没有人面临同样的挑战,找到了更聪明,更有效的方法?

编辑

感谢所有的答案,我想我必须更准确地解决实际问题以及我正在考虑的解决方案:我认为我必须创建,填充和同步一个私有的"中央"存储库,基于中央和互联网上的其他回购,或者确切地说:两个相同的存储库.一个连接到互联网,另一个连接到本地网络.然后我可以保持互联网连接的存储库"最新"并通过DVD将更改复制到本地存储库 - 这对于Nexus是可见的.

会有用吗?是否有关于如何在私有服务器上设置"中心"之类的文档,是否有一种同步所选工件的机制?

(我不想在开始时发表我的想法,因为我希望得到完全不同的想法)

编辑2 - "最佳实践" - 根据要求添加

我们在与互联网完全脱节的环境中使用maven的"最佳实践":

  • 我们在中央服务器上安装了nexus,以便软件开发工作站有一台服务器可以与之通信(这是我们自己的artefact存储库)
  • 我们将POM文件导出到具有Internet访问权限的工作站,清除了该计算机上的本地存储库并执行了dependency:go-offline(插件).这将使用所有必需的artedfacts填充本地存储库
  • 我们将此本地存储库导入安全环境并将所有插件添加到nexus(只复制文件 - 结构相同)

每周使用所有POM文件执行此操作(可以自动执行),并且您拥有一个非常稳定且可用的本地存储库.

java maven-2 nexus

16
推荐指数
1
解决办法
7624
查看次数

如何在Gradle中使用加密密码到Maven存储库

我目前正在尝试将maven构建转换为Gradle构建.我遇到的显示停止障碍是我们的内部工件被部署到需要身份验证才能读取的内部存储库.

而且您知道身份验证的含义...用户名和密码.问题是我不想要求开发人员将他们的密码作为明文存储在他们的硬盘上.Maven支持密码加密,但我没有看到如何让Gradle做到这一点.

是否有一些神奇的访问Ivy CredentialStore将支持加密密码?还是我要等新版本?

encryption passwords nexus gradle maven

16
推荐指数
2
解决办法
1万
查看次数

如何让mvn部署提示输入密码?

我目前正在将我的maven凭据存储在~/.m2/settings.xml:

<server>
  <id>my_server_id</id>
  <username>my_username</username>
  <password>my_password</password>
</server>
Run Code Online (Sandbox Code Playgroud)

但是,我对使用明文密码不满意,因为密码用于其他服务,所以我宁愿提示用户输入密码mvn deploy.我正在通过https部署到Nexus OSS安装.

我知道密码可以加密,但由于加密是可逆的,因此该解决方案不适用于我的情况.

在进行https部署时,有没有办法让Maven提示输入密码?

nexus maven-3 maven

16
推荐指数
1
解决办法
2万
查看次数

尽管发布成功,但未指定"用于发布的存储库"

Settings.scala我的大型SBT项目中有一个单独的文件,其中包含以下内容:

lazy val commonSettings = Seq(
  // ... lots of settings
  publishTo :=
    Some("Sonatype Nexus Repository Manager" at
      "http://my.company.nexus/content/repositories/releases/"),
  credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
  publishMavenStyle := true,
  crossScalaVersions := Seq("2.10.6"),
  // ... lots of other settings
)
Run Code Online (Sandbox Code Playgroud)

现在我的所有项目build.sbt都定义如下:

lazy val aProject =
  project.in(file("somewhere/aProject")).
    settings(commonSettings).
    settings(
      // project specific settings
    )
Run Code Online (Sandbox Code Playgroud)

当我现在这样做

sbt "+ publish"
Run Code Online (Sandbox Code Playgroud)

我看到我的所有工件都已发布,当我查看我的Nexus时,他们就在那里,我也可以将它们用作依赖项等,因此发布工作,但我最后得到以下内容:

java.lang.RuntimeException: Repository for publishing is not specified.
    at scala.sys.package$.error(package.scala:27)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1470)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1470)
    at scala.Option.getOrElse(Option.scala:120)
    at sbt.Classpaths$.getPublishTo(Defaults.scala:1470)
    at sbt.Classpaths$$anonfun$59.apply(Defaults.scala:1150)
    at …
Run Code Online (Sandbox Code Playgroud)

scala nexus sbt

16
推荐指数
2
解决办法
7407
查看次数

是否可以使用Nexus代理单个文件?

我正在尝试通过Nexus 代理node-sass和其他npm库,但是当node-sass的安装后步骤尝试提取文件时遇到问题https://github.com/sass/node-sass/releases/从github 下载/ v3.10.1/linux-x64-48_binding.node.我是公司防火墙的后面,所以我唯一的选择就是让Nexus代理我需要的所有文件.

是否有可能以某种方式将此单个文件添加到Nexus,以便它能够代理并在发送请求时将其发送到https://github.com/sass/node-sass/releases/download/v3.10.1 /linux-x64-48_binding.node

github nexus node-sass

16
推荐指数
1
解决办法
783
查看次数

Nexus不会从默认公共组服务快照

出于某种原因,我无法让Nexus通过默认公共组服务我的SNAPSHOT工件.我已经阅读了Nexus手册的相关内容并搜索了Google,但我所做的一切似乎都无法解决.

我在第4.2节中实现了这些内容.(配置Maven使用单个Nexus组)本手册,所以我的settings.xml如下所示:

<settings>

  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://my-server/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>nexus</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

</settings>
Run Code Online (Sandbox Code Playgroud)

一切都工作正常,直到我开始在干净的机器上构建东西(即我没有构建任何SNAPSHOT项目的东西)并且它不会下载所需的SNAPSHOT依赖项.Maven给了我以下内容:

[INFO] Scanning for projects...
[INFO]       
[INFO] ------------------------------------------------------------------------
[INFO] Building MyCo Actions Base Classes 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://my-sever/nexus/content/groups/public/com/myco/testing/1.0.0-SNAPSHOT/testing-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.myco:testing:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: …
Run Code Online (Sandbox Code Playgroud)

snapshot nexus maven

15
推荐指数
2
解决办法
8476
查看次数