aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Assembling the Project during the 'mvn install' phase Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Assembling the Project during the Watch "Maven Assembling the Project during the New topic
Author

Maven Assembling the Project during the 'mvn install' phase

Andrew Jerpe
Greenhorn

Joined: Jun 03, 2013
Posts: 9
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

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Andrew Jerpe
Greenhorn

Joined: Jun 03, 2013
Posts: 9
That makes sense. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven Assembling the Project during the 'mvn install' phase