I'm trying to do a local setup to trace a call that starts at a jar file (front end) and uses the base code given in a separate war file. In Intellij is there a way to setup this scenario locally?
What I got so far is to have a tomcat run config for the jar file code and use "before launch" setting in it to try different options to deploy the war file. But this seems like a approach that wouldn't work so wanted to see anyone has faced a similar issue before.
In the Server Tab of Run/Debug Edit configurations, you can manually configure the Tomcat server with the "Add New Configuration" option. Configure the tomcat install location directory for Catalina Home & Catalina Base
For URL, enter eg: "http://localhost:8080/ui/".
Use "update Classes and Resources" for "On Update action" and "On
frame deactivation" options.
Now, In "Deployment tab" section-> click
on the + symbol to add Artifacts such as the following Select "your war
file", click OK, and enter the suitable Application Context as
"/ui/test"
Select "another war file", click OK, and enter suitably
Application Context as "/ui/api"
Enter any name for Tomcat configuration.
In the "Before Launch" section at the bottom of the
"Server" tab, click on the + symbol from the list of tasks in the
"Add New Task" popup, and select "Run Gradle task" or "maven",
depending upon what you have.
In the "Select Gradle task" window,
Click on the folder icon next to the Gradle Project text box and
choose "war" project
Click on OK Check that the selected Run Gradle task is shown in the
Before Launch window.
check the order and "Build 2 artifacts". Click Apply.
Related
I am going through the manual for our project and there is one step where we should "Add External Web Module".
There is a screenshot for Eclipse. Popup is called "Edit Web Module" and it has 2 rows for values:
Document base:
Path:
And one checkbox which says: "Auto reloading enabled".
But I am missing the very same screenshot or at least some steps for IntelliJ. I was able to find coderanch comments - it looks like it should be added inside tomcat but our manual says it is in IDE.
Also, Baeldung says https://www.baeldung.com/eclipse-tomcat that it is a configuration for tomcat.
Question: How can I add an external web module in IntelliJ?
y.bedrov Thanks for your answer! We can add a module in IntelliJ Idea exactly here:
File / New / Module from Existing Sources
Select module
Open it
Is it possible to run sbt-assembly from within IntelliJ IDEA?
Also I read in the doc that one could add task within the SBT Tool window. But what I see is that it only helps you view your project not task? I cannot add any tasks there. How does the Tool window work exactly?
I have the last version of IntelliJ IDEA.
You can find the SBT plugin useful for your needs. With it, you can execute any tasks or command available in your build so sbt-assembly ones should work, too.
The plugin gives you SBT Console in which you start a sbt shell as if you were running it on the command line. The plugin gives you a more IDEA-like environment to work with the interactive console.
This answer is now out-of-date.
IntelliJ now allows you to create a run configuration for an SBT task. You create the Run Configuration by :
choosing "Edit configurations" from the "Run" menu (or the toolbar
popup)
click the "+" button to add a configuration and select
"SBT Task" as the type of configuration you want to make.
fill out the details such as the name of the task and the
working directory if necessary
You can now run the task in the same way as any other run configuration; select it in the run configuration popup in the toolbar and click the run button (or if you're one of those keyboard-only people press shift-ctrl-r and select the task from the popup that appears)
official documentation here : https://www.jetbrains.com/help/idea/2016.2/run-debug-configuration-sbt-task.html
I have a groovy script I am working on, which imports dependencies using the #Grab annotation. This script will run within IDEA, and from the command line. However, within the IDE, the imports are shown in red (as unresolvable), and no auto-completion on the classes so imported is given.
I am accessing a corporate repository via a proxy, which has been configured as the Http Proxy within IDEA (the module should be, and is, in my local .m2 repo anyway!)
Anyone got any ideas (no pun intended!)?
I am using IntelliJ IDEA 12.5 Ultimate (IU-129.1135), JRE 1.7, and Groovy 2.1.6
As stated by CrazyCoder, Alt + Enter then select Grab the artifacts and Enter
There could be 2 problems interfering with the resolution of the Grab dependencies
Your source code folder has not been marked as "Sources Root". To do that, right click on the folder and select "Mark Directory As" -> "Sources Root"
Your project does not have a valid Project JDK. To do this, hit Ctrl-Alt-Shift-S, select "Project" -> "Project SDK" and give it a Java JDK.
Once these steps are done, you should be able to hit Alt + Enter and then select "Grab the artifacts"
I want to get, when i press the little green "run me" button in intelliJ, the running program to pick up and use this file (in the project structure)
/src/config/some_folder/some_xml.xml
However, when i press that green run button, intelliJ 12 is giving me this error:
Resource not found on classpath using context ClassLoader: some_folder/some_xml.xml
In an attempt to resolve, this, I have this in my Settings:Compiler: Resource patterns
!?*.java;!?*.form;!?*.class;!?*.groovy;!?*.scala;!?*.flex;!?*.kt;!?*.cl;?*.xml;?*.config
note the penultimate xml entry.
I also unchecked the "use external build" button. I do not know what it means or does, but I read somewhere that it should not be used.
I also have these (among other entries) in Project Structure:Modules: Sources tab
config
config\some_folder
Marked in blue (sources) under the Source Folders heading.
There is no fancy pom.xml for this project - it is an old legacy project. If i add a pom.xml to resolve this, where would i put it, what would i put in it (in entirety) and would i need to tell intelliJ i now have a pom.xml?
EDIT ok, so intelliJ can find the file when i refer to it as
./config/some_folder/some_xml.xml
but will not find it if it is reffered to as
some_folder/some_xml.xml
I think this is the real issue - how do i resolve this?
src/config needs to be configured in the project as a resources folder. In the project tray, right click /src/config and select "Mark Directory As" -> "Source Root"
I have created a test suite (making a main file and calling other test cases that I like to run) .Now is it possible to make a jar file of test suite that i have made so that just by clicking on the jar i can forcefully start the test .Also is it possible to create c config value outside jar.I am using java programming language.
Help plz.
If you are using eclipse as an ide you can create a jar file very easily.
Right click on project.
Go To Export.
Select Jar or Runnable Jar as per your use click on next.
Specify the main file name.
Click on Finish.
Before doing above steps. i mean
Right click on project.
Go To Export.
.
.
.
.....on Finish
Clean the project to avoid “duplicate entry” error when exporting Java project to JAR with Eclipse.
Enable Auto Refresh in Preferences - General - Workspace - Refresh Automatically (called Refresh using native hooks or polling in newer builds)
Or Just right click on the project and click Refresh.
to avoid “resource is out of sync with the filesystem” error.
Right click on project.
Go To Export.
Select Jar or Runnable Jar as per your use click on next.
Specify the main file name.
Click on Finish.