0

我在尝试查找和获取 maven wagon 插件时遇到问题。

在我的 pom.xml 我有以下内容:

...

 <!-- Repositories -->
    <repositories>
        <repository>
          <id>mavencentral</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
        </repository>
    </repositories>

<pluginRepositories>
         <pluginRepository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
        </pluginRepository>

    </pluginRepositories>

然而,当我运行 mvn install 时,我得到以下信息:

[错误] 无法在项目 app.ui 上执行目标:无法解析项目 my.project:war:1.9.0-SNAPSHOT 的依赖项:在中央找不到工件 org.apache.maven.wagon:wagon:jar:2.8 ( https://repo1.maven.org/maven2 ) -> [帮助 1]

我错过了什么?我需要做什么来解决这个问题?

谢谢

4

1 回答 1

0

我设法解决了这个问题

<build>
<extensions>
    <extension>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-ssh</artifactId>
       <version>${maven.wagon.version}</version>
 </extension>
</extensions>
    <plugins>
        <plugin>
               <groupId>org.apache.maven.wagon</groupId>
               <artifactId>wagon-maven-plugin</artifactId>
               <version>${maven.wagon.version}</version>
                   <configuration>
                    <serverId>appui</serverId>
                    <fromFile>${project.build.directory}</fromFile>
                    <includes>${project.build.finalName}.war</includes>
                    <url>scp://localhost:2221/</url>                     
                    <toDir>/opt/jboss/jboss-as-7.1.1.Final/standalone/deployments</toDir>
               </configuration>
               <executions>
                 <execution>

                   <id>upload-war-to-server</id>
                   <phase>upload</phase>
                   <goals>
                     <goal>upload-single</goal>
                   </goals>
                   <configuration>
                        <serverId>appui</serverId>
                        <fromFile>${project.build.directory}</fromFile>
                        <includes>${project.build.finalName}.war</includes>
                        <url>scp://localhost:2221/opt/jboss/jboss-as-7.1.1.Final/standalone/deployments</url>            

                    </configuration>
                 </execution>
               </executions>
        </plugin>
于 2015-04-01T11:54:23.327 回答