How get project parent directory in pom.xml - maven

In maven set path to chrome driver as:
<driver.chrome>${project.basedir}/../repo</driver.chrome>
As result path is: D:\MyProj\..\repo
Answer: driver.chrome>file://${project.basedir}\..\repo</driver.chrome>

OK, I think I understand what you're asking. The resulting path you're getting is not minimized, but as far as I know, it is a valid path and it would work on any operating system.
In other words - D:\MyProj\..\repo is valid and equivalent to D:\repo. Go ahead and try to paste it into Windows Explorer and see if it opens it. Or cd to it in command prompt.

Related

vscode debugger configuration: cwd

I'm trying to configure a debugger for my project.
Here is the problem.
The project folder structure can be simplified like this:
- Project Root
- X
- Y
- etc
I absolutely need to set the cwd in the debugger config as X, otherwise the binary won't run. If I set it as X, program runs, debugger (sort of) works: I see the call stack and the values of the variables. However, vscode cannot find the files with code and I can't see the lines being executed. VSCode also gives me an error:
Unable to open 'file.cpp':
Unable to read file '/blahblah/cwd/Y/file.cpp'
Error: unable to resolve non-existing file.
So the debugger rightfully uses the cwd as a prefix to the rest of the file path, but Y is not nested into X, it is actually in the same root directory.
Again, I absolutely need the binary to be called from the X directory. Is there any way to tell vscode the proper path to the code files in this case?
So here is what worked for me:
// added this to launch.json
"sourceFileMap: {
"proc/self/cwd" : "{workspaceFolder}"
}
From the VSCode docs:
sourceFileMap:
This allows mapping of the compile-time paths for source
to local source locations. It is an object of key/value pairs and will
resolve the first string-matched path. (example: "sourceFileMap": {
"/mnt/c": "c:\" } will map any path returned by the debugger that
begins with /mnt/c and convert it to c:\. You can have multiple
mappings in the object but they will be handled in the order
provided.)
My problem was that the directory from which I needed the process to run didn't match the directory where the source files are located. In the error message vscode gave me I saw the path it uses to try to find source files ("/proc/self/cwd"). So I mapped this path to the one I actually need (just the workspaceFolder in my case).

Images Disappear in Running Status on Qt

Original design :
Setting in property :
When the program is running :
All the image inside the project folder "QuickRecorder/Images/MainWindow".
How to solve this problem?
Thank you for your help.
In cases like this the reason almost always is: You use relative path to the image, and the working directory is different when you run the application, and image is not found by the relative path.
To debug, add this to your main to print current working directory:
qDebug() << QDir::currentPath();
A few solutions:
Use absolute paths (preferably so that you construct them at runtime, for example using QCoreApplication::applicationDirPath(), instead of hard-coding).
Put images to Qt resources, so they are embedded to the executable.
Change working directory after application starts (might have unintended consequences if you for example launch child processes, or with file open/save dialogs).
Untested, moved from comment to answer: To automatically copy files from the source dir to the build dir, you could add a build step "Custom Process Step" in the Qt Creator project settings. The command you might want to use for the case of this question might be (again, untested):
cp -rv %{sourceDir}/QuickRecorder %{buildDir}

Issue with dotNerInstaller Getting error "The installation package could not be opened. Verify..."

When I create exe within the C:\Program Files\dotNetInstaller\bin folder, and run it, it works perfect, install perfect, but when I try to install that exe from any other location/path, the error appears "The installation package could not be opened. Verify that the package exists and that you can access it. etc....."
I created an exe and moved to another XP system, on that system, it again gives me error ?
whats the solution ? Is there any admin rights issue ?
I have tried with both TRUE and FALSE of Administrator_Required option.
any idea how can I solve this issue ?
The issue is resolved now.
I should have written #CABPATH\ in the MSI->Package field. Before I was writing #TEMPPATH\
I think you can should add the location:
C:\Program Files\dotNetInstaller\bin
in the PATH environment variable. Follow the steps: Go to
My Computer->Right click->Properties->Advanced System Settings
->Click Environmental Variables. Now click PATH and then click EDIT.
In the variable value field, go to the end and append ';' (without quotes) and then add the above path.

appledoc Exception: at least one directory

After wasting some time to figure out what goes wrong, I finally have to ask for help. I want to use appledocs from Gentle Bytes. I followed every step of the quick install guide, but I´m not able to compile the project.
Here is what I´ve done:
1. cloned it from git://github.com/tomaz/appledoc.git
2. installed the templates to ~/Library/Application Support/appledoc
3. tried to compile the project
Everytime I try to compile, I get following error:
ERROR: AppledocException: At least one directory or file name path is required, use 'appledoc --help'
What do I have to do now?
Sounds like you've compiled it just fine and are now running the program. If it's a command-line program try command-option-R in Xcode to provide some arguments (i.e. names of files that you want to process).
The error means you didn't give it source paths: after all switches, you must give it at least one path to your source files. Can be either file or directory. In later case it will recursively scan the dir. Here's example
appledoc <options> ~/MyProject
Above example will use ~/MyProject directory as a source. You can also add multiple source paths. Note that you need to give the tool few options, see this page for minimum command line and other usage examples.
You either have to copy appledoc executable to one of directories in your path, as suggested by Caleb, or use full path to it when invoking (for example: /path/to/appledoc)

Path Error running CakePHP's "cake" console utility in Windows

A while ago when I started with Cake, I managed to get the console running in my Windows environment, and I have no idea how. I'm now having problems to make it work again in another computer.
This is what I've done in the new machine:
Downloaded my Cake code from source control (so all the files are exactly the same as the computer where it worked, including the configuration files)
Added PHP and "c:\my_cake_path\cake\console" to the path
If I run "cake OneOfMyShells", either standing on the /app, or in /cake/console directories, I get the following error:
Warning: get_object_vars() expects parameter 1 to be object, null given in C:\my_cake_path\cake\libs\model\connection_manager.php on line 199
Error: Missing Database Connection. Try 'cake bake'
"cake Bake", if run normally, when I try to get it to do the DB config ends up throwing another error (which is not that relevant to this)
However, if I run: cake bake -app "c:\my_cake_path\app"
Then bake works, I can do the database config, and it writes the DB config file (which is useless at this point, since I already had one)
Then, of course: cake OneOfMyShells -app "c:\my_cake_path\app"
does work perfectly well.
So, everything's working fine, I just need to manually specify the path to "app" every single time, which is very annoying.
How can I get around this? Where is Cake looking for to find the path to app?
Thanks!
Daniel
Not much of a difference in the sense you still need to type but you can run cake from the app dir like this: C:\XXX\project\app> ..\cake\console\cake.bat
To make it smaller you can put that line on a .bat or just add the \cake\console dir the windows path

Resources