IntelliJ running websphere not showing latest changes - intellij-idea

I'm running IntelliJ 2019.1 w/ websphere. Ok, I make changes to some local files (.jsp, .xml, etc). I build the artifacts, build the project, deploy said changes and start up websphere. Running my app, I'm not seeing my changes. I've tried deleting the target folder, clearing the browser cache, locating/deleting "old" copies of my EAR, committing my changes to my local repo, tried doing "mvn clean install" in the terminal window. Nothing is working. How can I get my changes to show up when running my app.

I found that the exploded ear wasn't getting updated properly. Even though I had specified the exploded ear under "Run > Edit configurations > Before Launch', I still needed to specify the exploded ear under the Deployment tab. Only until I did that, did the exploded ear get updated with the latest changes. This is a confusing of why the artifacts need to be defined in two different places under the Edit Configuration area.

Related

Intellij shows every line in build.gradle.kts is red

I created a new project from VCS (Kotlin and Gradle). I added three testImplementation() calls to the build.gradle.kts. IntelliJ didn't pickup the changes so I did File -> Invalidate caches / Restart and now Intellij shows every implementation() call and every testImplementation() call in red. In fact every line in every build.gradle.kts in every module is red.
Intellij has lost its mind. What do I have to do to restore IntelliJ's intelligence when it comes to kotlintest in Gradle?
I started seeing this with AS 4.2.1. Invalidating caches and re-importing the project didn't work for me. I found this article on the JetBrains issue tracker where people found that they had an extraneous JDK set in the project settings. While I did not have an extraneous JDK set in my project structure, I tried changing the JDK from the AS embedded version to an alternate AdoptOpenJDK 1.8 version I had installed. After switching to that version all the red went away and everything is resolving as expected. I was then able to switch the SDK back to the embedded version and everything continued working as expected. When switching back to the embedded version I did notice a brief message in the progress bar at the bottom of AS saying that it was processing a JDK 11. I'm not sure where that's coming from, but it does seem to be in line with what others in the JetBrains issue were talking about.
The way I was finally able to solve this was with File -> Invalidate caches / Restart. It must have been cache corruption.
What do I have to do to restore IntelliJ's intelligence when it comes to kotlintest in Gradle?
Re-import the project: File | New | Project from Existing Sources action and select build Gradle file to load the project from.
Change your jdk.
Go to File>Project Structure > SDK Location > GradleSettings
Change the Gradle JDK to use the embedded or a compatible JDK (Azul JDK) if you're using a MAC.
Then Invalidate and refresh cache after deleting the .idea and .gradle files.

In Intellij ,Class files from 2 Different projects (created in different directories) interfere with each other

My Source code: 2 different branches from same repository. Both have 80% same code. Packages also same. But 20% classes are different in both branches. Its because of different features being developed in these branches.
My Intellij version is 2018.2.7 Community Edition
I cloned the repository in 2 different folders.
consider first one: C:\SourceCode\myRepo and move to branch1 from master
consider second one: C:\SourceCode\SecondCopy\myRepo and move to branch2 from master
Now I create 2 different projects in IntelliJ. One from C:\SourceCode\myRepo, Second from C:\SourceCode\SecondCopy\myRepo.
I build first project using git bash for windows using simple 'mvn clean install' command. (outside Intellij). Open Intellij. Run the application on Jetty. It goes good.
I have the second IntelliJ Project open as well in new Window. Now I build this second project in git bash using 'mvn clean install'(again outside Intellij). But as soon as I do that, the first project starts showing exceptions in code for the java classes which are not present in second project.
Even the application which was Already running using 'Run configuration of Intellij' in Jetty in First project, starts throwing class not found errors.
How can I resolve it and work on 2 projects having slightly different code but 80% same code, same packages etc. parallelly? What am I missing here? My intention is not to run Jetty parallelly. But to be able to compile these 2 projects independently and be able to Run Jetty in any one project anytime without interfering with other project.
These projects are big projects and hence, I want to initiate build and run for one project. Till the time its up and running, I want to be able to work on the other one parallelly in a way that, this work after compiling/auto building in this project doesn't impact the other one where I just started the application.
It is killing my productivity. Please help!
Use different Maven coordinates for the projects.
Someone told me that... Its happening because I am using maven and after building, maven keeps the project libraries that it builds in local repository. So both the projects after building are trying to keep the jars in the same folder from where Jetty is reading as well. Hence there is interference.
I have not tried. but If I keep 2 separate local repositories for both the projects, it should solve, but with this all the dependencies will also be unnecessarily duplicated. So the solution is as mentioned by #Andrey is that I keep the maven coordinates separate for both the projects, so that 2 separate jars are created for both. Thanks Andrey. I wont necessarily change maven coordinates for the all modules but for one where there is difference of code in both the projects. Hope this answer helps someone.

