Solved

maven install takes long time

Posted on 2014-09-17
6
166 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
  • 3
  • 3
6 Comments
 
LVL 35

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 35

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 35

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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 …

759 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now