Html Wrapper Mojo

Hi folks,

This week we make public the first release of HtmlWrapperMojo.

This guy is used to generate the html to open flex applications, like what is done by flex builder.

To enable it, just add this new mojo on plugins section:

<build>
  <plugins>
    <plugin>
      <groupId>info.flex-mojos</groupId>
      <artifactId>html-wrapper-mojo</artifactId>
      <executions>
        <execution>
          <goals>
            <goal>wrapper</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

A simple hello world can be view here.

It’s very simple to use, and has no need of configurations do get it running.

It support all standard templates made by Adobe. Just need to define templateURI parameter. Valid values to templateURI:
class:client-side-detection
class:client-side-detection-with-history (default)
class:express-installation
class:express-installation-with-history
class:no-player-detection
class:no-player-detection-with-history

You can even point to a file using “file:///etc/hosts”. This file must be a zip and must have index.template.html inside it.

When using custom templates you may need to set custom parameters on your index.template.html. This can be done by configuring parameters:

<parameters>
	<swf>${build.finalName}</swf>
	<width>100%</width>
	<height>100%</height>
</parameters>

All required parameters to Adobe’s template are defined by default. But you can overwrite they at any time.

Any suggestions?

VELO

10 Responses to “Html Wrapper Mojo”

  1. ColdFusion Says:

    This is nice, I think, so what do you do with it? If it does the same thing as Flex builder why do I need it? How do I use it? How does it work? A little more info would be welcome, thank you.

  2. velo Says:

    Well, if you use Maven it’s a good think.
    If you don’t and don’t know what Maven is, I recommend you take some time to learn it. http://maven.apache.org/

    It’s a great tool for enterprise environments.

    VELO

  3. Logan Says:

    @ColdFusion:
    The advantage is being able to build your entire application in an automated fashion, for example with a build server. It is difficult or impossible to automate a build with Flex Builder. The flex-mojos plugin for Maven is an alternative to using Ant and Antennae for Flex builds, and this adds one of the few remaining things that Flex Builder can do that you couldn’t do with Maven and flex-mojos.

    Nice work VELO!

  4. Logan Says:

    There are some projects that customize their index.template.html and associated files, and keeping those zipped up seems a hassle if you constantly modify them.
    It would be nice if you could point to an html-template folder in your project and have it work with that instead of a zipped archive.

  5. velo Says:

    Sure, add a issue on google project site.

    VELO

  6. Ryan Ackley Says:

    Why not just let it point to the index.template.html file by itself? Why does it have to be in a zip?

  7. Constantiner Says:

    Can’t execute this great mojo. There is stacktrace:
    [INFO] ————————————————————————
    [INFO] [html-wrapper-mojo:wrapper {execution: default}]
    java.net.URISyntaxException: Illegal character in opaque part at index 22: jar:f
    ile:/D:/Documents and Settings/Constantiner/.m2/repository/info/flex-mojos/html-wrap
    per-mojo/2.0-alpha1/html-wrapper-mojo-2.0-alpha1.jar!/client-side-detection-with
    -history.zip
    at java.net.URI$Parser.fail(URI.java:2809)
    at java.net.URI$Parser.checkChars(URI.java:2982)
    at java.net.URI$Parser.parse(URI.java:3019)
    at java.net.URI.(URI.java:578)
    at java.net.URL.toURI(URL.java:918)
    at info.flexmojos.htmlwrapper.HtmlWrapperMojo.execute(HtmlWrapperMojo.ja
    va:133)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
    nManager.java:451)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
    ultLifecycleExecutor.java:558)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
    fecycle(DefaultLifecycleExecutor.java:499)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
    ltLifecycleExecutor.java:478)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
    dleFailures(DefaultLifecycleExecutor.java:330)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
    ts(DefaultLifecycleExecutor.java:291)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
    fecycleExecutor.java:142)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

    Windows XP SP2.

    I think the problem is in paths with spaces.

  8. Arun Says:

    Sorry, I’m new to Maven and mojos. I can’t seem to find the doc for the html-wrapper-mojo at http://docs.flex-mojos.info/ What configuration options does it support?

  9. velo Says:

    Hi Arun,

    Take a look here:
    http://docs.flex-mojos.info/html-wrapper-mojo/wrapper-mojo.html

    VELO

  10. Arun Says:

    @velo: Thanks! I guess the link for html-wrapper-mojo at http://docs.flex-mojos.info/ needs to be updated to point to http://docs.flex-mojos.info/html-wrapper-mojo/wrapper-mojo.html

Leave a Reply