用maven建项目 创建成功,但mvn jetty:run-war 总是不成功 请大家帮帮忙
环境简介
C:\>echo %JAVA_HOME%
D:\jdk1.6.0_10
C:\>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_10
Java home: D:\jdk1.6.0_10\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
C:\>net start mysql
请求的服务已经启动。
请键入 NET HELPMSG 2182 以获得更多的帮助。
参考 http://appfuse.org/display/APF/AppFuse+QuickStart+-+Chinese 创建项目
命令
D:\MyProject>mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifact
Id=appfuse-basic-struts-archetype -DarchetypeVersion=2.1.0 -DgroupId=com.mycompany -DartifactId=mypr
oject -DarchetypeRepository=http://oss.sonatype.org/content/repositories/appfuse
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] ------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Wed Aug 24 19:46:42 CST 2011
[INFO] Final Memory: 10M/19M
[INFO] ------------------------------------
D:\MyProject>
D:\MyProject>cd myproject
D:\MyProject\myproject>tree
文件夹 PATH 列表
卷序列号为 2CE3-7E7C
D:.
└─src
├─main
│ ├─java
│ │ ├─com
│ │ │ └─mycompany
│ │ │ ├─action
│ │ │ └─webapp
│ │ │ ├─action
│ │ │ ├─filter
│ │ │ ├─interceptor
│ │ │ ├─jsp
│ │ │ ├─listener
│ │ │ ├─org
│ │ │ │ └─appfuse
│ │ │ │ └─model
│ │ │ ├─search
│ │ │ ├─taglib
│ │ │ └─util
│ │ └─org
│ │ └─appfuse
│ │ └─model
│ ├─resources
│ │ └─META-INF
│ └─webapp
│ ├─common
│ ├─decorators
│ ├─images
│ ├─scripts
│ │ ├─calendar
│ │ │ └─lang
│ │ └─dojo
│ ├─styles
│ │ ├─andreas01
│ │ │ └─images
│ │ ├─calendar-aqua
│ │ ├─puzzlewithstyle
│ │ │ └─images
│ │ └─simplicity
│ │ └─images
│ ├─template
│ │ ├─css_xhtml
│ │ └─xhtml
│ └─WEB-INF
│ └─pages
│ └─admin
├─site
└─test
├─java
│ └─com
│ └─mycompany
│ └─webapp
│ ├─action
│ ├─filter
│ └─listener
└─resources
D:\MyProject\myproject>
修改数据库密码 pom.xml 最后
<!-- Database settings -->
<dbunit.dataTypeFactoryName>org.dbunit.ext.mysql.MySqlDataTypeFactory</dbunit.dataTypeFactoryName>
<dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
<hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</hibernate.dialect>
<jdbc.groupId>mysql</jdbc.groupId>
<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
<jdbc.version>5.1.14</jdbc.version>
<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
<jdbc.url>jdbc:mysql://localhost/${db.name}?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true</jdbc.url>
<jdbc.username>root</jdbc.username>
<jdbc.password>*****</jdbc.password>
</properties>
</project>
唉 不知道怎么回事 总是不成功 mysql数据库 安装的很好 其他程序访问数据库都没事,唉不知怎么回事,请大家帮帮忙啊
[解决办法]
constra
int [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not inse
rt: [org.appfuse.model.User]
这个对象是不是有问题
[解决办法]
maven太复杂