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

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

问题描述

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

<前>下载:http://repository.sonatype.org/content/groups/flexgroup/com/adobe/flex/framework/framework/3.2.0.3958/framework-3.2.0.3958.rb.swc下载:http://repository.sonatype.org/content/groups/flexgroup/com/adobe/flex/framework/flex/3.2.0.3958/flex-3.2.0.3958.swc...

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

<前>[错误] 无法在项目应用程序上执行目标:无法解析依赖项r 项目 ...:swf:1.0-SNAPSHOT: 以下工件无法得到解决:com.adobe.flex.framework:flex:swc:3.2.0.3958...

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

<前>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 文件未出现在存储库中.

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

<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><构建><sourceDirectory>src/main/flex</sourceDirectory><testSourceDirectory>src/test/flex</testSourceDirectory><插件><插件><groupId>org.sonatype.flexmojos</groupId><artifactId>flexmojos-maven-plugin</artifactId><version>3.5.0</version><extensions>true</extensions></插件></plugins></build><依赖项><依赖><groupId>com.adobe.flex.framework</groupId><artifactId>flex-framework</artifactId><version>3.2.0.3958</version><type>pom</type></依赖><依赖><groupId>com.adobe.flexunit</groupId><artifactId>flexunit</artifactId><version>0.85</version><type>swc</type><范围>测试</范围></依赖></依赖项><个人资料><个人资料><!--https://docs.sonatype.org/pages/viewpage.action?pageId=2949459--><id>m2e</id><激活><财产><name>m2e.version</name></属性></激活><构建><插件><插件><groupId>org.maven.ide.eclipse</groupId><artifactId>生命周期映射</artifactId><version>0.9.9-SNAPSHOT</version><配置><mappingId>可定制</mappingId><配置器><configurator id='org.maven.ide.eclipse.configuration.flex.configurator'/></配置器><mojoExecutions><mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution></mojoExecutions></配置></插件></plugins><插件管理><插件><插件><groupId>org.apache.maven.plugins</groupId><artifactId>maven-resources-plugin</artifactId><version>2.4</version></插件></plugins></pluginManagement></build></个人资料></个人资料></项目>

有谁知道我做错了什么?!谢谢.

解决方案

感谢您的帮助,但我已经找到了问题所在.我实际上支持一个代理,该代理显然已设置为以某种方式阻止此特定存储库和 swc 文件.这很奇怪,因为我实际上可以在 repo 浏览器中导航到该文件并手动下载它,但是当使用完整 URL 时,它被代理阻止了!不幸的是,尽管拒绝访问"消息实际上嵌入在很长的错误消息中,但 Maven 并没有真正清楚地说明这一点.解决方案是使用 https 而不是 http,它可以简单地通过代理隧道.

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
...

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...

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

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

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.

解决方案

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天全站免登陆