2 Replies Latest reply: May 26, 2009 11:01 AM by 807588 RSS

    Not really java question but a java build via maven question

    807588
      So I am trying to automate project creation for myself and the rest of the project team. The following bat file is my attempt to do that. It's the last line that is bombing. If you have maven 2 installed, you can test this program out by creating a directory, copying the bat file in there and running it as such
      C:\mydir>mybat com.foo.bar baz
      any suggestions, comments, thoughts appreciated.
      REM automated build script for maven projects
      @REM created, 21-May-2009
      @REM Usage:  copy this file to the appropriate directory
      @REM         at a command prompt, type >filename com.foo.bar baz
      @REM enable command extensions?
      @REM SETLOCAL ENABLEEXTENSIONS
      @REM CHANGE THE FOLLOWING TO LINES AS NECESSARY
      set MVN_HOME=C:\apache-maven-2.1.0
      set JAVA_HOME=C:\Program Files\Java\jdkset path=%MVN_HOME%\bin;%JAVA_HOME%\bin
      @REM package is com.foo.bar
      @REM sys_name is baz
      set PACKAGE=%1
      set SYS_NAME=%2
      call mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:create -DgroupId=%PACKAGE% -DartifactId=%SYS_NAME% -DarchetypeArtifactId=maven-archetype-j2ee-simple
      pause
      @REM call mvn install
      pause
      cd %SYS_NAME%
      call mvn eclipse:eclipse
      and here is the stacktrace...
      [INFO] Scanning for projects... 
      [INFO] ------------------------------------------------------------------------ 
      [ERROR] FATAL ERROR 
      [INFO] ------------------------------------------------------------------------ 
      [INFO] Error building POM (may not be this project's POM).   Project ID: unknown  Reason: Could not find the model file 'C:\junk\test\baz\site'. for project un known   
      [INFO] ------------------------------------------------------------------------ 
      [INFO] Trace org.apache.maven.reactor.MavenExecutionException: Could not find the model file 'C:\junk\test\baz\site'. for project unknown         
      at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)         
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)         
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)         
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)         
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:79)         
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)         
      at java.lang.reflect.Method.invoke(Method.java:618)         
      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.project.ProjectBuildingException: Could not find the  model file 'C:\junk\test\baz\site'. for project unknown         
      at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default MavenProjectBuilder.java:1585)         
      at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFi leInternal(DefaultMavenProjectBuilder.java:506)         
      at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMave nProjectBuilder.java:200)         
      at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)         
      at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)         
      at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:588)         
      at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)         
      ... 11 more Caused by: java.io.FileNotFoundException: C:\junk\test\baz\site (The system c annot find the file specified.)         
      at java.io.FileInputStream.<init>(FileInputStream.java:135)         
      at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:1 24)         
      at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFact ory.java:113)         
      at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(Default MavenProjectBuilder.java:1580)         
      ... 17 more
      [INFO] ------------------------------------------------------------------------ 
      [INFO] Total time: 1 second 
      [INFO] Finished at: Fri May 22 10:21:15 EDT 2009 
      [INFO] Final Memory: 2M/5M 
      [INFO] ------------------------------------------------------------------------