ok, I think I found the problem that caused the NullPointerException.
I defined the flexmojos plugin repository in my settings.xml in a new
profile and added this
profile to the activeProfiles so it will be used during the build.
When I run the build this way it failed with a NullPointerException in
the copy-flex-resources goal.
Once I added the flexmojos plugin repository also to the pom of the
swf project the build completed successfully.
this is what I added to the pom.xml of the swf project:
<pluginRepositories>
<!-- Required for regular plugin use until moved over to Maven
central repo. -->
<pluginRepository>
<id>flex-mojos-plugin-repository</id>
<url>https://repository.sonatype.org/content/groups/
flexgroup/</url>
<releases> <enabled>true</enabled> </releases>
<snapshots> <enabled>false</enabled> </snapshots>
</pluginRepository>
</pluginRepositories>
I'm not sure what the code fix should be but I guessing that in
CopyMojo.java in the method getProject
while building the ProjectBuildingRequest you need to also add the
active profiles to the build request
(I don't have a way to test this...)
On Dec 15, 9:19 am, Dani <[email protected]> wrote:
> Could it be a problem in my configuration?
> when debugging the CopyMojo I noticed these error (which weren't
> printed to the log):
>
> [[ERROR] Unresolveable build extension: Plugin
> org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-SNAPSHOT or one of
> its dependencies
> could not be resolved: The following artifacts could not be
> resolved:
> Could not find artifact com.adobe.flex.compiler:mxmlc:jar:
> 4.5.0.17689 in mirrorOfCentral
> (IP OF REPOSITORY WHICH IS A MIRROR TO CENTRAL) @
> com.blabla:swf:0.0.1-SNAPSHOT
> [ERROR] Unknown packaging: swf @ com.blabla:swf:0.0.1-SNAPSHOT, C:\work
> \java\workspaces\flexmojos\simpleWebApp\swf\pom.xml, line 29, column
> 14]
>
> why is it trying to find com.adobe.flex.compiler:mxmlc:jar:4.5.0.17689
> in the central repository?
> it was downloaded from the flexmojos repository (and not central)
>
> On Dec 14, 2:14 pm, Dani <[email protected]> wrote:
>
>
>
>
>
>
>
> > unfortunately I don't know what the fix should be, just know that in
> > the CopyMojo
> > in the method getDestinationFile() this line returns null:
> > MavenProject pomProject = getProject( artifact );
>
> > and that's what causes the NullPointerException to be thrown.
>
> > On Dec 14, 1:09 pm, Marvin Froeder <[email protected]> wrote:
>
> > > Ok, lemme know when the patch is there as well, or you can use github pull
> > > request, either way is fine.
>
> > > On Tue, Dec 14, 2010 at 9:08 AM, Dani <[email protected]> wrote:
> > > >https://issues.sonatype.org/browse/FLEXMOJOS-376
>
> > > > thanks.
>
> > > > On Dec 14, 12:43 pm, Marvin Froeder <[email protected]> wrote:
> > > > > Yep
>
> > > > > On Tue, Dec 14, 2010 at 8:17 AM, Dani <[email protected]> wrote:
> > > > > > if in the copy-flex-resources goal I set useFinalName then the
> > > > > > build
> > > > > > completes successfully.
>
> > > > > > should I open a JIRA for this?
>
> > > > > > <packaging>war</packaging>
> > > > > > <build>
> > > > > > <plugins>
> > > > > > <plugin>
> > > > > > <groupId>org.sonatype.flexmojos</groupId>
> > > > > > <artifactId>flexmojos-maven-plugin</artifactId>
> > > > > > <version>4.0-SNAPSHOT</version>
> > > > > > <executions>
> > > > > > <execution>
> > > > > > <goals>
> > > > > > <goal>copy-flex-resources</goal>
> > > > > > </goals>
> > > > > > <configuration>
> > > > > > <useFinalName>false</useFinalName>
> > > > > > </configuration>
> > > > > > </execution>
> > > > > > </executions>
> > > > > > </plugin>
> > > > > > <plugin>
> > > > > > <groupId>org.mortbay.jetty</groupId>
> > > > > > <artifactId>maven-jetty-plugin</artifactId>
> > > > > > <version>6.1.17</version>
> > > > > > </plugin>
> > > > > > </plugins>
> > > > > > </build>
>
> > > > > > On Dec 7, 11:59 am, Dani <[email protected]> wrote:
> > > > > > > Hey,
>
> > > > > > > I've created modular application using the flexmojos-archetypes-
> > > > > > > modular-webapp archetype
> > > > > > > when I run: mvn clean install
>
> > > > > > > I get the following error:
>
> > > > > > > [ERROR] Failed to execute goal
> > > > org.sonatype.flexmojos:flexmojos-maven-
> > > > > > > plugin:4.0-SNAPSHOT:copy-flex-resources (default) on project war:
> > > > > > > Execution default of goal org.sonatype.flexmojos:flexmojos-maven-
> > > > > > > plugin:4.0-SNAPSHOT:copy-flex-resources failed.
> > > > > > > NullPointerException
> > > > -
>
> > > > > > > > [Help 1]
>
> > > > > > > Caused by: java.lang.NullPointerException
> > > > > > > at
>
> > > > org.sonatype.flexmojos.plugin.war.CopyMojo.getDestinationFile(CopyMojo.java
> > > > > > :
> > > > > > > 211)
> > > > > > > at
>
> > > > org.sonatype.flexmojos.plugin.war.CopyMojo.execute_aroundBody0(CopyMojo.jav
> > > > > > a:
> > > > > > > 144)
> > > > > > > at
>
> > > > org.sonatype.flexmojos.plugin.war.CopyMojo.execute_aroundBody1$advice(CopyM
> > > > > > ojo.java:
> > > > > > > 24)
> > > > > > > at
>
> > > > org.sonatype.flexmojos.plugin.war.CopyMojo.execute_aroundBody2(CopyMojo.jav
> > > > > > a:
> > > > > > > 124)
> > > > > > > at
>
> > > > org.sonatype.flexmojos.plugin.war.CopyMojo.execute_aroundBody3$advice(CopyM
> > > > > > ojo.java:
> > > > > > > 17)
> > > > > > > at
> > > > > > org.sonatype.flexmojos.plugin.war.CopyMojo.execute(CopyMojo.java:
> > > > > > > 1)
> > > > > > > at
>
> > > > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildP
> > > > > > luginManager.java:
> > > > > > > 107)
> > > > > > > ... 20 more
>
> > > > > > > any idea what's the problem?
> > > > > > > it also happens in the alpha and beta versions of flexmojos-maven-
> > > > > > > plugin
>
> > > > > > --
> > > > > > 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]<flex-mojos%2bunsubscr...@googlegrou
> > > > > > ps.com>
> > > > <flex-mojos%2bunsubscr...@googlegrou ps.com>
> > > > > > 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]<flex-mojos%2bunsubscr...@googlegrou
> > > > ps.com>
> > > > 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/