|
|
|
[
Permlink
| « Hide
]
Patrick Turcotte - 17/Nov/07 08:21 AM
Making sure the folder %USER_HOME%/.m2/repository exists seems to fix this problem.
From an e-mail I received:
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. eh...
Looks like this problem will occur to people who moved their local repository from %USER_HOME%\.m2\repository to another place, because %USER_HOME% contains whitespaces. I dont understant why, but to avoid this error you must keep local repository in two places 1)default folder (%USER_HOME%\.m2\repository) 2)folder path to which doesnt contain whitespaces in settings.xml you have to link local repository to 2 place. Matt, why dont you make avaible full sourse download from site? As you see -there are a lot of troubles with maven etc :( If you modify your settings.xml file (in $M2_HOME), and change localRepository to a DOS path (no spaces), it should solve this issue.
<localRepository>c:\docume~1\yourusername\.m2</localRepository> |
|||||||||||||||||||||||||||||||||||||||||||||||