I'm looking for a package which would help me in exporting my project as a war file. However I don't see any relevant package in npmjs.com or anywhere else.
What I've tried so far:
Explored npmjs.com for this package, and found none.
Explored github and found none there as well.
One SO solution suggested to make use of the jar command which
unfortunately doesn't exist in my environment, I can't download and
use it too due to restrictions.
Did anyone come across such module (or) any other solutions with respect to this? Can some one help?
If I'm not wrong, a WAR file is specific to a Java environment. If you are using nodeJS and Javascript, you are not using Java and the WAR format is not appropriate for your code...
What do you want to achieve with a war file more than something else?
In computing, a WAR file (short for Web ARchive) could be a JAR file
used to distribute a collection of JavaServer Pages, servlets, Java
classes, XML files, tag libraries and static Web pages (HTML and
related files) that together constitute a Web application.
Wikipedia
EDIT: The only solution I see would be to create a Java Application that would eventually require and execute your nodeJS code... But this seems Hacky as hell. You can read this response about how to execute NodeJS code into a Java environment: Calling a node.js script from inside java
Related
I have a laravel application, and a war file. Both run like expected, but separately.
Laravel in vagrant/homestead and the war file with tomcat.
My objective is to run the war file within the laravel application. I haven't found anyone doing something like this.
I tried extracting the content of the war file but I get some errors, from missing files that I can't find anywhere.
Has anyone a clue on how to do this / an example I can follow?
Thank you!
Edit: The answer below follows the tag's descriptions for war files as
Web Application Archive - Is Jar file used to distribute JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.
But, according to the comments, it seems that PHP can be packaged in WAR files as well. With that aspect, my answer won't be helpful (sorry), but I'll leave it here in case someone actually later on finds this question for a mixed Java/PHP environment:
According to the tag descriptions:
laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony.
and
tomcat is an open source Servlet Container
E.g. tomcat is more an application server, while Laravel is a library. Good luck running something (written in Java) within a PHP environment. (e.g. it won't work)
What you can do is to run tomcat, and serve its files from the same webserver that you serve your Laravel application from (e.g. Apache httpd, nginx). You'll have to lookup "reverse proxy" for it, e.g. "mount" a certain part of the URL hierarchy from Tomcat to your Webserver.
But to run any Java code and JSPs within a PHP environment? No.
So I'm trying to extract my own CSS framework from my projects so I can develop it separately.
I have my index.html with less.js and included my main .less file which #imports a dozen other files...
However, in the console I get an error for each of my less files:
Resource interpreted as Stylesheet but transferred with MIME type text/plain: "file:///path/to/project/src/file.less".
And a final line that says Less has finished and no sheets were loaded.
So I understand this to mean they aren't being served correctly, I normally use Node.js/Express, but I don't want to include all of that in my repo just to develop some CSS. How do I get around this?
I thought about using some node package like serve for development but I feel like this shouldn't be necessary.. Unless I'm wrong?
EDIT: here's my repo, https://github.com/kenmorechalfant/framewerk
Don't use file://. You're going to run into a mountain of XSS errors. Just use a quick static HTTP server. I use http-server with node and most IDEs have one built in. It is going to be more trouble that it's worth to try and not use a static HTTP server if you don't have a good reason not to.
I have a java webapp project under eclipse that is using maven for dependency management.
This webapp also depends on many javascript libraries for the front-end, either provided by external "vendors" such as jquery or bootstrap, or developped "internally" by myself.
What I want to do is manage the javascript dependencies just as I would with java dependecies, inside my POM.xml.
Now, for external dependencies I would like them to be automatically downloaded from a repository ( either hosted by me or external) - this is what Webjars could provide I believe.
For my "internal" javascript libraries I would like to create them as separate eclipse projects, in my eclipse workspace, that would be referenced inside my webapp's POM the same way I would do with a secondary java project residing in my eclipse workspace.
I also want the referenced js dependencies to be properly placed under my /src/main/webapp/js/ folder when the webapp is deployed.
Finally, when modifying something in one of my "internal" javascript libraries, I would like the changes to be automatically deployed to the webapp, as if it was a regular java sub-project referenced in the main webapp project. I specially want the changes to be redeployed to the webapp if it is running / being debugged, under eclipse.
I have heard of Javascript maven tools : http://javascript-maven.softec.lu/
or http://mojo.codehaus.org/javascript-maven-tools/javascript-maven-plugin/
but thes plugins dont seem to be maintained anymore, are lightly documented, and I failed achieving the above requirements with them (probably because of the lack of concrete examples).
Now I know I'm asking for alot but I dont mind trying different approaches, and fooling around with different tools.
Any help, thoughts, insights etc ... appreciated
Thanks
I use Visual Studio 2013 and .NET 4.5 for an MVC project.
I've learning to use AngularJS via several videos on Pluralsight and one of them walks through the process of using Grunt to clean the output directory, then use ngmin to min-safe the Javascript files.
My process is using a gruntfile.js to clean and run ngmin against the javascript files in my solution, then put them in a directory called app_built. This is executed via a batch file in the pre-build for the project and then I include it via a ScriptBundle with IncludeDirectory pointing to the app_built directory. My intent is to use the Bundling features of .NET 4.5 to do the rest of the minification and concatenation of the Javascript after all the files have been min-safed via Grunt.
I specify the path to the min-safed files with the following:
bundles.Add(new ScriptBundle("~/bundles/minSafed")
.IncludeDirectory("~/app_built/", "*.js", true));
If I run this on my local machine, it runs fine without a hitch. The Javascript is minified and bundled as I'd expect and the resulting web application runs fine as well.
If I publish the website to a remote server, I get a server error that the "Directory does not exist. Parameter name: directoryVirtualPath". I assume this error is saying that it's unable to find the directory populated with my many *.js files. I also assume this is because they weren't published since they aren't part of the solution, even though the folder they reside in is a part of the solution (it's just empty within the solution explorer in Visual Studio).
If my assumption is correct, what can I do to add these files to my solution so they'll be published with the rest of my web application with minimal effort on my end each time?
And if I'm incorrect in the assumption, what I can I do to resolve this otherwise?
Thanks!
I never did find a great way of going about this. I found information at http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx that seems related, but I was unable to make it work.
Rather, since I knew the name of the outputted file, I simply created such an empty file in my project and referenced that where I needed to. I then had the pre-build task replace the contents of that file with the externally minified version and it would be packaged with the project as necessary, so it works well enough.
I'd like to start bundling our javascript files. I've found that it's really easy locally using the web essentials plugin, however I need to set up the build server to generate the bundled .js file.
I'd rather not check this generated file into TFS as it will cause conflicts for our developers, and also since it's generated from the source I feel that the server build should generate it.
Is there a command line utility for doing the script bundling outside of visual studio that could be used as part of a build script? My google-fu is failing to find one.
Many thanks,
As long as you wrote it as proper AMD modules, require.js comes with a tool to turn all your files into an optimized bundle.