How to hotswap .xhtml files in Intellij with WebSphere

I'm migrating from eclipse to IntelliJ. In eclipse, when WebSphere servers are launched and I do changes in .xhtml or .xml (spring web-flow) files, changes can be seen instantly on web browser refresh and no server restart is needed.
An eclipse launch configuration is quite different there was a button "publish" that created project.ear.xml before server launch file which included paths to resources. Haven't found a similar option for Intellij, so using "ear exploded" (.ear not exploded is not the same thing in Intellij compared to Eclipse).
Now in order to launch servers in Intellij, I use "project:ear exploded" artifact which is being built before launch.
When the server is launched with Intellij and I do changes in ".xhtml" file no changes can be seen (hot-swapped), without server restart. In my server configuration, I also have chosen "On 'Update' action: Update classes and resources" (I assume that 'Update' action is build->build artifacts-> build new exploded .ear file). If I use run->update application->update resources it restarts server which is not acceptable because the application I'm using takes a lot of time to do it and even doesn't work properly after that and requires an additional server restart.
Does IntelliJ has any solution similar to eclipse for hot-swapping (instant) resources e.x .xhtml?

JRebel less useful in IntelliJ than Eclipse?

I just set up JRebel to use with my Spring web app in IntelliJ, and was very surprised to learn that I have to manually rebuild the project/recompile every time I want my changes to be reflected. Doesn't this defeat the whole purpose of JRebel? Is there something I'm missing here? With Eclipse it was nearly instant, make changes anywhere, save, instantly reflected in running app. With IntelliJ the process seems very clunky. Am I missing something here?
Running with JRebel in IntelliJ involves starting your application using Run > Run with JRebel and when you change your application code you have to build the project in order for IntelliJ to compile classes and update your application.
You can do this by running SHIFT + F9 or Build > Build Project
From the JRebel docs:
JRebel relies upon your IDE to do the compiling. JRebel reloads your compiled .class files and not your .java files. When you change code, JRebel pushes the changed classes and resources to the server without redeploying.
Regardless of what IDE you use, JRebel still needs the IDE to compile the classes before it can update the running application. IntelliJ is no different to Eclipse in this regard. Perhaps Eclipse was just auto building the project without you being aware of it. You can also instruct IntelliJ to auto build from Preferences > Build, Execution, Deployment > Compiler > Build project automatically.
Here's a screenshot showing that configuration setting:

netbeans 7.3 add git to project

I have multiple projects in netbeans. Some of these projects are version controlled using cvs and others using git. When I change something in the project that is using git, a .cvsignore file is created automatically. But I don't want the project to use git.
Secondly, I created the project in netbeans and then went to terminal and did a git init. There is no term/version control decoration on the project but when I do a team -> git -> initialize, netbeans says that "Selected file is already part of a Git repository.". Is this a bug?
It's not a bug. That means someone already added your project to Git. (At least tried).
If you want to get rid and add your project to your own Git repo , search for .git files inside the project and delete them.
After that start the process again.