Install-mojo

Put Adobe Flex SDK into a maven repo was a pain in the *ss…

I did that several times, and well, I’M FULL OF DOING IT.

But that is on the pass. This week I create a mojo to do that. BTW, I create 2 mojos. One to install Flex SDK at local repo and another to deploy into a remote repo.

Usages:

mvn info.flex-mojos:install-mojo:install-sdk -Dflex.sdk.folder=${flex sdk folder} -Dversion=${flex sdk version}

mvn info.flex-mojos:install-mojo:deploy-sdk -Dflex.sdk.folder=${flex sdk folder} -Dversion=${flex sdk version} -Durl=${remote repo}

Very simple to use.

It will produce several artifacts. All under <groupId>com.adobe.flex</groupId>. Two artifacts are very important for flex-mojos:

<dependency>
  <groupId>com.adobe.flex</groupId>
  <artifactId>compiler</artifactId>
  <version>${flex sdk version}</version>
  <type>pom</type>
</dependency>
<dependency>
  <groupId>com.adobe.flex.framework</groupId>
  <artifactId>flex-framework</artifactId>
  <version>${flex sdk version}</version>
  <type>pom</type>
</dependency>

The first one is the compiler. Java stuff. JAR’s
The second is the flex framework. Flex stuff. SWC’s

2 notes. The flex-framework dependency is to be used as your project dependency. This two dependencies should not be used together, so, if both appear on the same dependencies block of your project there is a great chance of something wrong.

Now is easier to update flex version. Just need to add the two dependencies in the right places. You can see how/where here.

Flex-mojos sources are updated to use this new dependencies, but I didn’t release it. And I didn’t update maven repository too.

Stay tuned.

VELO

21 Responses to “Install-mojo”

  1. […] updates on alpha4: Flex-mojos was build using install mojo dependencies. Yes, we are buying what we are selling. That’s “force” me to released install […]

  2. Nice work! This just saved me a bunch of time!

    Really love this project. It keeps getting better all the time. Good job!

  3. Is it possible to use deploy-sdk for a repository which requires authentication? (I just could not make it work yet with artifacroty.)

  4. Sure.

    http://www.sonatype.com/book/reference/repository-manager.html#d0e21980

    VELO

  5. I just want to resolve and run the install-mojo for the first time. Is there a pom.xml available based on which I can run the mentioned install commands?

  6. Install mojo works like maven install-file.

    It doesn’t need the pom.xml, and I don’t know if is possible to launch it from a pom.xml.

    VELO

  7. Its propably a stupid question, but how does maven know when not from a pom.xml where to download info.flex-mojo before executing the install target?

    I promise I´ll make a step-by-step guide for maven newbies when I get it up and running :-)

    My error:
    mvn info.flex-mojos:install-mojo:2.0M5:install-sdk -Dflex.sdk.folder=/Users/chris/Documents/Libraries/flex_sdk_3.1.0.2710/ -Dversion=3.1.0.2710

    [INFO] Scanning for projects…
    Downloading: http://repo1.maven.org/maven2/info/flex-mojos/mojo/2.0M5/mojo-2.0M5.pom
    Downloading: http://repo1.maven.org/maven2/info/flex-mojos/mojo/2.0M5/mojo-2.0M5.pom
    [INFO] ————————————————————————
    [ERROR] BUILD ERROR
    [INFO] ————————————————————————
    [INFO] Failed to resolve artifact.

    GroupId: info.flex-mojos
    ArtifactId: mojo
    Version: 2.0M5

    Reason: Unable to download the artifact from any repository

    info.flex-mojos:mojo:pom:2.0M5

    from the specified remote repositories:
    central (http://repo1.maven.org/maven2)

  8. This is new…. but maven is write.

    You need to add repository information (http://blog.flex-mojos.info/2008/06/14/maven-repository/) at your settings.xml.

    Normally we add repositories to pom.xml, but in this case, there is no pom, so, you need to add a profile to settings.xml

    Do you know how to do that?

    VELO

  9. I think I know where to place it: same directory where maven repository directory resides in, but I´m not 100% sure about the content of the file.

    flex-mojos-repository
    http://svn.sonatype.org/flexmojos/repository/

    true

    false

    This doesn´t work.

  10. I can’t read your file, anyway, download from:
    http://flex-mojos.googlecode.com/files/flex-mojos%20settings.xml

    Should work, but I didn’t test it.

    VELO

  11. Hi,

    I tried to add this file to my repository, but maven still not recognizes this alternative online repository.

    Christoph

  12. It should work….
    Please take a look at http://maven.apache.org/settings.html#Plugin_Repositories

    If don’t work, try to download install mojo and install it manually, but it must work.

    VELO

  13. You can put the settings.xml file in your HOME directory (~/settings.xml) or point to it by running “mvn -s /path/to/your/settings.xml …”

  14. […] repository. So let’s start installing flexbuilder FDK at maven repo. For that task we use the install-mojo: mvn info.flex-mojos:install-mojo:install-sdk -Dflex.sdk.folder=${your path to […]

  15. […] patch (FDK 3.0 or FDK 3.1); 3 - Unpack zip content into SDK lib folder (jars to jars); 4 - Use install mojo to get it on maven repo. (I suggest using a version like 3.1.0-brian, or something like that) 5 - […]

  16. Hi!

    I try install Brain fast SDK with this command:
    mvn -s settings.xml info.flex-mojos:install-mojo:install-sdk -Dflex.sdk.folder=flex_sdk_3_fast -Dversion=3.1.0-fast

    when i try to check it:
    mvn -o com.adobe.flex:flex-framework:3.0.1-fast:create

    I recive error
    [ERROR] BUILD ERROR
    [INFO] Failed to resolve artifact.

    sorry for my bad english )

  17. I ran this

    mvn -o com.adobe.flex:flex-framework:3.0.1.2710:create

    Doesn’t work here neither. But I have no idea what it does, so I assume that is expected.

    VELO

  18. If I used this depends after install

    com.adobe.flex
    compiler
    3.0.1-fast
    pom

    I recive error
    [ERROR] BUILD ERROR
    [INFO] Failed to resolve artifact.

  19. Did the install was success?

    This error make no sense. I use install mojo several times. And it works well. So I need to know what you are doing different from me.

    VELO

  20. Yes install was successful.
    [INFO] Installing /tmp/flex-framework26100.pom to /Users/stanislav/.m2/repository/com/adobe/flex/framework/flex-framework/3.0.1-fast/flex-framework-3.0.1-fast.pom

    I browse local repo and find all files in correct (as i think) places.

  21. when i add this to repo list

    local
    /Users/stanislav/.m2/repository

    all works. I think something wrong in my settings.

Discussion Area - Leave a Comment