Well I wouldn't say that setting properties would be a "best" practice.

In our case a debug-, release- or whatsoever-build has to configure
much more than a simple true/false value so your suggestion of using
system properties would be a dead end. Using profiles however allows.
you to configure a lot more (In our case we have debug build use
static linking instead of rsl-usage, debug Builds have different main
classes...). A simple system property would not be sufficient.

Chris



2012/2/16 Bertrand Quenin <[email protected]>:
> Hi,
>
> I actually made it work but it's kinda ugly ...
>
> Here is my solution:
> I setup an additional execution to the compile phase with a specific
> configuration.
>
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.sonatype.flexmojos</groupId>
>                 <artifactId>flexmojos-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>compile debug swf</id>
>                         <phase>compile</phase>
>                         <goals>
>                             <goal>compile-swf</goal>
>                         </goals>
>                         <configuration>
>                             <debug>true</debug>
>                             <optimize>false</optimize>
>
> <output>${project.build.directory}/${project.artifactId}-${project.version}-debug.swf</output>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> This result in 2 artifacts being build which is what I wanted.
> However, for some reason, the maven install plugin deploy the "debug"
> artifact as the "main" artifact being built (and only this one).
> So I has to circumvent that by adding the following lines to make sure both
> artifacts are deployed.
> I classified the "debug" artifact as "debug" and it does the trick.
>
>     <build>
>         <plugins>
>             <plugin>
>                 <artifactId>maven-install-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>install release version</id>
>                         <phase>install</phase>
>                         <goals>
>                             <goal>install-file</goal>
>                         </goals>
>                         <configuration>
>                             <groupId>${project.groupId}</groupId>
>                             <artifactId>${project.artifactId}</artifactId>
>                             <packaging>${project.packaging}</packaging>
>                             <version>${project.version}</version>
>
> <file>${project.build.directory}/${project.artifactId}-${project.version}.swf</file>
>                         </configuration>
>                     </execution>
>                     <execution>
>                         <id>install debug version</id>
>                         <phase>install</phase>
>                         <goals>
>                             <goal>install-file</goal>
>                         </goals>
>                         <configuration>
>                             <groupId>${project.groupId}</groupId>
>                             <artifactId>${project.artifactId}</artifactId>
>                             <packaging>${project.packaging}</packaging>
>                             <version>${project.version}</version>
>                             <classifier>debug</classifier>
>
> <file>${project.build.directory}/${project.artifactId}-${project.version}-debug.swf</file>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> This is kinda hackish and I'm sure there's a bette way to do that but I
> couldn't find it :)
> This may even have drawbacks if you're using other maven targets that might
> be affected by this special build. For instance, we're using
> hudson/artifactory in my company and only the "release" artifact is deployed
> to the artifactory. I think this is because we're not using the regular
> maven deploy taget which might need to be overridden as well.
>
> If anyone has a cleaner solution, feel free to share.
>
> Thanks,
> BQ.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Flex Mojos" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/flex-mojos
>
> http://flexmojos.sonatype.org/

-- 
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos

http://flexmojos.sonatype.org/

Reply via email to