I'm using appassembler
plugin to generate my application structure successfully. Because my application is started from init.d
script I amended the configuration so the application runs under serveruser
rather than root
:
<generatorConfigurations>
<generatorConfiguration>
<property>
<name>run.as.user.envvar</name>
<value>serveruser</value> <-- Here the user is set -->
</property>
</configuration>
</generatorConfiguration>
</generatorConfigurations>
This works fine when deployed to server but I want to be able to run the application locally after running mvn clean package
. And in that case it tries to su
(switch user) to serveruser
which doesn't exist on my local machine. Is there any best practice around this?
The ultimate goal is to be able:
- Build locally and run via the generated scripts
- Package the same generated project structure deploy it and run from there