Unable to download flexmojos plugin, maven ignores repositories config - apache-flex

I have Flex project and I need flexmojos-maven-plugin to build it.
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
...
</plugin>
I also mentioned repository
<repositories>
<repository>
<id>flexmojos</id>
<url>http://repository.sonatype.org/content/groups/flexgroup/</url>
</repository>
</repositories>
But maven ignores it and doesn't try to download plugin from there.
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/sonatype/flexmojos/flexmojos-maven-plugin/3.9/flexmojos-maven-plugin-3.9.jar
[INFO] Unable to find resource 'org.sonatype.flexmojos:flexmojos-maven-plugin:maven-plugin:3.9' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
Please, advise. Thanks!

There seems to be something wrong with the 3.9 build. I can successfully download version 3.8 without any problems. But 3.9 triggers an "unable to find resource" error.
I doubt you've had problems resolving the repositories. Sometimes the Maven output doesn't do a great job of showing its efforts it reading from remote repos. Particularly when you repeatedly run the same failing command (e.g. mvn clean install).
Take a look in your local repository. If you can find anything under org/sonatype/flexmojos then you're certainly resolving the repository correctly.
I would suggest you post this on the mailing list: https://docs.sonatype.org/display/FLEXMOJOS/Project+Information

Related

Eclipse Luna maven-jar-plugin execution not covered by lifecycle

I have a maven java project (deploying to jboss, if that matters) that uses the maven-jar-plugin. This works fine using Eclipse Kepler. I'm now trying Luna (EE edition), and I'm now getting this error
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.5:jar (execution: make-a-jar, phase: compile)
in all my child .pom files (the maven-jar-plugin is specified in the parent .pom file, but the error points to the block in the child .poms).
In the .pom viewer, if I click on the error message in the Overview tab, it gives me the option to "Discover new m2e connectors". Clicking on this brings up the "m2e Marketplace" dialog and appears to do a bunch of work, but then just shows me an empty list. If I click "Finish", it tries to calculate dependencies, and then gives me this error:
Operation details
Cannot complete the request. See the error log for details.
"m2e connector for mavenarchiver pom properties" will be ignored because a newer version is already installed.
So it appears to be that maybe the maven-jar-plugin depends on a particular version of mavenarchiver, but Eclipse Luna EE comes with a newer version. Is there a way to fix this problem, or do I just have to wait for a newer version of maven-jar-plugin to be released? (I'm currently using version 2.5 of maven-jar-plugin, which is the latest that I'm aware of.)
I had a similar problem when trying to import Hadoop project in Eclipse. The solution above works... but I got "tired" of changing some of the pom files, and thought that the change would bite me later. So, another solution is:
To avoid the messages in Eclipse regarding execution not covered by lifecycle, go to Windows -> Preferences -> Maven -> Errors/Warning and select Ignore for "Plugin execution not covered for Lifecycle.."
You can solve the problem when you change the phase of execution from compile to package (which is default lifecycle phase for jar goal).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin}</version>
<executions>
<execution>
<phase>package</phase> <!-- changed from compile to package -->
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

copy-flex-resources not working in flexmojos

I am trying to copy the dependent into war using the copy- flex-resources plugin. However I'm getting the following error :
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:copy-flex-resources (default) on project myproject: Execution default of goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:copy-flex-resources failed. NullPointerException
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.2-beta</version>
</plugin>
I'm all over this issue, but could not find a solution.
I am sorry, but NullPointerException does not say much, try to run maven with parameters -e or -X (or both) to see more logging information to find out what is going on. Also you may try a release version of the plugin, not beta just to be sure.
And if you also provide part of the pom.xml with your plugin configuration, someone could notice some mistake :).

Snapshot 1.8 dependecies error on tripleplay examples

