相关疑难解决方法(0)

强制maven更新

我在其他计算机上导入了我的工作项目,因此它开始下载依赖项.

显然在此期间我的互联网连接崩溃了.现在我得到:

为漫画构建错误; org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目漫画上执行目标测试:无法解析项目漫画的依赖项测试:漫画测试:war:0.0.1-SNAPSHOT:无法解析以下工件:org.springframework:spring- context:jar:3.0.5.RELEASE,org.hibernate:hibernate-entitymanager:jar:3.6.0.Final,org.hibernate:hibernate-core:jar:3.6.0.Final,org.hibernate:hibernate-commons-注释:jar:3.2.0.Final,org.aspectj:aspectjweaver:jar:1.6.8,commons-lang:commons-lang:jar:2.5,

mysql:mysql-connector-java:jar:5.1.13:无法传输org.springframework:来自http://repo1.maven.org/maven2的 spring-context:jar:3.0.5.RELEASE 缓存在本地存储库中,在中心的更新间隔过去或强制更新之前,不会重新尝试解析.

原始错误:无法传输工件org.springframework:spring-context:jar:3.0.5.RELEASE from central(http://repo1.maven.org/maven2):60000后没有收到回复

我不知道如何强制maven更新?

maven

682
推荐指数
12
解决办法
79万
查看次数

当maven说"在MyRepo的更新间隔已经过去之前不会重新尝试解析",指定的间隔在哪里?

有了maven,我偶尔会看到一些来自我尚未构建或包含在我的存储库中的第三方存储库的工件.

我将从maven客户端收到一条错误消息,指出无法找到工件:

未能找到org.jfrog.maven.annomojo:maven-plugin-anno:jar:1.4.0 in http://myrepo:80/artifactory/repo缓存在本地存储库中,在MyRepo的更新间隔过去或强制更新之前,不会重新尝试解析 - > [帮助1]

现在,我理解这意味着什么,并且可以简单地重新运行我的命令-U,并且通常在那里工作正常.

但是,我发现这个错误信息非常不直观,并且试图让我的同事们感到头疼.

我想知道是否有一些地方可以修改此update interval设置.

  1. 在update interval此错误消息的客户端或服务器端的设置,被提及?
  2. 如果是客户端,我该如何配置呢?
  3. 如果是服务器端,是否有人知道如何/如果Nexus/Artifactory公开这些设置?

artifactory maven

521
推荐指数
11
解决办法
52万
查看次数

如何通过代理使用Maven?

我想分享我通过代理使用maven的经验.

您很可能会遇到异常和消息,例如:

repository metadata for: 'org.apache.maven.plugins' could not be retrieved from 
repository: central due to an error: Error transferring file: Connection refused: connect

要么

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-
plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its 
dependencies could not be resolved: Failed to read artifact descriptor for 
org.apache.maven.plugins:maven-clean-plugin:jar:2.5

如何配置Maven使用代理服务器?

proxy maven

120
推荐指数
12
解决办法
22万
查看次数

当搜索返回匹配时,无法在maven central repo中找到工件

我试图在我的pom中引入对castor库的依赖.由于我的项目处于初步阶段,所有工件都来自maven central.所以我在search.maven.org上搜索"castor".我取第一个结果,它给了我以下依赖片段:

<dependency>
    <groupId>org.codehaus.castor</groupId>
    <artifactId>castor</artifactId>
    <version>1.3.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

现在我"mvn clean install"并获得以下内容:

[ERROR] Failed to execute goal on project jaxb: Could not resolve dependencies for project org.test:jaxb:war:0.0.1-SNAPSHOT: Could not find artifact org.codehaus.castor:castor:jar:1.3.3 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

为什么CLI无法找到可从Web界面找到的工件.我当然错过了一些东西.请求指出它可能是什么.

在其他帖子中,我已经调查了这个和这个相关的帖子,但不是这个问题.

我的完整pom:

<?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.test</groupId>
<artifactId>jaxb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>jaxb</name>
<description>jaxb</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.1.9.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId> …
Run Code Online (Sandbox Code Playgroud)

maven-3

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

Maven代理设置不起作用

我在conf/settings.xml中设置了maven代理设置

<proxy>
  <active>true</active>
  <protocol>http</protocol>
  <host>proxy.my-company.com</host>
  <port>8080</port>
</proxy>
Run Code Online (Sandbox Code Playgroud)

但是当我运行maven build时,我遇到了以下错误.有人可以请帮助

[WARNING] The POM for org.apache.maven.wagon:wagon-ssh:jar:2.2 is missing, no dependency information available

详细的日志

mvn -X

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\tools\apache-maven-3.0.4
Java version: 1.6.0_12, vendor: Sun Microsystems Inc.
Java home: C:\tools\Java\jdk1.6.0_12\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"

[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\tools\apache-maven-3.0.4\conf\settings.xml
[DEBUG] Reading user settings from C:\Documents and Settings\desibaba\.m2\settings.xml
[DEBUG] Using …

proxy maven-3 maven

11
推荐指数
4
解决办法
6万
查看次数

Nexus:找不到神器

最近我从Archiva迁移到了Sonatype Nexus.

我正在尝试使用来自第三方存储库的Jars,而Nexus不会将其缓存到本地存储库中.

我已经在本节中搜索了答案,而且无法回答这个问题.

这就是我做的......

我正在使用settings.xml:

<settings>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://THE_URL:8080/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  <servers>
    <server>
      <id>admin</id>
      <username>user</username>
      <password>password</password>
    </server>
  </servers>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <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>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>

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

caching repository nexus maven

10
推荐指数
2
解决办法
3万
查看次数

使用spring模板在pom.xml中出现Maven错误

我在弹簧模板项目的mi maven pom.xml中收到以下错误

"描述资源路径位置类型ArtifactDescriptorException:无法读取org.slf4j的工件描述符:slf4j-api:jar:1.5.6:ArtifactResolutionException:无法从http:/传输org.slf4j:slf4j-api:pom:1.5.6 /repo.maven.apache.org/maven2缓存在本地存储库中,在中心的更新间隔过去或强制更新之前,不会重新尝试解析.原始错误:无法传输工件org.slf4j:slf4j-api: pom:1.5.6 from/to central(http://repo.maven.apache.org/maven2):C:\ Users\muhsin.HIFX.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.pom.ahc0570cfa3a1934af5(系统找不到指定的文件)pom.xml/sample line 1 Maven Dependency Problem"

我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.springframework.samples.spring</groupId>
    <artifactId>spring-jpa-utility</artifactId>
    <version>1.0.0.CI-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>Spring JPA Utility</name>
    <url>http://www.springframework.org</url>
    <description>
        <![CDATA[This project is a minimal jar utility with Spring configuration for JPA usage.]]>
    </description>
    <properties>
        <maven.test.failure.ignore>true</maven.test.failure.ignore>
        <spring.framework.version>3.0.6.RELEASE</spring.framework.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.6.0.Final</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.1.0.Final</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.framework.version}</version> …
Run Code Online (Sandbox Code Playgroud)

java spring maven

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

无法解决项目的依赖关系。找不到工件。

我在构建 Farma-rest 项目时遇到问题,该项目依赖于我的其他项目 Farma。我将依赖项放入 pom.xml 中,但它无法解析项目的依赖项。它向我显示了此错误消息:

无法在项目 Farma-rest 上执行目标:无法解析项目 sk.upjs.ics:Farma-rest:jar:1.0-SNAPSHOT 的依赖项:无法找到工件 sk.upjs.ics:Farma:jar:1.0-SNAPSHOT - > [帮助1]

这是第一个项目的 pom:

    <?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>sk.upjs.ics</groupId>
    <artifactId>Farma</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.8-dmr</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.0.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <scope>test</scope>
            <version>2.44.0</version>
        </dependency>
        <dependency>
            <groupId>com.opera</groupId>
            <artifactId>operadriver</artifactId>
            <scope>test</scope>
            <version>1.5</version>
            <exclusions>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-remote-driver</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <properties> …
Run Code Online (Sandbox Code Playgroud)

java dependencies pom.xml maven

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