Migrating from Flexmojos 3 to Flexmojos 4

Code Generation

If you used GraniteDS to generate your code:

<plugin>
		<groupId>org.sonatype.flexmojos</groupId>
	  	<artifactId>flexmojos-maven-plugin</artifactId>
		<version>${flexmojos.version}</version>
		<extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <generatorToUse>graniteds21</generatorToUse>
                            <includeClasses>
                                <includeClass>de.cware.cweb.attachments.model.Attachment</includeClass>
                            </includeClasses>
                            <templates>
                                <base-enum-template>${basedir}/src/main/template/enum.gsp</base-enum-template>
                                <base-entity-template>${basedir}/src/main/template/beanBase.gsp</base-entity-template>
                                <entity-template>${basedir}/src/main/template/bean.gsp</entity-template>
                                <base-bean-template>${basedir}/src/main/template/beanBase.gsp</base-bean-template>
                                <bean-template>${basedir}/src/main/template/bean.gsp</bean-template>
                            </templates>
                            <extraOptions>
                                <outputEnumToBaseOutputDirectory>true</outputEnumToBaseOutputDirectory>
                            </extraOptions>
                        </configuration>
                    </execution>
                </executions>
	</plugin>

I had to modify this to:

<plugin>
		<groupId>org.sonatype.flexmojos</groupId>
	  	<artifactId>flexmojos-maven-plugin</artifactId>
		<version>${flexmojos.version}</version>
		<extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <includeJavaClasses>
                                <class>de.cware.cweb.attachments.model.Attachment</class>
                            </includeJavaClasses>
                            <templates>
                                <enum-template>${basedir}/src/main/template/enum.gsp</enum-template>
                                <base-entity-template>${basedir}/src/main/template/beanBase.gsp</base-entity-template>
                                <entity-template>${basedir}/src/main/template/bean.gsp</entity-template>
                                <base-bean-template>${basedir}/src/main/template/beanBase.gsp</base-bean-template>
                                <bean-template>${basedir}/src/main/template/bean.gsp</bean-template>
                            </templates>
                        </configuration>
                    </execution>
                </executions>
	</plugin>

Notice the "generatorToUse" was left away (defaults to 2.2), "includeClasses" was changed to "includeJavaClasses", "includeClass" was changed to "class", "base-enum-template" was changed to "enum-template" and the "extraOptions" could be left away.

I18N and Resource Bundles

If you had a configuration containing the compiled-locals:

<configuration>

                    ...

                    <compiledLocals>
                        <locale>en_US</locale>
                        <locale>de_DE</locale>
                    </compiledLocals>
                </configuration>

You have to modify this to:

<configuration>

                    ...

                    <localesCompiled>
                        <locale>en_US</locale>
                        <locale>de_DE</locale>
                    </localesCompiled>
                </configuration>

One more difference I found was that if you define localsCompiled and don't have any resources in the locales directories, then you will get errors in FM4 ... If you don't have any resources, just leave away the entire "localedCompiled" section.

If you specify a non-default location of your locale resources:

<configuration>

                    ...

                    <resourceBundlePath>${basedir}/src/main/locales/{locale}</resourceBundlePath>

                    ...

                </configuration>

must be changed to:

<configuration>

                    ...

                    <localesSourcePath>${basedir}/src/main/locales/{locale}</localesSourcePath>

                    ...

                </configuration>

But I would suggest to use the default paths and leaving the parameter away completely. The default is: ${basedir}/src/main/locales/{locale}

Stylesheets

If you had a configuration introducing stylesheets:

<configuration>

                    <includeStylesheet>
                        <stylesheet>
                            <path>defaults.css</path>
                        </stylesheet>
                    </includeStylesheet>
		</configuration>

You have to modify this to (notice that stylesheet got renamed to stylesheets):

<configuration>

		    <includeStylesheets>

                        ...

			<stylesheet>
			    <path>defaults.css</path>
			</stylesheet>
		    </includeStylesheets>
		</configuration>