Hi,
I am adding the code snippet i added to Israfil pluggin (custom
modification), which allowed me to add context root param for the
compilers. The file being modified was : AbstractFlexMojo.java
Step: 1 : Add contextRoot param to AbstractFlexMojo.java as a member
variable.
/**
* contextRoot to add to compiler at runtime. This param will be used
in
* with dataServicesConfig.
*
* @parameter
*/
protected String contextRoot;
Step : 2 : Adding following code in AbstractFlexMojo.java, just before
this line - if (dataServicesConfig != null) {
if (contextRoot != null){
if (contextRoot.trim().length() > 0){
try{
javaParms.add("-compiler.context-root");
javaParms.add(contextRoot.trim());
}catch(Exception e){
throw new MojoExecutionException("Exception attempting to set
contextRoot: " + contextRoot, e);
}
}
}
Step : 3 : Lastly add contextRoot to your Maven pom
<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<version>2.1.1-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<flexHome>${flex.home}</flexHome>
<useNetwork>true</useNetwork>
<contextRoot>/samples</contextRoot>
<dataServicesConfig>
C:\
jboss-4.0.5.GA\server\default\deploy
\samples.war\WEB-INF\flex\services-config.xml
</dataServicesConfig>
<strict>true</strict>
<warning>true</warning>
<main>index.mxml</main>
</configuration>
</plugin>
Hope this will help.
thanks
Sudhan