1、按照以下方式新建一個web工程html
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
web-app
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns
=
"http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation
=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id
=
"schedule-console"
version
=
"3.0"
>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
faceted-project
>
<
fixed
facet
=
"wst.jsdt.web"
/>
<
installed
facet
=
"jst.web"
version
=
"3.0"
/>
<
installed
facet
=
"wst.jsdt.web"
version
=
"1.0"
/>
<
installed
facet
=
"java"
version
=
"1.8"
/>
</
faceted-project
>
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine() |
jar
file is located.jar
file name and version as necessary:
1
|
mvn
install
:
install
-
file
-Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
[INFO] Scanning
for
projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-
install
-plugin:2.3.1:
install
-
file
(default-cli) @ standalone-pom ---
[INFO] Installing
/Users/claude/installers/JDBC/sqljdbc_4
.0
/enu/sqljdbc4
.jar to
/Users/claude/
.m2
/repository/com/microsoft/sqlserver/sqljdbc4/4
.0
/sqljdbc4-4
.0.jar
[INFO] Installing
/var/folders/c6/q1bdtq557kv54783p1g6cbsw0000gp/T/mvninstall1874482299687761721
.pom to
/Users/claude/
.m2
/repository/com/microsoft/sqlserver/sqljdbc4/4
.0
/sqljdbc4-4
.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total
time
: 1.208s
[INFO] Finished at: Tue Mar 13 14:07:31 EDT 2012
[INFO] Final Memory: 3M
/81M
[INFO] ------------------------------------------------------------------------
|
Include the new dependency by modifying your project’s pom.xml
. Add the following dependency:java
1
2
3
4
5
|
<
dependency
>
<
groupId
>com.microsoft.sqlserver</
groupId
>
<
artifactId
>sqljdbc4</
artifactId
>
<
version
>4.0</
version
>
</
dependency
>
|
Save the pom.xml
file and build the project to make sure no errors exist.web
在eclipse中調試web項目,其實他是把相關的資料生成到以下路徑:
<eclipse workspace dir>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\MavenWeb