I am using Eclipse docker tooling (version 5.1.0.202012081929). Is there any way to specify docker options, for instance -w /usr/src/mymaven or -p 8080:8080? The first example is an option missing from the dialog, while the second would help debug or override what may not be working from the dialog.
Related
Is there a way in VSCode with docker extension to change docker-compose up arguments? By default it is started as docker-compose -f "docker-compose.yml" up -d --build. But I don't want to rebuild project each time. I want to run separate docker-compose build command if I need it.
I've looked over devcontainer.json parameters and working with containers article, but did not find anything useful.
Found the solution.
This can be done edditing Docker extension settings.
There is a check "Docker: Docker Compose build", which can be removed in order to disable build.
Also, settings.json can be changed with "docker.dockerComposeBuild": false parameter
To run my Maven application in Windows, I start the Cargo container with this command:
C:\code\myapp> mvn -P cargo.run
Then I use Ctrl-C to stop the Cargo container.
I want to do the same thing in Eclipse. I've created a run configuration for Maven:
This allows me to start the Cargo container, which I can view in the the Ecipse console:
At this point, Ctrl-C does nothing. I read here that Ctrl-C doesn't work inside Eclipse, but that I can stop the container with mvn cargo:stop. As you can see in the screenshot, I'm trying to use this command but it doesn't do anything. There's also a Maven console in Eclipse, but this command doesn't do anything there either:
If I use the Terminate button in the console window (red square), it leaves an orphaned JRE instance that I have to stop manually, and the container is still running.
Is there another window where I should be trying to use this command? Is there a better way to start and stop the container in Eclipse?
There is some information missing in your question, like your pom configuration that would help a lot to provide you the best answer possible.
The solution that will work for sure is to create a new run configuration for Maven on your project, as you did to launch your container with cargo, but instead of using the profile that you created to launch cargo, use the goal cargo:stop and then run this configuration.
It will launch the command mvn cargo:stop in another shell and will stop the container. And then you will be able to stop the console of the execution that launched cargo without having the orphaned JRE running.
A few years ago (about 8...) I tried to find a better solution when I worked a lot with cargo but could not improved this way to do it.
I am new to Linux. I am trying to develop ROS application using eclipse. I don't understand the below which is provided in ROS website. Can you explain this in more simple way, So that I can configure my eclipse after downloading from eclipse.org.
Reusing your shell's environment
For building and running ROS programs from inside IDEs, the ROS
enviroment has to be set up. All IDEs might have a config for that,
but running your IDE from your ROS-sourced shell should be the easiest
way, avoiding inconsistency.
Likewise, you can enhance your IDE's launcher icon to load your shells
environment. E.g., replace its command eclipse with
bash -i -c "eclipse". This will make bash source
~/.bashrc, in which ROS has to
be sourced and parameterized, and start that IDE.
use following commands:
cd <your_catkin_workspace>
catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles"
cd build
cmake ../src -DCMAKE_BUILD_TYPE=Debug
now you can import your project to eclipse
after that you can create a desktop application entry for eclispe:
sudo vim /usr/share/applications/eclipse.desktop
[Desktop Entry]
Type=Application
Terminal=false
Icon=<path_to_your_eclipse_dir>/icon.xpm
Exec=bash -i -c "source /opt/ros/hydro/setup.bash && source $HOME/workspace/<your_catkin_workspace>/devel/setup.bash && <path_to_your_eclipse_dir>/eclipse"
Comment=IDE
Name=eclipse
Comment=IDE
It seems that a wiki was published about this subject here
Put simply, the lines you listed are suggesting you run your IDE (eclipse) from a terminal which has already been sourced. So for instance, if you have a package called mypackage, you might type in a terminal:
cd ~/mypackage
source devel/setup.bash
eclipse
The first line is just however you get to your package, the second line sets up environmental variables for you (like changing your PATH), then you can run eclipse with all of those already setup so you don't have to configure your package in eclipse 100% manually.
I'm try to execute the following string of commands through a an External Tools Configuration in Eclipse (it basically deploys a build to a server and touches the server's plan file, causing the server to update itself with the new build):
mvn -P virgo package -o -Dmaven.test.skip=true && touch ${env_var:SERVER_HOME}/pickup/{project_name}.plan
On Windows, I was able to pass this string (with slight modifications) to cmd.exe using its /c argument and see the output in Eclipse's Console.
How can I get this behavior on Mac?
UPDATE
Another way of phrasing the question is, how can one feed an argument to Terminal to be execute (i.e., Terminal.app -argument "mvn -P virgo package -o -Dmaven.test.skip=true && touch ${env_var:SERVER_HOME}/pickup/{project_name}.plan")?
Another possibility would be to use a shell script, but I don't have experience with them.
I have managed to initiate php-cli script debug session from the IDE itself, but I need to start the debugging session from the shell / command line. These are rather complex maintenance PHP scripts which take a lot of input parameters, so entering arguments from within Netbeans is a bit cumbersome.
I have done it before with Zend studio: https://zend18.zendesk.com/hc/en-us/articles/203838096-Debugging-PHP-CLI-Scripts, but now I need to get it working with Netbeans.
I got this working on Ubuntu/Netbeans by:
copying the xdebug config lines from the /etc/php5/apache2/php.ini file into /etc/php5/cli/php.ini
setting an environment variable with the name of the debug session (you can get this from the query string in the url of the page netbeans launches when you start debugging) so the command is: export XDEBUG_CONFIG="idekey=netbeans-xdebug"
Then it's simply a case of starting debugging in netbeans and doing php myscript.php at the command line.
Note:
If you want to debug remotely using netbeans you need to use Debug File on the file that is being run from the command line, not normal Debug.
Add xdebug.remote_autostart=On to your php.ini file or add -dxdebug.remote_autostart=On as parameter to the PHP binary call (php -d... script.php).
See http://xdebug.org/docs/remote
I will put all together, the following is that works for me.
file:
/etc/php5/cli/php.ini
zend_extension="/usr/lib/php5/20121212/xdebug.so" -> xdebug bin path
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9000 -> same port configured in netbeans debugging tab
xdebug.idekey="netbeans-xdebug" -> same ide configured in netbeans debuggin tab
xdebug.remote_autostart=1
then, without any other parameter
php script.php
I had the same problem, my solution was this:
Environment: Netbeans 8.2 under windows (apache+php)
Assuming you already have PHP and NetBeans configured to debug
code using Xdebug (http://wiki.netbeans.org/HowToConfigureXDebug#Notes_on_Windows_Configuration)
On netbeans create new Configuration (“Project Properties” > “Run configuration” > “New…”
In the new Configuration set Do Not Open web Browser (“Advanced” > “Do Not Open web Browser”)
Set active the new configuration created (drop down in tool bar)
Set breakpoint for debug
Open debug (CTRL+F5)
Open Terminal window (“Tools” > “Open in Terminal”)
Type in terminal: $ export XDEBUG_CONFIG="idekey=netbeans-xdebug" (the value "netbeans-xdebug" must coincide with “Tools” > “Options” > “Debugging” > “Session ID”)
Type in terminal: $ php.exe -f "C:\Apache24\htdocs\www.SiteName\ScriptName.php" -- "Arg1=x&Arg2=y"
Follow debug…
I had the same problem my solution was this:
In Netbeans > the project window > right click on the php project > properties > Run configuration.
Create a New Configuration.
Fill the correct values:
Run as "script"
set php interpreter
change index file in my case it was "cron/index.php".
You can use the Dephpugger project if you dont want to configure xDebug for your IDE (i hate configurations).
https://github.com/tacnoman/dephpugger
You can run the debugger in terminal, like ipdb for Python and byebug for Ruby.
Make sure you also setup DBGP_IDEKEY value, because usually it is not idekey.
For example on Linux:
export DBGP_IDEKEY="netbeans-xdebug"
export XDEBUG_CONFIG="netbeans-xdebug=netbeans-xdebug"