http://issues.appfuse.org/browse/APF-937

As i don't have access to JIRA, pushing it in this mail.
Sorry for the inconvenience.

I sincerely hope this helps.

regards,
Rajeev

*Configuration:
*Using AF 2.0.1 on win xp

mvn archetype:create -DarchetypeGroupId=org.appfuse.archetypes \
    -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=
http://static.appfuse.org/releases \
    -DarchetypeVersion=2.0.1 -DgroupId=com.core.app -DartifactId=magic2

Project created successfully.
Then executed: mvn -X appfuse:full-source

And it failed with exception shown below.

*More details:
*Using win xp and ant 1.7.
As the mavn repo was in c:\Documents and Settings\rajeev\.m2\repository, ant
failed as it didn't expect a " " in file names.
Following Simon's suggestion:
http://www.nabble.com/appsuse-2.0.1-source-code-dowload-td15124097s2369.html
and shifting the repo to C:\dev\.m2\repository (name with no spaces), maven
embedder threw this error.

*Error msg:*
[INFO] [AppFuse] Adding dependencies from root module
java.lang.IllegalArgumentException:
When not aligning with a user install you must specify a local repository
location using the setLocalRepositoryDirectory( File ) method.
Detailed logs attached below.

The error is not with Appfuse but with maven embedder as it didn't recognize
correctly that mvn is not setup in default directory.

The fact that error seems to be coming from executing Appfuse maven plugin
led me to wrong trail ;)

*BUG FIX:* refer Dror Bereznitsky's comment in
http://www.jfrog.org/jira/browse/MDV-51
I tested fix with SVN 2.0.1 tag and below mentioned code change.
Sources are generated correctly.

I compiled with the code change and ti worked fine. The maven repo was in a
dir with name having no spaces.
What i couldn't test was whether the fix works if maven repo is in default
location (i.e. having a space in name.)
As Ant 1.7 fails in between.

Secondly, i am not sure if appfuse code initializes the local repo as per
Dror Bereznitsky's comment (http://www.jfrog.org/jira/browse/MDV-51)


*CODE CHANGE:
*
APPFUSE_201/plugins/appfuse-maven-plugin/plugins/appfuse-maven-plugin/src/main/java/org/appfuse/mojo/installer/InstallSourceMojo.java
Method name: createProjectFromPom() line 698.

Added
//CODE SNIPPET START -----------------------
            maven.setAlignWithUserInstallation(true);
//CODE SNIPPET END ------------------------------


final code is:

        try {
            maven.setAlignWithUserInstallation(true);  //this line of code
added.
            maven.start();
            p = maven.readProjectWithDependencies(pom);
    ........


*Failure logs: *

[DEBUG] Configuring mojo '
org.codehaus.mojo:appfuse-maven-plugin:2.0.1:full-sour
ce' -->
[DEBUG]   (f) destinationDirectory = c:\dev\workspace\appfuse\magic2/src
[DEBUG]   (f) project = MavenProject:
com.coreobjects.app:magic2:1.0-SNAPSHOT @
c:\dev\workspace\appfuse\magic2\pom.xml
[DEBUG]   (f) tag = trunk/
[DEBUG]   (f) trunk = https://appfuse.dev.java.net/svn/appfuse/
[DEBUG] -- end configuration --
[INFO] [appfuse:full-source]
[INFO] [AppFuse] Source successfully exported, modifying pom.xml...
[INFO] [AppFuse] Removing maven-warpath-plugin...
[INFO] [AppFuse] Adding dependencies from root module...
java.lang.IllegalArgumentException: When not aligning with a user install
you mu
st specify a local repository location using the
setLocalRepositoryDirectory( Fi
le ) method.
        at org.apache.maven.embedder.MavenEmbedder.createMavenSettings
(MavenEmbe
dder.java:699)
        at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java
:628)

        at org.appfuse.mojo.installer.InstallSourceMojo.createProjectFromPom
(Ins
tallSourceMojo.java:698)
        at
org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In
stallSourceMojo.java:654)
        at
org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In
stallSourceMojo.java:621)
        at org.appfuse.mojo.installer.InstallSourceMojo.execute
(InstallSourceMoj
o.java:215)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPlugi
nManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(Defa
ultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:493)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(Defau
ltLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        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:585)
        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)
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
java.lang.NullPointerException
        at
org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In
stallSourceMojo.java:656)
        at
org.appfuse.mojo.installer.InstallSourceMojo.addModuleDependencies(In
stallSourceMojo.java:621)
        at org.appfuse.mojo.installer.InstallSourceMojo.execute
(InstallSourceMoj
o.java:215)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPlugi
nManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(Defa
ultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:493)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(Defau
ltLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.

Reply via email to