Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Commit 758b006

Browse files
committed
Moved dynamic config out of web.xml and into system properties.
Development mode is default in the JettyStarter and jetty plugin.
1 parent b16b625 commit 758b006

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,6 @@
213213
</execution>
214214
</executions>
215215
</plugin>
216-
<plugin>
217-
<groupId>org.mortbay.jetty</groupId>
218-
<artifactId>maven-jetty-plugin</artifactId>
219-
</plugin>
220216
<plugin>
221217
<groupId>org.apache.maven.plugins</groupId>
222218
<artifactId>maven-eclipse-plugin</artifactId>

submitit-webapp/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,25 @@
6565
</dependency>
6666
</dependencies>
6767

68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.mortbay.jetty</groupId>
72+
<artifactId>maven-jetty-plugin</artifactId>
73+
<configuration>
74+
<systemProperties>
75+
<systemProperty>
76+
<name>submitit.properties</name>
77+
<value>${basedir}/src/test/resources/submitit.properties</value>
78+
</systemProperty>
79+
<systemProperty>
80+
<name>wicket.configuration</name>
81+
<value>development</value>
82+
</systemProperty>
83+
</systemProperties>
84+
</configuration>
85+
</plugin>
86+
</plugins>
87+
</build>
88+
6889
</project>

submitit-webapp/src/main/scala/no/java/submitit/app/SubmititApp.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import authorization.IUnauthorizedComponentInstantiationListener
3535
class SubmititApp extends WebApplication with LoggHandling {
3636

3737
override def init() {
38-
SubmititApp.propertyFileName = super.getServletContext.getInitParameter("submitit.properties")
39-
if (SubmititApp.propertyFileName == null) throw new Exception("""You must specify "submitit.properties" as a init parameter.""")
38+
SubmititApp.propertyFileName = System.getProperty("submitit.properties")
39+
if (SubmititApp.propertyFileName == null) throw new Exception("""You must specify "submitit.properties" as a system property.""")
4040
val props = PropertyIOUtils.loadRessource(SubmititApp.propertyFileName)
4141

4242
SubmititApp.properties = DefaultConfigValues.mergeConfig(props)

submitit-webapp/src/main/webapp/WEB-INF/web.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@
3030
<session-timeout>120</session-timeout>
3131
</session-config>
3232

33-
<context-param>
34-
<param-name>submitit.properties</param-name>
35-
<param-value>submitit-webapp/src/test/resources/submitit.properties</param-value>
36-
</context-param>
3733
<context-param>
3834
<param-name>wicket.configuration</param-name>
39-
<param-value>development</param-value>
35+
<param-value>deployment</param-value>
4036
</context-param>
4137

4238
</web-app>

submitit-webapp/src/test/scala/JettyStarter.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ object JettyStarter {
3434
bb.setContextPath("/");
3535
bb.setWar(webappDir.toString);
3636

37-
System.setProperty("submitit.properties", new File(getBaseDir(getClass), "src/main/resources/submitit.properties").toString)
38-
37+
System.setProperty("submitit.properties", new File(getBaseDir(getClass), "src/test/resources/submitit.properties").toString)
38+
System.setProperty("wicket.configuration", "development")
39+
3940
server.addHandler(bb);
4041

4142
try {
42-
System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP");
43+
System.out.println(">>> STARTING EMBEDDED JETTY SERVER...");
4344
server.start();
44-
while (System.in.available() == 0) {
45-
Thread.sleep(5000);
46-
}
47-
server.stop();
45+
System.out.println(">>> Jetty Started @ port 8081");
4846
server.join();
4947
} catch {
5048
case e: Exception => {

0 commit comments

Comments
 (0)