How to make a path relative in the vmargs? - maven

In my project I have an eclipse cdo-server which is set up as described here: http://wiki.eclipse.org/Setting_up_a_CDO_Server .
My project structure is like this:
-cdo-server plugin
|- config folder with cdo-server.xml
|- pom.xml
-cdo-server-product
|-pom.xml
-master
|-pom.xml
When I start my cdo-server.product as Eclipse application everything works fine.
When I build it and materialize it with Maven, it also has a BUILD SUCCESS. But when I start the CDO-CommonRepositoryServer.app which was built with Maven, there is the error:
!MESSAGE CDO server configuration not found:
/Users/pathtoCDO-Server/CDO-CommonRepositoryServer.app/Contents/MacOS/${resource_loc:/cdo.server/config}/cdo-server.xml.
This is logical, because this is the wrong path. When I enter the absolute path to the cdo-server.xml in the vmargs (-Dnet4j.config=/Users/pathtoCDO-config/cdo-server.xml) it also works. However, I want to make it relative, so that everybody in our git-repo can use it and not only in my folder structure.
Is there any possibility to make this path relative?
With -Dnet4j.config="${resource_loc:/cdo.server/config}" it only works when i run it as an eclipse application, but not as maven built .app file.
Update:
Now I can start the CDO-CommonRepository.app file if I take
-Dnet4j.config=../../../../../../../../../../cdo.server/config
as path, but then I can only start it with the maven built file and I cannot start it from inside Eclipse anymore...
I've created a new question for this new problem: Slash in property name in pom.xml

I just solved my problem in copying my files with Maven copy-resources in this stupid /Users/pathtoCDO-Server/CDO-CommonRepositoryServer.app/Contents/MacOS/${resource_loc:/cdo.server/config}/cdo-server.xml folder.

Related

Problems with Maven default folder

I'm Mohave Mac User.
I installed Maven and created project in Eclipse. Name of the project is "Mavenjava".
When I try to clean, compile, test command from Eclipse it doesn't work because it looking for a POM file in /User/Max/, not from /User/Max/Mavenjava
When I copy my POM file into /User/Max/ - "clean" command works but I can't do "compile" and "test" commands in terminal, because I see mistake like "skip non existing resourceDirectory".
It is still looking this files here /Users/Max/src/main/resources, but not in /User/Max/Mavenjava/src/main/resoursces/
How I could change default folders for Maven?
I spent 3 hours and don't know how to solve this problem.

Error: Can not find or load the main class com.example.demo.DemoApplication

i use spring STS meven and tomcat eclipse
all that is installed succesfuly
i imported the project from spring-initialiser
but i can't run my project
any help
Assuming you have not changed any codes and using exact code from spring initializer, it should work fine.
Make sure .class file is generated and it's in build path.
If above is ok then clean your workspace.
Go to your workspace, delete .metadata directory (or to be safe, copy the directory somewhere else to be safe)

dist and native-win could not be activated, no POM in directory

Please explain what is required to be done stepwise.
How to activate -dist and native-win?
I saw your error contains there is no pom in this directory.
Maven can run only from the location where pom file exists so make sure pom file is there in your project.
For example, your project is inside C:\Users\HP then so maven will consider HP as a project and it will try to find pom file inside HP project.
This error is coming because you didnot place hadoop source package in the C:/User/HP directory. you can download appropriate source package from http://www.apache.org/dist/hadoop/core/
unzip it and place all the files & folder in C:/User/HP then run your maven package command. It should work

How to make GPE see my war directory?

I already have a war directory created through maven and i would like to use that directory instead of src/main/webapp but the target directory is not seen by GPE . Other than project refresh i do not know what wlse to try.
Change Default Output Folder path from Java Build Path-> Source

p2.inf Filtering in Tycho when building an RCP application

I´m building an RCP application using tycho. The RCP application uses p2 and its self updateable capabilities configuring the respository in an p2.inf file. Works like a charm.
Now I want to introduce a placeholder ${updatesiteurl} in the p2.inf file and replace it with the URL according to the environment for which it is built. But unforunately it get´s replaced with an empty string instead of the environment variable which I guess happens because tycho, or the p2 director, replaces some escaped characters (like the ":" which is ${58} for example).
Any ideas how this could be solved? I thought about explicitly declaring the resource plugin and binding it to an earlier build phase but that didn´t work either...
What finally worked is: I moved the p2.inf file to directory /p2 and let the maven resource plugin copy the file with the replacements to a temporary folder in /target. Now a copy task copies the file in a later phase (why the hell didn´t this work in the same phase...) to the the root directory, where the .product file is, since both have to be in the same directory (with the same prefix). Finally clean deletes the p2.inf file in the root directory...

Resources