Solved

maven install takes long time

Posted on 2014-09-17
6
208 Views
Last Modified: 2014-10-17
hi experts

i have a web project (front end is javascript and back end is java).

currently i am doing maven -clean first
then maven -install

When i do maven clean , it wipes out the taret folder
maven install creates the target folder again

The problem is target folder contains too may javascript specific files and to create it the entire maven
install process takes close to 30 minutes.

I want to avoid this. I dont want to touch javascript files in target and only compile the
java files.

 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.compUI.searMan</groupId>
	<artifactId>searMan</artifactId>
	<version>1</version>
	<packaging>war</packaging>
	<name>searManAdmin</name>

....
...
</project>

Open in new window


Any sugessions will be appreciated.
Thanks
Jay
0
Comment
Question by:royjayd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 40329387
maven install process takes close to 30 minutes.
Wow, that IS a long time. Are you sure that it is the Javascript files though? How many Javascript files (and other "resource" files, CSS, fonts, images that get packaged into the WAR) and what is the total size of these files? How big is the resultant WAR file that is produced?

Unfortunately, I don't think there is anyway to get Maven to print timestamps along with the console logging that it produces (so that you could post it here for us to look at), but if you just watch the console output produced, is there a particular point that is sits at for the majority of that 30 mins?
0
 

Author Comment

by:royjayd
ID: 40330557
yes javascript files, war file size is close to 50 mb.
can i use exclude option something specified in this site:
http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html

thanks.
0
 

Author Comment

by:royjayd
ID: 40338205
hi mccarl,
I was able to reduce the time from 30 mins to 10 mins , all  do now is maven install, and i skip the maven clean.
That way the entire target folder is not wiped out.
Thanks.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 36

Expert Comment

by:mccarl
ID: 40338269
It still sounds like a long time though, even for 50mb. You didn't mention how many files there are? Javascript files that is, that are being copied into the final WAR file?
0
 

Author Comment

by:royjayd
ID: 40338907
yeah, the ext-js library is huge though, close to 5000 javascript files.
0
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 40340554
the ext-js library is huge though, close to 5000 javascript files.
Are you sure that you are using it correctly. That sounds like you may have unzipped the entire SDK into your webapp. Theoretically, you should just have a couple of Ext JS files and a handful of the resource files (images, css, etc). I haven't used Ext JS before but by looking at the docs & other forums, etc it looks as though there are two ways to go about this...

1 - (the proper way) is to use the tools that come with Ext JS to "build" a version of the library that uses only the components, themes, etc that you require. All this gets compiled and minified into one JS file and there associated resources.

2 - If you don't want to go through the above procedures, and you are not worried about having a larger JS file for the client to download, I believe that you can just take the one big "ext-all.js" file that contains all the components built in and put that in your webapp (again with the necessary other resources)


But if I'm right it sounds like you may have included the whole SDK in your webapp, which would include all the documentation and build tools and examples etc, all the stuff required for "development" but not what should be deployed for "runtime"
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question