简体   繁体   中英

Maven compile error: unable to load SWC

I'm trying to build a Flex project using Maven 3.1.1 and during the compile phase, I'm getting the error "Unable to load SWC cairngorm-2.2.1.swc".

I have the following dependencies declared in the POM:

<dependency>
    <groupId>com.adobe.flex.framework</groupId>
    <artifactId>flex-framework</artifactId>
    <version>4.1.0.16076</version>
    <type>pom</type>
</dependency>
<dependency>
    <groupId>com.adobe.flex</groupId>
    <artifactId>cairngorm</artifactId>
    <version>2.2.1</version>
    <type>swc</type>
</dependency>

Maven successfully downloads everything to my local repository and I can see the cairngorm-2.2.1.swc file in there, but it still gives the error "Unable to load SWC cairngorm-2.2.1.swc" during compile.

EDIT: Here is the full output from running "mvn clean compile":

    [INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] SIMPLe Dashboard
[INFO] SIMPLe Flex Client- SWF
[INFO] Web Tier
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SIMPLe Dashboard 0.0.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-compiler-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> must
 be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-surefire-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> must
 be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ simpledashboard ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SIMPLe Flex Client- SWF 0.0.0.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-install-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> must
be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-resources-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> mus
t be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-compiler-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> must
 be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[WARNING] The metadata E:\UserFolders\jmatthews\m2\repository\org\apache\maven\plugins\maven-surefire-plugin\maven-metadata-flexpmd.opensource.adobe.snapshots.xml is invalid: end tag name </head> must
 be the same as start tag <link> from line 103 (position: TEXT seen ...  _add_tracking(\'nbhd\', \'UA-32556647-1\');\n      \n</script>\n</head>... @204:8)
[WARNING] The POM for com.adobe.flex:cairngorm:swc:2.2.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ flex-client ---
[INFO] Deleting E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ flex-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources
[INFO]
[INFO] --- flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) @ flex-client ---
[INFO] Flexmojos 3.8
[INFO]   Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[WARNING] Invalid POM for com.adobe.flex:cairngorm:swc:2.2.1, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Not defined if locales should be merged or not
[INFO] Flex compiler configurations:
-compiler.external-library-path E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\playerglobal\4.1.0.16076\10.0\playerglobal.swc
-compiler.include-libraries=
-compiler.library-path E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\datavisualization\4.1.0.16076\datavisualization-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\
flex\framework\flash-integration\4.1.0.16076\flash-integration-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\flex\4.1.0.16076\flex-4.1.0.16076.swc E:\UserFolders\jmat
thews\m2\repository\com\adobe\flex\framework\framework\4.1.0.16076\framework-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076.swc E:\Us
erFolders\jmatthews\m2\repository\com\adobe\flex\framework\rpc\4.1.0.16076\rpc-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\spark\4.1.0.16076\spark-4.1.0.16076.swc E
:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\sparkskins\4.1.0.16076\sparkskins-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\textLayout\4.1.0.16076\
textLayout-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\utilities\4.1.0.16076\utilities-4.1.0.16076.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\cairngo
rm\2.2.1\cairngorm-2.2.1.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\datavisualization\4.1.0.16076\datavisualization-4.1.0.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\reposi
tory\com\adobe\flex\framework\framework\4.1.0.16076\framework-4.1.0.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076-en_US.rb.swc E:
\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\rpc\4.1.0.16076\rpc-4.1.0.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\spark\4.1.0.16076\spark-4.1.0
.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\textLayout\4.1.0.16076\textLayout-4.1.0.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\fra
mework\flash-integration\4.1.0.16076\flash-integration-4.1.0.16076-en_US.rb.swc E:\UserFolders\jmatthews\m2\repository\com\adobe\flex\framework\playerglobal\4.1.0.16076\playerglobal-4.1.0.16076-en_US.
rb.swc
-compiler.theme E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\configs\themes\Spark\spark.css
-compiler.accessible=false
-compiler.allow-source-path-overlap=false
-compiler.as3=true
-compiler.debug=true
-compiler.es=false
-compiler.fonts.advanced-anti-aliasing=true
-compiler.fonts.max-cached-fonts 20
-compiler.fonts.max-glyphs-per-face 1000
-compiler.fonts.managers flash.fonts.BatikFontManager
-compiler.fonts.local-fonts-snapshot E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\fonts.ser
-compiler.keep-generated-actionscript=false
-licenses.license flashbuilder4 952301738912234531167403
-licenses.license flexbuilder4.displayedStartPageAtLeastOneTime true
-compiler.locale en_US
-compiler.optimize=true
-compiler.warn-no-constructor=false
-compiler.source-path E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\src\main\flex
-compiler.strict=true
-use-network=true
-compiler.verbose-stacktraces=false
-compiler.context-root /simple-dashboard
-compiler.services E:\UserFolders\jmatthews\Stash\simple_dashboard\web-tier\src\main\webapp\WEB-INF\flex\services-config.xml
-compiler.actionscript-file-encoding UTF-8
-target-player 10.0.0
-default-background-color 8821927
-default-frame-rate 24
-default-script-limits 1000 60
-default-size 500 375
-compiler.headless-server=false
-compiler.keep-all-type-selectors=false
-compiler.use-resource-bundle-metadata=true
-metadata.date Fri Mar 03 13:29:19 EST 2017
-metadata.localized-title SIMPLe Flex Client- SWF x-default
-verify-digests=true
-compiler.namespaces.namespace+=http://ns.adobe.com/mxml/2009,E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\config-4.1.0.16076\mxml-2009-manifest.xml
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/spark,E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\config-4.1.0.16076\spark-manifest.xml
-compiler.namespaces.namespace+=library://ns.adobe.com/flex/mx,E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\config-4.1.0.16076\mx-manifest.xml
-compiler.namespaces.namespace+=http://www.adobe.com/2006/mxml,E:\UserFolders\jmatthews\Stash\simple_dashboard\flex-client\target\classes\config-4.1.0.16076\mxml-manifest.xml -static-link-runtime-shar
ed-libraries=false -load-config=
-metadata.language+=en_US
[ERROR] unable to load SWC cairngorm-2.2.1.swc
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SIMPLe Dashboard .................................. SUCCESS [0.928s]
[INFO] SIMPLe Flex Client- SWF ........................... FAILURE [8.033s]
[INFO] Web Tier .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.939s
[INFO] Finished at: Fri Mar 03 13:29:22 EST 2017
[INFO] Final Memory: 18M/314M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.8:compile-swf (default-compile-swf) on project flex-client: Error compiling! -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :flex-client

Here is the issue:

[WARNING] Invalid POM for com.adobe.flex:cairngorm:swc:2.2.1, transitive dependencies (if any) will not be available, enable debug logging for more details

You need to solve this issue to have the library available. Learn more about this:

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies

Maven. Transitive dependencies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM