Maven无法下载SWC文件 [英] Maven failure to download swc files

查看:117
本文介绍了Maven无法下载SWC文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Maven使用Sonatype flexmojos构建Flex项目.我已经设置了项目,并且构建工作正常,直到它尝试从Sonatype存储库下载各种swc文件为止,例如.

I'm trying to use Maven to build a Flex project using the Sonatype flexmojos. I've set up the project and the build mostly works until it tries to download various swc files from the Sonatype repository, eg.


Downloading: http://repository.sonatype.org/content/groups/flexgroup/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958.rb.swc
Downloading: http://repository.sonatype.org/content/groups/flexgroup/com/adobe/flex/framework/flex/3.2.0.3958/flex-3.2.0.3958.swc
...

下载没有错误,但由于某些原因,swc文件未出现在本地存储库中,因此构建失败...

There are no errors in the download but for some reason the swc files do not appear in the local repository, and hence the build fails...


[ERROR] Failed to execute goal on project app: Could not resolve dependencies fo
r project ...:swf:1.0-SNAPSHOT: The following artifacts could not
 be resolved: com.adobe.flex.framework:flex:swc:3.2.0.3958...

现在,如果我手动进入Sonatype信息库并下载swc并将其复制到本地信息库中的正确位置,那么它将起作用.但是,同样地,如果我尝试使用Maven安装目标安装swc文件,则它再次表示已安装该文件,但它不在存储库中,例如...

Now, if I go to the Sonatype repository manually and download the swc and copy it into the correct location in the local repository then this will work. Equally, though, if I try to install the swc file using the Maven install goal then again it says the file is installed, but it is not in the repository, eg...


mvn install:install-file -Dfile=flex-3.2.0.3958 -DgroupId=com.adobe
.flex.framework -DartifactId=flex -Dversion=3.2.0.3958 -Dpackaging=swc

...报告建立成功,但是swc文件未出现在存储库中.

...reports a BUILD SUCCESS, but the swc file does not appear in the repository.

pom.xml(由flexmojos-archetypes-application mojo生成)如下:

The pom.xml (which was generated from the flexmojos-archetypes-application mojo) is as follows:

<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.aaa.app</groupId>
  <artifactId>app</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>swf</packaging>

  <name>app Flex</name>

  <build>
    <sourceDirectory>src/main/flex</sourceDirectory>
    <testSourceDirectory>src/test/flex</testSourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.sonatype.flexmojos</groupId>
        <artifactId>flexmojos-maven-plugin</artifactId>
        <version>3.5.0</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>flex-framework</artifactId>
      <version>3.2.0.3958</version>
      <type>pom</type>
    </dependency>

    <dependency>
      <groupId>com.adobe.flexunit</groupId>
      <artifactId>flexunit</artifactId>
      <version>0.85</version>
      <type>swc</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile><!--https://docs.sonatype.org/pages/viewpage.action?pageId=2949459-->
      <id>m2e</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.maven.ide.eclipse</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>0.9.9-SNAPSHOT</version>
            <configuration>
              <mappingId>customizable</mappingId>
              <configurators>
                <configurator id='org.maven.ide.eclipse.configuration.flex.configurator' />
              </configurators>
              <mojoExecutions>
                <mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution>
              </mojoExecutions>
            </configuration>
          </plugin>
        </plugins>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-resources-plugin</artifactId>
              <version>2.4</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>

有人知道我在做什么错吗?! 谢谢.

Does anyone know what I am doing wrong?! Thanks.

推荐答案

全部,谢谢您的帮助,但我发现了问题.我实际上是在代理的后面,该代理显然已经设置为以某种方式阻止此特定存储库和swc文件.这很奇怪,因为我实际上可以在回购浏览器中导航到该文件并手动下载,但是使用完整URL时,该文件会被代理阻止!不幸的是,尽管访问被拒绝"消息实际上嵌在了很长的错误消息中,但Maven并没有真正弄清楚这一点.解决方案是使用HTTPS代替HTTP,而HTTP可以简单地通过代理进行隧道传输.

All, Thanks for your help but I have found the problem. I am actually behind a proxy that has obviously been set up to somehow block this particular repository and swc files. This is strange because I can actually navigate to the file in the repo browser and download it manually, but when using the full URL it is blocked by the proxy! Unfortunately this wasn't really made very clear by Maven although an "Access denied" message was actually there embedded in a very long error message. The solution is to use https instead of http which can simply tunnel through the proxy.

这篇关于Maven无法下载SWC文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