0
我嘗試以嵌入式形式啓動碼頭,但我遇到問題嵌入式jetty maven profile.xml
我需要在嵌入式jetty啓動之前讀取profile.xml中的屬性值。
有什麼建議嗎?
這裏是profile.xml配置的內容
.....
<profile>
<id>local-dev</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<!-- Common Security Framework Properties -->
<security.context.file>applicationContext-security-csf.xml</security.context.file>
<csf.jndi.name>jdbc/securityDS</csf.jndi.name>
<csf.security.system.admin.roleId>884</csf.security.system.admin.roleId>
<csf.cas.url>tkvwasa01.secure.kodcu.com</csf.cas.url>
<application.service.url>localhost:8080/pqis-admin</application.service.url>
</properties>
</profile>
在Maven的身邊,我可以激活上述個人資料(本地開發),如
命令mvn碼頭:運行本地開發
,但我怎麼能當我使用Embedded Jetty時,激活上面的配置文件(local-dev)?
嵌入式碼頭的代碼:
public class Start {
public static void main(String[] args) throws Exception {
Server server = new Server();
SocketConnector connector = new SocketConnector();
// Set some timeout options to make debugging easier.
connector.setMaxIdleTime(1000 * 60 * 60);
connector.setSoLingerTime(-1);
connector.setPort(8080);
server.setConnectors(new Connector[] { connector });
WebAppContext bb = new WebAppContext();
bb.setServer(server);
bb.setContextPath("/");
bb.setWar("src/main/webapp");
.....
}
}
感謝。
你有什麼問題?也許你應該發佈你的相關pom片段,假設你正在嘗試通過maven開始它 – Raghuram 2011-01-21 10:18:54
當你運行你的嵌入式碼頭(Start類)時,maven會如何進入圖片? – Raghuram 2011-01-21 11:13:53