I've got a plugin, and I want to pass it some system properties. When developing locally with the Atlassian SDK, I am able the pass the properties via the --jvmargs parameter. Instead, I would like to set those properties in setenv.bat, but I'm not having much luck. I added a setenv.bat in the {plugin-folder}/target/container/tomcat6x/apache-tomcat-6.0.20/bin folder, but it doesn't seem to be recognized.
setenv.bat did not exist in the bin folder, but I found it in the bin folder of our dev environment, so I copied it over. The bin folder did contain catalina.bat, but it seems like that isn't being used either.
Any ideas would be appreciated.
Community moderators have prevented the ability to post new answers.
Why do you want an external .bat file, when you can define all jvmargs in your pom?
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-jira-plugin</artifactId> <version>${atl.plugin.sdk.version}</version> <extensions>true</extensions> <configuration> <productVersion>${jira.version}</productVersion> <productDataVersion>${jira.data.version}</productDataVersion> <jvmArgs><!-- all your jvmArgs, e.g. -Xmx512m -XX:MaxPermSize=256m--></jvmArgs> </configuration> </plugin>
Good thought, that would be useful in many cases. But for my case, the values will be different in each environment, so I can't define them in the plugin itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure you can. You can define a profile with it's respective settings for each environment.
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, we can use a maven profile for local testing, while continuing to rely on the setenv file for our development and production environments (where we don't have issues using setenv).
I still think it could be advantageous to use catalina.bat and setenv.bat with the SDK for local testing, even if it isn't required for this particular circumstance. The files exist for a reason, and it would be a shame if nobody could use them with the SDK. Is it possible to instruct the SDK to run tomcat with these files? My specific issue has been resolved, but an answer for this question could be useful for other users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm. I assume at least catalina.bat should be called since system.out logs the start of catalina. Within catalina.bat, setenv.bat is called (when found).
Do you have anything like "@echo" in your setenv.bat? Because I read somewhere, that this functions like a delimiter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I would have figured the catalina.bat would be used. I had updated the first two lines in \target\container\tomcat6x\apache-tomcat-6.0.20\bin\catalina.bat to:
@echo on
echo Hello World
Then I started up again using atlas-debug.
This seems pretty simple, but Hello World is not being echoed anywhere. It seems like atlas-debug must be using some other scripts to start.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess that's the problem here. The '@' character is used as a delimiter so everything gets messed up afterwards when called by maven. Erase '@echo on' and it should work (erase 'echo Hello World' after you confirmed functionality, too). System outputs shouldn't be used in those files - just environment settings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No luck. I removed "@echo on" and verified there were no other @ characters in the file. I'm still not seeing the output. Are you sure that it's not using a Catalina.bat from another location?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.