How do I get Alfresco to use the alfresco-simple-content-stores plugin? - alfresco

I've been trying to include the alfresco-simple-content-stores library (https://github.com/Acosix/alfresco-simple-content-stores) with Alfresco Community Edition, and it doesn't appear to be working. I've followed the documentation as best as I can, but I think I must be missing a step because my configuration appears to be completely ignored and there is no indication that it is running. I've done the following:
First, following this documentation (https://docs.alfresco.com/community/tasks/amp-install.html) I tried installing the amp using Alfresco mmt. That failed with the following message:
10250001 An error was encountered during deployment of the AMP into the WAR: 10250000 The following modules must first be installed: [acosix-utility-core:1.0.3.1-*]
However, no such artifact seems to exist.
As I couldn't get past that speed bump, I went down the following path:
I generated a keystore and a master key, referenced below in step 4
I included the following dependency in my alfresco/war/pom.xml (1.0.1.TEST is my locally compiled version of alfresco-simple-content-stores)
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.TEST</version>
<type>amp</type>
</dependency>
I copied the artifact to the Tomcat directory in my Dockerfile
COPY ./war/target/de.acosix.alfresco.simplecontentstores.repo-1.0.1.TEST.amp ${TOMCAT_DIR}/amps
I defined the following properties in my alfresco-global.properties
simpleContentStores.enabled=true
simpleContentStores.customStores=myEncryptingStore,defaultTenantFileContentStore
simpleContentStores.rootStore=myEncryptingStore
simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore
simpleContentStores.customStore.myEncryptingStore.ref.backingStore=defaultTenantFileContentStore
simpleContentStores.customStore.myEncryptingStore.value.keyStorePath=classpath:../keystore/keystore.jks
simpleContentStores.customStore.myEncryptingStore.value.keyStorePassword=masterkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyAlias=ssl
simpleContentStores.customStore.myEncryptingStore.value.masterKeyPassword=alfkeystore
simpleContentStores.customStore.myEncryptingStore.value.masterKeyStoreId=alfkeystore
Despite all of this, files continue to be stored unencrypted and I see no indication that anything has failed. I doubt that this library would fail silently, so I'm left to assume that I've missed some step required to make Alfresco use this plugin.
Any ideas?
Edit:
In response to a comment, here is the abbreviated pom of my alfresco/war project:
<dependencies>
...
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<version>1.0.2.1</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<version>1.0.1.PST</version>
<type>amp</type>
</dependency>
...
</dependencies>
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay />
<overlay>
<groupId>${alfresco.groupId}</groupId>
<artifactId>${alfresco.share.artifactId}</artifactId>
<type>war</type>
<excludes />
</overlay>
<!-- other AMPs -->
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.repo</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.utility</groupId>
<artifactId>de.acosix.alfresco.utility.share</artifactId>
<type>amp</type>
</overlay>
<overlay>
<groupId>de.acosix.alfresco.simplecontentstores</groupId>
<artifactId>de.acosix.alfresco.simplecontentstores.repo</artifactId>
<type>amp</type>
</overlay>
</overlays>
</configuration>
</plugin>
...
</plugins>
...
</build>
Now with that pom configuration, the maven install output shows as follows (shortened to hide irrelevant path information):
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.repo/1.0.2.1/de.acosix.alfresco.utility.repo-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.utility:de.acosix.alfresco.utility.share]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/utility/de.acosix.alfresco.utility.share/1.0.2.1/de.acosix.alfresco.utility.share-1.0.2.1.amp with unknown extension [amp]
[INFO] Processing overlay [ id de.acosix.alfresco.simplecontentstores:de.acosix.alfresco.simplecontentstores.repo]
[WARNING] Skip unpacking dependency file [.../.m2/repository/de/acosix/alfresco/simplecontentstores/de.acosix.alfresco.simplecontentstores.repo/1.0.1.PST/de.acosix.alfresco.simplecontentstores.repo-1.0.1.PST.amp with unknown extension [amp]

Related

jlink showing error while comparing hashes

I am currently trying to bundle a javaFx test application via maven and jlink into a runtime image. I am using bellsoft liberica 18.0.1 as a jdk and I am running on a IntelliJ IDE. I have used the IDE to setup the project initially (via the wizzard). If I hit javafx:run, everything fires up correctly, the application is displayed and all is fine.
However, running javafx:jlink produces the following error:
Error: Hash of javafx.base
(d775513043c11c457939b41e544cc7a83a4076454da4a0798bdc6922ec7d3f8f)
differs to expected hash
(eb1d4f72b292e9bf33005b36c4afeda11b66a8745b868bf0593d1cd4c2974681)
recorded in java.base java.lang.module.FindException: Hash of
javafx.base
(d775513043c11c457939b41e544cc7a83a4076454da4a0798bdc6922ec7d3f8f)
differs to expected hash
(eb1d4f72b292e9bf33005b36c4afeda11b66a8745b868bf0593d1cd4c2974681)
recorded in java.base
This appears odd, as I am unsure which hashes are compared at that point. I have tried executing jlink with --fail-never as well as --lax-checksums and ignoreSigningInformation, but nothing appears to help. I have also tried to check the sha-checksums from within my m2-Repository, but I can't nail it down that way either.
Any help to sort this out is much appreciated.
EDIT: Including the current pom.xml:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>myapp</artifactId>
<version>1.0-SNAPSHOT</version>
<name>myappMavenModulebased</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.1</junit.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>19</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.2</version>
</dependency>
<dependency>
<groupId>com.dlsc.formsfx</groupId>
<artifactId>formsfx-core</artifactId>
<version>11.5.0</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.synedra</groupId>
<artifactId>validatorfx</artifactId>
<version>0.3.1</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>12.3.1</version>
</dependency>
<dependency>
<groupId>org.kordamp.bootstrapfx</groupId>
<artifactId>bootstrapfx-core</artifactId>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>eu.hansolo</groupId>
<artifactId>medusa</artifactId>
<version>16.0.1</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.test.myapp.AppLauncher</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>18</source>
<target>18</target>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>com.test.myapp/com.test.myapp.HelloApplication</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
<noManPages>true</noManPages>
<stripDebug>true</stripDebug>
<noHeaderFiles>true</noHeaderFiles>
<failNever>true</failNever>
<ignoreSigningInformation>true</ignoreSigningInformation>
<jlinkExecutable>/home/user/.jdks/bellsoft-jdk19.0.1/bin/jlink</jlinkExecutable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
EDIT 2: I am providing the jlink-Tool in the pom.xml. My idea was that doing it this way, jlink would be able to create the runtime image based on the liberica-jdk. Is the problem that I am using openjfx-dependencies with the liberica-jlink-Tool?
What the problem is
The module hash mismatch when using jlink occurs because:
You use Liberica "Full JDK" which includes pre-built JavaFX modules in a jmod format AND
You also define JavaFX dependencies in your Maven project based on JavaFX modules in jar format.
This confuses the linker, resulting in the mismatched hash error.
The linker knows there are two copies of the same module with the same module version available on the module path, but they have different hashes, so it errors and exits.
It would be more useful if the error told you exactly where the two modules with differing hashes were found (you could create an enhancement request with the jlink tool in the JDK for that, referencing this post, if you wanted).
How to fix this
You can fix this by either:
Use a JDK distribution that does not include pre-built JavaFX modules (e.g. a standard OpenJDK download or a Liberica "Standard JDK" version) OR
Remove the JavaFX dependencies from your pom.xml file.
Getting some link debug info
To debug, in the pom.xml file configuration for the javafx-maven-plugin, add:
<jlinkVerbose>true</jlinkVerbose>
This will tell you where jlink sourced the modules from (when jlink works).
You can also run maven in debug mode (--debug command line switch for mvn). Maven will tell you a lot more information. For example, the actual full command line and option set used to invoke jlink.
Here is a debug line for linking using OpenJDK using maven jar dependencies for the JavaFX modules:
[DEBUG] Executing command line: [/Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/bin/jlink, --module-path, /Users/myusername/dev/linktest/target/classes:/Users/myusername/.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-controls/19/javafx-controls-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar:/Users/myusername/.m2/repository/org/openjfx/javafx-graphics/19/javafx-graphics-19-mac.jar, --add-modules, com.example.linktest, --output, /Users/myusername/dev/linktest/target/app, --strip-debug, --compress, 0, --no-header-files, --no-man-pages, --verbose, --launcher, app=com.example.linktest/com.example.linktest.HelloApplication]
The command line text can be useful because you can copy it and link from the command line prompt rather than from within Maven (just for testing and verification purposes).
Linking using liberica "Full JDK" which includes JavaFX jmods
For your pom.xml with these changes:
jlinkExecutable in the javafx-maven-plugin configuration set to the jlink in my liberica location.
I don't think this is necessary if the JAVA_HOME environment variable is properly configured to match the liberica distribution and the mvn tool is invoked using the liberica distribution.
jlinkVerbose in the javafx-maven-plugin configuration set to true.
all JavaFX dependencies commented out.
project module and package name changed to com.example.linktest.
I just did that because that is what I used to create the project, as long as the name is consistent everywhere, it doesn't matter what it is.
And a minimal module-info.java to generate a basic JavaFX FXML application added. The linker will output:
[INFO] --- javafx-maven-plugin:0.0.8:jlink (default-cli) # myapp ---
com.example.linktest file:///Users/myusername/dev/linktest/target/classes/
java.base file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.base.jmod
java.datatransfer file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.datatransfer.jmod
java.desktop file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.desktop.jmod
java.prefs file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.prefs.jmod
java.scripting file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.scripting.jmod
java.xml file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/java.xml.jmod
javafx.base file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.base.jmod
javafx.controls file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.controls.jmod
javafx.fxml file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.fxml.jmod
javafx.graphics file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/javafx.graphics.jmod
jdk.unsupported file:///Users/myusername/Library/Java/JavaVirtualMachines/liberica-19.0.1/jmods/jdk.unsupported.jmod
All of the JavaFX dependencies are sourced from the liberica provided jmods, such as this:
liberica-19.0.1/jmods/javafx.base.jmod
Linking using OpenJDK and JavaFX maven jars
If instead you use a standard OpenJDK without pre-built JavaFX modules and JavaFX modules added as dependencies in the pom.xml, then the output is:
[INFO] --- javafx-maven-plugin:0.0.8:jlink (default-cli) # myapp ---
com.example.linktest file:///Users/myusername/dev/linktest/target/classes/
java.base file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.base.jmod
java.datatransfer file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.datatransfer.jmod
java.desktop file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.desktop.jmod
java.prefs file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.prefs.jmod
java.scripting file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.scripting.jmod
java.xml file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/java.xml.jmod
javafx.base file:///Users/myusername/.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar
javafx.controls file:///Users/myusername/.m2/repository/org/openjfx/javafx-controls/19/javafx-controls-19-mac.jar
javafx.fxml file:///Users/myusername/.m2/repository/org/openjfx/javafx-fxml/19/javafx-fxml-19-mac.jar
javafx.graphics file:///Users/myusername/.m2/repository/org/openjfx/javafx-graphics/19/javafx-graphics-19-mac.jar
jdk.unsupported file:///Users/myusername/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/jmods/jdk.unsupported.jmod
The javafx modules are sourced as jars out of the .m2 repository rather than coming as mods from the JDK:
.m2/repository/org/openjfx/javafx-base/19/javafx-base-19-mac.jar
Either way, you end up with a packaged, linked, usable JavaFX application.

ERROR: Stubs could not be found. Please make sure that spring-cloud-contract:convert was invoked

Using Spring Cloud Contract 2.1.3.RELEASE with spring-boot 2.1.1.RELEASE, I have added the dependency and plugin per explained in the guide:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<version>${spring-cloud-contract.version}</version>
<scope>test</scope>
</dependency>
and
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
<extensions>true</extensions>
</plugin>
I have also added under: $rootDir/src/test/resources/contracts:
Groovy file:
package contracts
import org.springframework.cloud.contract.spec.Contract
Contract.make {
name("contract_updateNodeV4")
request {
method 'PUT'
url '/v4/nodes'
headers {
header 'Content-Type': 'application/vnd.org.springframework.cloud.contract.verifier.twitter-places-analyzer.v1+json'
}
body(file("updateNodeV4_request.json"))
}
response {
status OK()
body(file("updateNodeV4_response.json"))
}
}
And corresponding updateNodeV4_request.json and updateNodeV4_response.json (omitting their contents since these are large) valid JSON files.
When running mvn clean install I expected generated tests to be created (and fail for now) per the guide.
Instead I am getting the following error:
[ERROR] Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.0.0.RELEASE:generateStubs (default-generateStubs) on project xxx: Stubs could not be found: [C:\Users\xxx\git\xxx\target\stubs] .
[ERROR] Please make sure that spring-cloud-contract:convert was invoked
Most likely your contacts are not under the module's src/test/resources/contracts but under the root module's folder. If that's the case you need to tell the plugin that by seeing the contracts dir plugin property
I solved it by moving the plugin:
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
<extensions>true</extensions>
</plugin>
From the root pom.xml to the specific module's pom.xml in which I have created the contracts in. Now it works as expected.

m2e-webby and provided dependencies with jetty

I have a maven project with some provided dependencies and I am trying to run the application with webby but it give me a java.lang.ClassNotFoundException exception.
In this link it says: "Webby allows to initialize a launch configuration from the configuration of the jetty-maven-plugin".
My question is it is possible to also pass the dependencies defined in the jetty-maven-plugin? If not how can webby resolve the provided dependencies?
Want I did was to create a profile in the pom project:
<profile>
<id>webby</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>version</version>
</dependency>
</dependencies>
</profile>
And then right click on the project -> properties -> Maven and added webby to the Active Maven Profiles

Flex & Maven : How to upgrade playerglobal version in pom.xml

I'm currently developping an flex application, and i've used native cursor support to dynamically change cursor in particular conditions.
My application runs with Flex Sdk 4.1.0.16076, which use flash player 10.0 by default.
I have upgrade this version to 10.2 in project preferences, in order to use MouseCursorData class.
It works fine in eclipse but i'm using maven for dependencies and I have compilation error when doing a maven build, saying MouseCursorData Class can't be found.
It's pretty normal since i'm using player 10 in my dependencies. So I tried to update my pom.xml file for upgrading player to 10.2 :
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<configuration>
<targetPlayer>10.0</targetPlayer>
<compiledLocales>
<locale>en_US</locale>
<locale>fr_FR</locale>
</compiledLocales>
<warnings>
<noConstructor>false</noConstructor>
</warnings>
<sourceFile>Opale.mxml</sourceFile>
<generateHtmlWrapper>true</generateHtmlWrapper>
<contextRoot>opale-web</contextRoot>
<services>${basedir}/src/main/resources/services-config.xml</services>
<output>target/opale-ui.swf</output>
</configuration>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
First, I have changed the targetPlayer in flex mojo plugin from 10.0 to 10.2.
Then I obtain the compilation error :
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:compile-swf (default-compile-swf) on project opale-ui: TargetPlayer and playerglobal dependency version doesn't match! Target player: 10.2, player global: 10.0 -> [Help 1]
So, i had a dependency to force playerglobal version :
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>${flex.sdk.version}</version>
<classifier>10.2.0</classifier>
<type>swc</type>
</dependency>
Then, i have the following error :
Downloading: http://repo.maven.apache.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.698s
[INFO] Finished at: Wed Sep 12 12:29:57 CEST 2012
[INFO] Final Memory: 9M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project opale-ui: Could not resolve dependencies for project com.igc.opale:opale-ui:swf:1.9-SNAPSHOT: Could not transfer artifact com.adobe.flex.framework:playerglobal:swc:10.2.0:4.1.0.16076 from/to jboss (http://repository.jboss.org/maven2/): Access denied to: http://repository.jboss.org/maven2/com/adobe/flex/framework/playerglobal/4.1.0.16076/playerglobal-4.1.0.16076-10.2.0.swc, ReasonPhrase:Forbidden. -> [Help 1]
I new to maven so maybe i'm doing this pretty badly.
You can configure this in plugins
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<headlessServer>true</headlessServer>
<verboseStacktraces>true</verboseStacktraces>
<swfVersion>11</swfVersion>
<targetPlayer>10.2</targetPlayer>
...
</configuration>
</plugin>
</plugins>
And dependency:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.5.1.21328</version>
<classifier>10.2</classifier>
<type>swc</type>
</dependency>
If you search the sonatype repo you will find that the actual dependency you are looking for is:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>playerglobal</artifactId>
<version>4.1.0.16076</version>
<classifier>10</classifier>
<type>1.swc</type>
</dependency>
notice how the type is 1.swc, I believe this is to cater for a shortfall in earlier versions of the SDK.

How to build flex resource module in flexmojos4.x

I use flexmojos plugin to manage my flex app. At first, I use flexmojos3.8, the following is fragment to create seperate resource module. If my app support en_US, zh_Ch, I can get MainApp_en_US.swf and MainApp_zh_CN.swf. In my app, I can load proper resource module according to browser's language.
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.sdk.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<configuration>
<sourceFile>MainApp.mxml</sourceFile>
<resourceBundlePath>
src/main/flex/locale/{locale}
</resourceBundlePath>
<runtimeLocales>${locales}</runtimeLocales>
<mergeResourceBundle>false</mergeResourceBundle>
<runtimeLocaleOutputPath>
/{contextRoot}/MainApp_{locale}.{extension}
</runtimeLocaleOutputPath>
<rslUrls>
<url>/{contextRoot}/rsl/{artifactId}.{extension}</url>
</rslUrls>
</configuration>
</plugin>
But when I upgrade flexmojos 4.0-RC2, I find the changes are big. The config changes to
.....
MainApp.mxml
src/main/flex/locale/{locale}
<localesRuntime>
<locale>en_US</locale>
<locale>fr_FR</locale>
<locale>zh_CN</locale>
</localesRuntime>
//Output resource module to current pathe (/target)
<localesOutputPath>
/
</localesOutputPath>
//Define your resource moudle name pattern
<resourceBundleNames>
MainApp_{locale}
</resourceBundleNames>
.....
</configuration>
It works after lots of trying. The last config like above.

Resources