Maven、Flex 构建问题

发布于 2024-11-27 19:13:46 字数 6254 浏览 1 评论 0原文

我是 Maven 新手。我正在尝试使用maven插件flexmojos编译Flex。我很难从公共存储库获取 Maven 下载文件。目前我们没有任何公司内网存储库。 Maven 总是无法从存储库下载所需的文件(例如:flex-framework)。最初我没有配置代理,但现在我配置了。之后,maven 能够与存储库通信,但无法下载所有文件。我确实尝试删除“存储库”目录几次,并且还尝试重新安装 Maven 软件。

因为,它无法下载我认为可能的文件,我应该尝试将文件手动复制到默认存储库位置(/.m2/repository)并执行此操作。但我仍然收到如下错误。

[ERROR] Failed to execute goal on project nuxi-nms-flex-stats: Could not resolve
dependencies for project nuxi:nuxi-nms-flex-stats :swf:1.0.0: The following artifacts 
could not be resolved: com.adobe.flex.framework:flex-framework:pom:4.1.0.16248,
com.adobe.flex .framework:playerglobal:0.swc:2:4.1.0.16248: Could not find artifact
com.adobe.flex.framework:flex-framework:pom:4.1.0.16248 in central 
http://search.maven.org/) -> [Help 1]

这个错误信息真的让我很沮丧。我还尝试根据 sonatype 示例构建一个示例应用程序,了解如何构建 Flex 应用程序。即使失败,也会出现类似的消息(这次它抱怨无法下载 Flex 编译器)

<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>nuxi</groupId>
    <artifactId>nuxi-nms-flex</artifactId>
    <version>1.0.0</version>
</parent>
<groupId>nuxi</groupId>
<artifactId>nuxi-nms-flex-stats</artifactId>
<version>1.0.0</version>
<packaging>swf</packaging>
<name>nuxi nms flex stats</name>


<repositories>
    <repository>
        <id>central</id>
        <name>Central Maven Repository</name>
        <url>http://search.maven.org/</url>
        <layout>default</layout>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>org.sonatype.flexmojos</id>
        <name>Flex mojos plugin for maven</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>com.adobe.flex</id>
        <name>Flex compiler</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>com.adobe.flex.framework</id>
        <name>Flex Framework</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

<build>
    <sourceDirectory>src/main/flex</sourceDirectory>
    <testSourceDirectory>src/test/flex</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <version>4.0-SNAPSHOT</version>
            <extensions>true</extensions>
            <configuration>
                <sourceFile>statsapp.mxml</sourceFile>
                <htmlName>SampleSWF</htmlName>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.adobe.flex</groupId>
                    <artifactId>compiler</artifactId>
                    <!--
                    <version>4.0.0.10485</version>
                    -->
                    <version>4.1.0.16248</version>
                    <type>pom</type>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
    <finalName>statsapp</finalName>
</build>
<dependencies>
    <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>flex-framework</artifactId>
        <!--
        <version>4.0.0.10485</version>
        -->
        <version>4.1.0.16248</version>
        <type>pom</type>
        <exclusions>
           <exclusion>
               <groupId>com.adobe.flex.framework</groupId>
               <artifactId>playerglobal</artifactId>
           </exclusion>
       </exclusions>
    </dependency>
    <dependency>
       <groupId>com.adobe.flex.framework</groupId>
       <artifactId>playerglobal</artifactId>
       <version>4.1.0.16248</version>
       <classifier>2</classifier>
       <type>0.swc</type>
   </dependency>
</dependencies>

我的问题是,我做错了什么吗?这里可能有什么问题?感谢这方面的任何帮助...谢谢...

抱歉如此冗长的解释...

I am new to Maven. I am trying to compile Flex using maven plug-in flexmojos. I am having hard time to get maven download files from public repository. Currently we do not have any company intranet repository. Maven always fails to download required files (eg: flex-framework) from repository. Initially I did not configure the proxy, but now I did. After that maven was able to communicate to the repositories but unable to download all the files. I did try deleting the 'repository' directory couple of times, and also tried re-installing maven software.

Because, it could not download the files I thought may be I should try copying the files manually into the default repository location (/.m2/repository) and did that. But still I get an error as below.

[ERROR] Failed to execute goal on project nuxi-nms-flex-stats: Could not resolve
dependencies for project nuxi:nuxi-nms-flex-stats :swf:1.0.0: The following artifacts 
could not be resolved: com.adobe.flex.framework:flex-framework:pom:4.1.0.16248,
com.adobe.flex .framework:playerglobal:0.swc:2:4.1.0.16248: Could not find artifact
com.adobe.flex.framework:flex-framework:pom:4.1.0.16248 in central 
http://search.maven.org/) -> [Help 1]

This error message is really frustrating me. I have also tried building a sample app from sonatype examples on how to build a Flex app. Even that fails with a similar message (this time it complained unable to download flex compiler)

<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>nuxi</groupId>
    <artifactId>nuxi-nms-flex</artifactId>
    <version>1.0.0</version>
</parent>
<groupId>nuxi</groupId>
<artifactId>nuxi-nms-flex-stats</artifactId>
<version>1.0.0</version>
<packaging>swf</packaging>
<name>nuxi nms flex stats</name>


<repositories>
    <repository>
        <id>central</id>
        <name>Central Maven Repository</name>
        <url>http://search.maven.org/</url>
        <layout>default</layout>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>org.sonatype.flexmojos</id>
        <name>Flex mojos plugin for maven</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>com.adobe.flex</id>
        <name>Flex compiler</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>com.adobe.flex.framework</id>
        <name>Flex Framework</name>
        <url>https://repository.sonatype.org/content/groups/flexgroup</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

<build>
    <sourceDirectory>src/main/flex</sourceDirectory>
    <testSourceDirectory>src/test/flex</testSourceDirectory>
    <plugins>
        <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <version>4.0-SNAPSHOT</version>
            <extensions>true</extensions>
            <configuration>
                <sourceFile>statsapp.mxml</sourceFile>
                <htmlName>SampleSWF</htmlName>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.adobe.flex</groupId>
                    <artifactId>compiler</artifactId>
                    <!--
                    <version>4.0.0.10485</version>
                    -->
                    <version>4.1.0.16248</version>
                    <type>pom</type>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
    <finalName>statsapp</finalName>
</build>
<dependencies>
    <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>flex-framework</artifactId>
        <!--
        <version>4.0.0.10485</version>
        -->
        <version>4.1.0.16248</version>
        <type>pom</type>
        <exclusions>
           <exclusion>
               <groupId>com.adobe.flex.framework</groupId>
               <artifactId>playerglobal</artifactId>
           </exclusion>
       </exclusions>
    </dependency>
    <dependency>
       <groupId>com.adobe.flex.framework</groupId>
       <artifactId>playerglobal</artifactId>
       <version>4.1.0.16248</version>
       <classifier>2</classifier>
       <type>0.swc</type>
   </dependency>
</dependencies>

My question is, am I doing anything wrong? What could be the issue here? Any help in this regard is appreciated.... Thanks...

Sorry for such a lengthy explanation...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

罪#恶を代价 2024-12-04 19:13:46

通过使用可以轻松修复此问题maven 原型 而不是手动构建它。作为一个很好的起点,在命令行中执行此操作以创建文件夹结构和文件夹结构。初始pom:

mvn archetype:generate -DarchetypeRepository=http://repository.sonatype.org/content/groups/public -DarchetypeGroupId=org.sonatype.flexmojos -DarchetypeArtifactId=flexmojos-archetypes-application -DarchetypeVersion=3.5.0

This could be easily fixed by using maven archetypes instead of building it manually. As a good starting point, do this in the command line to create you folder structure & initial pom:

mvn archetype:generate -DarchetypeRepository=http://repository.sonatype.org/content/groups/public -DarchetypeGroupId=org.sonatype.flexmojos -DarchetypeArtifactId=flexmojos-archetypes-application -DarchetypeVersion=3.5.0
a√萤火虫的光℡ 2024-12-04 19:13:46

我认为你应该使用 net.flexmojos.oss ,它已经取代了 org.sonatype.flexmojos ,新版本高达 6.0.0
大多数依赖项(除了 adobe 的依赖项)都可以在central中找到。
您应该按照 https://flexmojos.atlassian.net/ 中的说明对 FDK 进行 mavenize维基/显示/FLEXMOJOS/Flexmojos+6.x

I think you should use net.flexmojos.oss which has superseeded the org.sonatype.flexmojos with new versions up to 6.0.0
Most dependencies (except from adobe) can be found in central.
You should mavenize FDK as explained in https://flexmojos.atlassian.net/wiki/display/FLEXMOJOS/Flexmojos+6.x

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文