jhipster : angularjs files and browser cache - caching

I am developping a Jhipster web app.
My problem is that when I update some angularjs files and then deploy the new war file in Tomcat7 the modifications are not taken into account, the clients pc is still reading the old angularjs file.
Is there a way(or a jhipster configuration) to tell the client pc to reload all angularjs file in order to be up to date?
Thanks you.

When you build your app with prod profile using mvn -Pprod package or gradlew -Pprod bootRepackage the web assets are minified and prefixed with a unique code in dist folder. An older version of same file has a different prefix so if it is cached it will not prevent the new one from being loaded.
If you don't see this behavior, it's probably because you didn't set the spring.profiles.active property to prod in Tomcat and so your app is running in dev mode and not using the files from dist.

If your frontend and backend are in the same war: 0.0.1-SNAPSHOT change this version in pom.xml before making a build to avoid angular caching issues.
If your frontend is split then go to: gulp/utils.js and change this version: '0.0.5-SNAPSHOT';

Related

heroku: Deploying angular app inside spring boot app

I've one repo sunixi and it has two projects sun-angular(angular) and sun-admin(spring boot) in ts-admin i'm building ts-angular via executions and moving dist into resources/static of sun-admin project after that i'm building the sun-admin. On local enviroment it is working fine but how can i do same in heroku deployment.
structure of repo
sunixi
---sun-angular
---sun-admin
in sun-admin i'm setting workingDirectory as ../sun-angular but while deploying to heroku i'm getting
Cannot run program "npm" (in directory "/tmp/build_02607c07/sun-angular"): error=2, No such file or directory
If you are using a monorepository strategy, an option is to use subdir buildpack to select where is the path of your folder: https://github.com/timanovsky/subdir-heroku-buildpack
If you want to deploy backend and frontend in the same heroku app, the project folder should contains a npm package. Otherwise, i will not work.

How to deploy an angularcli-meteor project on Galaxy?

Using angularcli-meteor, how to deploy an angularcli-meteor application on Galaxy since the meteor project itself is inside the "api" folder?
I have the same question in mind for a ionic 3 application, your API folder is a meteor project so you can deploy it on galaxy. And then host your Angular app else where if you make sure that your DDP_DEFAULT_CONNECTION_URL points to this galaxy server.
You can set it DDP_DEFAULT_CONNECTION_URL in bundler.config.json don't forget to re-generate your meteor-cliend-bundle.js file (npm run meteor-client:bundle) before deployment.

404 when deploying Grails 3.1.10 war to tomcat7 or tomcat8

The closest stackoverflow question that explains my symptoms is here - How can I deploy a Grails 3.0.1 war file in Tomcat7?
I am in the process of upgrading a Grails 2.3.4 application to Grails 3.1.10 and everything is working with 'grails run-app'.
When i deploy to a war i get nothing but 404's for any url.
The war deploys without any error messages in catalina.out.
The tomcat access logs show my access attempts. (not linux problem?)
I can get to the tomcat manager, and the tomcat manager shows my app as "running" as true. (no errors)
Manager shows myapp-0.1 because the war file was myapp-0.1.war .. this is fine for now.
I am running Grails 3.1.10.
I have tried against Tomcat 7.0.55 as well as 8.0.92.
I have tried changing grails.serverUrl in application.groovy to various values. It is now:
//fix war name after get working
grails.serverUrl = "/myapp-0.1"
System.setProperty("server.contextPath","/myapp-0.1")
I have tried the above without "-0.1". (i was suprised to learn this was necessary - https://stackoverflow.com/a/23664531/104993)
I have tried changing "org.springframework.boo:spring-boot-starter-tomcat" from "compile" to "provided" in the build.gradle file.
Please let me know what I need to elaborate on. It's difficult to paste log outputs and config files. (i'm behind a firewall)
You add the following task to your build.gradle it will name the war what ever you want:
task wrapper(type:Wrapper){
war.archiveName='myWar.war'
}
Then when you deploy it should have the correct name and you can go to https://localhost:8080/myWar

jboss-as-maven-plugin: which directory does command "jboss-as:deploy" deploy an .ear to?

I am running jboss 7.1, maven 3, and a java ee6 application that generates an .ear
I am doing a mvn clean package jboss:as-deployand Jboss-as-maven-plugin 1.5 does its thing--I can view my app using http://localhost:8080...
just fine, but I want to know where the actual .ear is being put.
It is not in my jboss7.../standalone/deployments folder. So where is it? My app is obviously running in jboss 7.1 just fine, but I can't find the .ear file. I know that there is an .ear in Eclipse's 'target' directory, but that wasn't produced by jboss-as-maven-plugin is it? I hope you can understand my confusion--don't all .ear files need to be in the deployments directory? I also do see my .ear file inside my hidden .m2/repository directory, but does this have any interaction with jboss-as-maven-plugin? Maybe there is some hidden sym-linking between my Eclipse project's 'target' directory and the jboss7.1 standalone/deployment directory?
p.s. I am used to using a hard-deploy option with the other plugin jboss-maven that requires you to say jboss:hard-deploy which just copies the .ear to your deployments folder. Then jboss would pick up the new .ear and redeploy automatically. I get the sense that jboss-as-maven-plugin is the preferred plugin so that's why I am bothering.
The jboss-as-maven-plugin uses the deployment API so it doesn't copy the file to the deployments directory for the scanner to pick it up. It deploys just as if you deployed it from the web console or via CLI. The files should be located somewhere in the $JBOSS_HOME/standalone/data/ directory.
You're welcome to open an issue, for a discussion around it at least. I'm not sure how I feel about adding a goal for it, but here isn't the place to discuss that :)

deploy maven application in JBoss not work

I'm developing my first maven application and now i have this trouble, i performed the following commands
mvn compile
mvn package
mvn jboss-as-deploy
the deploy process ends without errors but in my JBOSS_HOME\standalone\deployments i don't find the .war
why?
Try to set targetDir option (maybe the default is overriden in your environoment?). See http://docs.jboss.org/jbossas/7/plugins/maven/latest/deploy-mojo.html.
The $JBOSS_HOME/standalone/deployments directory is not where deployments are stored. If you look in that directory there is a README file that explains it's what the directory is used for.
The jboss-as-maven-plugin uses the deployment API's to deploy the content to the server. This generally ends up in $JBOSS_HOME/standalone/data/content for a standalone server. Though you really shouldn't be doing anything with files in that directory.

Resources