Maven下载swc文件失败
我正在尝试使用 Maven 使用 Sonatype flexmojos 构建 Flex 项目。我已经设置了该项目,构建大部分工作正常,直到它尝试从 Sonatype 存储库下载各种 swc 文件,例如。
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 文件没有出现在本地存储库中,因此构建失败...
[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 文件,那么它会再次表示该文件已安装,但它不在存储库中,例如...
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 生成)如下:
<?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>
有谁知道我做错了什么?! 谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有趣的。我的第一直觉是它们正在被下载,但是当他们尝试将其移动到目录时,某些东西会悄无声息地失败。我会检查文件夹权限。你的 Maven 文件看起来不错,构建也说了同样的事情。不过,保存 SWC 时出了点问题。你在另一台电脑上试过这个吗?
Interesting. My first gut feeling is that they are being downloaded, but when they try to move it to the directory, something fails silently. I would check folder permissions. You maven file looks fine and the build says the same thing. There's something wrong with saving the swcs though. Have you tried this on another computer?
全部,感谢您的帮助,但我已经找到了问题。我实际上位于一个代理后面,该代理显然已设置为以某种方式阻止此特定存储库和 swc 文件。这很奇怪,因为我实际上可以导航到存储库浏览器中的文件并手动下载它,但是当使用完整的 URL 时,它会被代理阻止!不幸的是,Maven 并没有真正明确地说明这一点,尽管“访问被拒绝”消息实际上嵌入在很长的错误消息中。解决方案是使用 https 而不是 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.