create new project

6 views
Skip to first unread message

David Bernard

unread,
Mar 20, 2008, 10:43:16 AM3/20/08
to lif...@googlegroups.com
Hi,

WDYT about using following command to create a new project (vs the current way) ?
mvn -U archetype:generate -DarchetypeCatalog=http://scala-tools.org/

/davidB

Viktor Klang

unread,
Mar 20, 2008, 10:46:40 AM3/20/08
to lif...@googlegroups.com

Hi Dave,

It's definately better than the current way, but it's still a long way from Click-on-create-new-lift-project-button.
Would be awesome to do a WebStart-app that is bundled with Maven and that acts as a shell around the Maven stuff.

Cheers,
-V
 






--
_____________________________________
/ \
No Whine, just Cheese
\_____________________________________/

TylerWeir

unread,
Mar 20, 2008, 11:18:57 AM3/20/08
to liftweb
I would say that any effort to shorten the current method would be
appreciated.

On Mar 20, 10:46 am, "Viktor Klang" <viktor.kl...@gmail.com> wrote:
> On Thu, Mar 20, 2008 at 3:43 PM, David Bernard <david.bernard...@gmail.com>

David Pollak

unread,
Mar 20, 2008, 11:52:34 AM3/20/08
to lif...@googlegroups.com
I love it.  It solves most of the problems (except for downloading Maven) I had with the long Maven command line.

I'd like to see a little more description about what each of the prompts mean.  Also, I got a failure:
[INFO] Parameter: groupId, Value: foo
[INFO] Parameter: packageName, Value: foo
[INFO] Parameter: package, Value: foo
[INFO] Parameter: artifactId, Value: foo
[INFO] Parameter: basedir, Value: /home/dpp/tmp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[ERROR] Failed to generate project from the old archetype
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Failed to generate project from the old archetype
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:272)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:145)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:290)
        at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:75)
        at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:170)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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)
Caused by: org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: foo already exists - please run from a clean directory
        at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:248)
        at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:255)
        ... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51 seconds
[INFO] Finished at: Thu Mar 20 08:50:41 PDT 2008
[INFO] Final Memory: 12M/150M
[INFO] ----------------------------------------------------------

/davidB


  

David Bernard

unread,
Mar 20, 2008, 12:23:04 PM3/20/08
to lif...@googlegroups.com
David Pollak wrote:
>
>
> David Bernard wrote:
>> Hi,
>>
>> WDYT about using following command to create a new project (vs the current way) ?
>> mvn -U archetype:generate -DarchetypeCatalog=http://scala-tools.org/
>>
> I *love* it. It solves most of the problems (except for downloading
> Maven) I had with the long Maven command line.

drawback, we need to tell user what is should reply to questions.

> I'd like to see a little more description about what each of the prompts
> mean.

I could open a jira issue to the team, but I expect they won't fix.

There is already a foo directory under /home/dpp/tmp. not very clear message (and bad place): "foo already exists - please run from a clean directory"
the plugin is in alpha version.

/davidB

>> /davidB
>>
>>
>>
>
> >

David Pollak

unread,
Mar 20, 2008, 12:45:07 PM3/20/08
to lif...@googlegroups.com


David Bernard wrote:
David Pollak wrote:
  
David Bernard wrote:
    
Hi,

WDYT about using following command to create a new project (vs the current way) ?
   mvn -U archetype:generate -DarchetypeCatalog=http://scala-tools.org/
  
      
I *love* it.  It solves most of the problems (except for downloading 
Maven) I had with the long Maven command line.
    
drawback, we need to tell user what is should reply to questions.
  
Yeah.  Is there a way to display a message to the user before the Question/Answer cycle begins?

  
I'd like to see a little more description about what each of the prompts 
mean.
    
I could open a jira issue to the team, but I expect they won't fix.

  
Sorry... thought you controlled these.
D'oh!

/davidB

  
/davidB


  
      


  

Tim Perrett

unread,
Mar 20, 2008, 1:01:04 PM3/20/08
to liftweb
Hey guys,

This might seem like somewhat of a luddite solution - but as I can
never remember the archetype command I just made a quick bash script
to generate new lift projects:

#!/usr/bin/env bash

if [ -n $M2 ]; then
echo "Creating lift project with name ${1}"
echo "In class package ${2}"
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-
alpha-7:create \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=0.6 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=$2 \
-DartifactId=$1
else
echo "Could not find Maven; please check you have the correct M2 and
M2_HOME vars set"
fi

Is that a stupid thing to do?! Just seems like a dang sight easier to
supply a project name and a package rather than having to remember the
whole thing!

Tim
Reply all
Reply to author
Forward
0 new messages