• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Maven Assembling the Project during the 'mvn install' phase

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I am currently learning the specifics of how Maven creates a project that is a simple Web App. In the 'install' plug-in, which executes when I enter "mvn install" from the command line, I see that the WAR file for my web app has indeed been placed in my local repository. However, the assembly operation seems to be also copying the directory structure of my project, ( from <basedir> on down....) into the "target" folder . I am wondering if this is normal. According to the output, the assembling operation is using the 'target' folder to assemble all of the contents before it can be archived, and I understand that....

the command-line output looks like this:
--------------------------------------------------------

C:\MavenApps>cd simple-webapp

C:\MavenApps\simple-webapp>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building simple-webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ simple-webapp ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\MavenApps\simple-webapp\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ simple-webapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ simple-webapp ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\MavenApps\simple-webapp\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ simple-webapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ simple-webapp ---
[INFO] No tests to run.
[INFO] Surefire report directory: C:\MavenApps\simple-webapp\target\surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ simple-webapp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [simple-webapp] in [C:\MavenApps\simple-webapp\target\simple-webapp]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\MavenApps\simple-webapp\src\main\webapp]
[INFO] Webapp assembled in [140 msecs]
[INFO] Building war: C:\MavenApps\simple-webapp\target\simple-webapp.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ simple-webapp ---
[INFO] Installing C:\MavenApps\simple-webapp\target\simple-webapp.war to C:\Users\Andrew\.m2\repository\org\sonatype\mavenbook\simpleweb\simple-webapp
\1.0-SNAPSHOT\simple-webapp-1.0-SNAPSHOT.war
[INFO] Installing C:\MavenApps\simple-webapp\pom.xml to C:\Users\Andrew\.m2\repository\org\sonatype\mavenbook\simpleweb\simple-webapp\1.0-SNAPSHOT\sim
ple-webapp-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.538s
[INFO] Finished at: Tue Jun 18 19:27:36 EDT 2013
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
C:\MavenApps\simple-webapp>


... but I am left wondering.... should it leave the directory structure and contents lying around in the "target" folder like that ?? 'Just curious.

thanks,
--- andyj

 
author & internet detective
Posts: 40791
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andy,
Yes. As you noticed "install" has a few pre-reqs. A few of which are to create artifacts. Target is the destination for those artifacts. They stay there in case you want to look at the junit report, jars, etc.
 
Andrew Jerpe
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes sense. Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic