last day (15 days later) » 

3:29 PM
1
A: Setting a system variable within a maven profile

peeskilletYou should check out the exec-maven-plugin With the following configuration (notice the <systemProperties>)... <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.3.2</version> <executions> <execution> <phase>pa...

 
so i would want to use the exec maven plugin opposed to what i currently use being maven-compiler-plugin?
 
No they can go together. The exec plugin is just responsible for launching the program. The compiler plugin doesn't do that.
 
one final question if thats ok? Currently i am setting some values in properties based on the profile in my maven pom file. Is it possible to set this system property in the profile ? because really, i only have one pom file for dev and prod and its within the profile i would need to set it. I will post my pom now
 
See my UPDATE
 
perfect - thank you so much for the help
is it necessary to define the main class and arguments parameters?
 
3:29 PM
Arguments, no. But if you don't specify the class, then it won't know the launching point of the program, and the goal will fail. Remember the point of the plugin is to execute a program
 
hey
 
sorry for the bombardment of questions!
essentially, the problem i am trying to solve here is that i need to send push notifications from my application, now, to do this i use a .p12 file. i have a dev and a prod file for doing this
in one of my classes (my push notification class) i need to know if i am running in dev or prod. now your solution shows me that it can be sent to a main method as a argument which i can then process?
however, my application is started by jboss and invokes this class as a rest web service
public class ServerStart extends Application{

private Set<Object> singletons = new HashSet<Object>();

public ServerStart() {
singletons.add(new ExposedFunctions());
}

@Override
public Set<Object> getSingletons() {
return singletons;
}
}
there is no main method
 
Check out the maven-jboss plugin. Not sure if there are system params you can pass. Let me try and look it up. gimme a minute
 
thanks
 
3:47 PM
Check out the jboss-as-maven-plugin. I couldn't find anything like the exec plugin where you can explicitly add system properties, but there is a jboss-as:execute-commands goal you might be able ot make use of, to make your development easier. You can do the same thing, passing the ${propert.name} with the command
 
ok will look in to that now - thanks very much
 
I just started using wildfly so I don't know much about jboss. Wish I could tell you more :-)
 
lol well its all a learning process i guess! thanks for giving up your time to help
 
 
2 hours later…
5:33 PM
hi
 

last day (15 days later) »