i'm trying to run the tripleplay examples in my eclipse (https://github.com/threerings/tripleplay) but it always sows me te same error during installation:
Failed to execute goal on project tripleplay: Could not resolve dependencies for project com.threerings:tripleplay:jar:1.8-SNAPSHOT: The following artifacts could not be resolved: com.googlecode.playn:playn-core:jar:1.8-SNAPSHOT, com.googlecode.playn:playn-java:jar:1.8-SNAPSHOT: Failure to find com.googlecode.playn:playn-core:jar:1.8-SNAPSHOT in http://forplay.googlecode.com/svn/mavenrepo was cached in the local repository, resolution will not be reattempted until the update interval of forplay-legacy has elapsed or updates are forced
I`ve forced to update maven dependencies but it didn't work... Anybody knows how to solve this problem?
Thanks.
You have to checkout also the threerings fork of Playn:
https://github.com/threerings/playn
and launch a mvn clean install on that project.
I created a maven repository who contain this dependencies,
feel free to use it
<repositories>
<repository>
<id>bubuntux-repo</id> <!--Contains PlayN and Tripleplay snapshots-->
<url>http://repository-bubuntux.forge.cloudbees.com/snapshot/</url>
</repository>
</repositories>
Keep in mind to this artifact are spanshots from the Threerings repositories and my CI doesn't run any test unit, it just compile, so the library can be a little unestable.

Maven release:perform seems to break build-helper:add-source

I have a fairly simple Flex SWC module that is compiled via the Maven Flexmojos plugin. This module also uses the flexmojos:generate goal during the generate-sources phase to create Actionscript3 equivalents of my Java services & domain classes. The regular sources are housed in src/main/flex and the generated sources are in src/main/flex-generated. The generated sources are NOT checked into Subversion. Like many other flexmojos users I use the build-helper:add-source goal to add this second source tree to my compile. This has been working well for months now and the Maven output typically looks like this:
[INFO] ------------------------------------------------------------------------
[INFO] Building myproj Core Client -- Flex Service
[INFO] task-segment: [deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [flexmojos:generate {execution: create-actionscript-classes}]
[INFO] Flexmojos 3.7.1
[INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] flexmojos 3.7.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Calling the generator for each Java class.
[INFO] Generating: /home/bsmith/develop/myproj/myproj-core/tags/myproj-core-1.0.2/flex-service/src/main/flex-generated/com/myprojvision/core/domain/security/Group.as
.......
[INFO] [build-helper:add-source {execution: add-source}]
[INFO] Source directory: /home/bsmith/develop/myproj/myproj-core/tags/myproj-core-1.0.2/flex-service/src/main/flex-generated added.
[INFO] Flex compiler configurations:
.....
-compiler.source-path /home/bsmith/develop/myproj/myproj-core/tags/myproj-core-1.0.2/flex-service/src/main/flex /home/bsmith/develop/myproj/myproj-core/tags/myproj-core-1.0.2/flex-service/src/main/flex
Notice how nicely the flex compiler source-path represents both source directories. This setup will successfully package, install, and deploy the SWC artifact. However, now we wish to use the Maven release plugin in order to automate the release process. The release:prepare goal runs fine. However, the release:perform goal fails because the flex compiler is not handed the generated source directory for some unknown reason:
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building myproj Core Client -- Flex Service
[INFO] [INFO] task-segment: [deploy]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] [flexmojos:generate {execution: create-actionscript-classes}]
[INFO] [INFO] Flexmojos 3.7.1
[INFO] [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT file
[INFO] [INFO] Calling the generator for each Java class.
[INFO] [INFO] Generating: /home/bsmith/develop/myproj/myproj-core/trunk/target/checkout/flex-service/src/main/flex-generated/com/myprojvision/core/domain/security/Group.as
...
[INFO] [INFO] [build-helper:add-source {execution: add-source}]
[INFO] [INFO] Source directory: /home/bsmith/develop/myproj/myproj-core/trunk/target/checkout/flex-service/src/main/flex-generated added.
...
[INFO] [INFO] Flex compiler configurations:
[INFO] -compiler.source-path /home/bsmith/develop/myproj/myproj-core/trunk/target/checkout/flex-service/src/main/flex
Notice that the files are generated in the right place, the build helper is correctly called, but the flex compiler.source-path is missing the generated source directory and thus a Flex class-not-found error is produced. What is so amazing to me about this problem is the the release:prepare does a [clean, verify] in a forked Maven lifecycle and it works, yet release:perform doesn't...so it doesn't seem that its the fork that is the problem.
Here is the configuration of the build-helper plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/src/main/flex-generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Note that if I ditch the build-helper plug and use the flexmojo's sourcePaths configuration, then everything works fine.
<sourcePaths>
<path>${project.basedir}/src/main/flex</path>
<path>${project.basedir}/src/main/flex-generated</path>
</sourcePaths>
However sourcePaths is deprecated and the way forward for those with multiple flex source trees is build-helper.
Besides the flex-generated sources are not checked into SVN, may be you need to generate them under the target folder. I think this may confuse the release plugin. Try generating the sources under that folder and add it to the build with the build-helper plugin.
Having the same problem here as well. Doesn't seem to matter if the files are checked into version control or not, because I've tried it both with and without them checked in and the result was the same.
I'm going to try adding mine to the same source path to see if it fixes the problem, but it's certainly a compromise. The first time I tried doing that it seemed like GraniteDS didn't particularly care for it.
EDIT: I just took a look at the source code for the flexmojos plugin and sourcePaths is not deprecated. This was after a checkout from trunk
svn co http://svn.sonatype.org/flexmojos/trunk flexmojos
lo,
I had a problem similar to this in that I wanted to package an .xml file within my jar. To add it, I used the build-helper-maven-plugin and added it like you have above. Worked fine during build, but when it came to release:perform it would miss the .xml file out.
I found instead by using the <resources> section of the POM instead, I had a much better time. I also took the advice of this MaestroDev User Guide, treating the .xml file as a binary file and put some information in the POM to prevent it from being filtered.
MaestroDev User Guide (at the bottom called "Preventing Filtering of Binary Resources")
This seemed to work for me. Not sure if it's suitable for you because of how flex is built, but it doesn't look as if you've had an answer in a while and this might be it :)

Adobe Flex/AIR Maven integration

I am writing an Adobe AIR application that needs to build in a CI using maven and nexus. I tried to follow this article which is the most up to date article from the source, but I still don't understand these things:
Are the first and second pom.xml examples in the article in the same pom.xml file?
How do I get the Flex SDK dependencies on my CI?
It would be awesome if someone had a complete project setup and went through the whole thing.
This blog has some useful information on building Air applications with Maven 2.
As far as your numbered questions are concerned
Part 1: The two POMs in the tutorial are different. The first creates the swf package containing your application components. The second POM has a dependency on the swf package (note the dependency in the second POM for the artifactId Air in the first). The second POM defines processing to unpack the swf package (using the dependency plugin), then uses the exec plugin to invoke adt on the unpacked package contents.
The process described is therefore in two parts. The first POM packages the swf files so they are available in the repository. The second POM will retrieve any packages required from the Maven repository and invoke adt to compile them. So if you have multiple Air packages, the second POM can be modified to download the extra packages and compile them.
Part 2: Most of the dependencies you need are hosted in the Sonatype public repository, one notable exception seems to be the adt.jar. You can deploy the adt.jar to a Maven repository manager such as Nexus using the deploy plugin's deploy-file goal.
This would deploy the adt.jar to the repository with credentials matching the tutorial:
mvn deploy:deploy-file -Durl=http://path/to/repository -DrepositoryId=[some.id]
-Dfile=adt.jar -DgroupId=com.adobe.flex.compiler -DartifactId=adt
-Dversion=3.3.0.4852 -DgeneratePom=true -DgeneratePom.description="Flex ADT"
To reference the Nexus public repository, add a repository declaration to your settings.xml or pom.xml like this:
<repositories>
<repository>
<id>nexus-public</id>
<url>http://repository.sonatype.org/content/groups/public</url>
</repository>
</repositories>

Resources