﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-探讨Java技术，努力学习，分享心得</title><link>http://www.blogjava.net/quxiangjun/</link><description>我不是技术控，拿来主义其实也挺好，但是一定要有自己的想法</description><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 06:22:51 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 06:22:51 GMT</pubDate><ttl>60</ttl><item><title>Maven的工程目录结构</title><link>http://www.blogjava.net/quxiangjun/archive/2015/02/10/422854.html</link><dc:creator>瞿祥军</dc:creator><author>瞿祥军</author><pubDate>Tue, 10 Feb 2015 09:07:00 GMT</pubDate><guid>http://www.blogjava.net/quxiangjun/archive/2015/02/10/422854.html</guid><wfw:comment>http://www.blogjava.net/quxiangjun/comments/422854.html</wfw:comment><comments>http://www.blogjava.net/quxiangjun/archive/2015/02/10/422854.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/quxiangjun/comments/commentRss/422854.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/quxiangjun/services/trackbacks/422854.html</trackback:ping><description><![CDATA[<div>pom.xml 的参照模型<br /><br />&lt;?xml version="1.0" encoding="UTF-8"?&gt;</div><div>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div><div><span style="white-space:pre">	</span>xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;</div><div><span style="white-space:pre">	</span>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</div><div></div><div><span style="white-space:pre">	</span>&lt;groupId&gt;com.brms.governor&lt;/groupId&gt;</div><div><span style="white-space:pre">	</span>&lt;artifactId&gt;brms-governor&lt;/artifactId&gt;</div><div><span style="white-space:pre">	</span>&lt;version&gt;0.9.0&lt;/version&gt;</div><div><span style="white-space:pre">	</span>&lt;packaging&gt;pom&lt;/packaging&gt;</div><div></div><div><span style="white-space:pre">	</span>&lt;properties&gt;</div><div><span style="white-space:pre">		</span>&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;</div><div><span style="white-space:pre">		</span>&lt;java-version&gt;1.6&lt;/java-version&gt;</div><div><span style="white-space:pre">		</span>&lt;java-encoding&gt;UTF-8&lt;/java-encoding&gt;</div><div><span style="white-space:pre">		</span>&lt;dpap-version&gt;1.1.2&lt;/dpap-version&gt;</div><div><span style="white-space:pre">		</span>&lt;brms-server-version&gt;0.9.0&lt;/brms-server-version&gt;</div><div><span style="white-space:pre">		</span>&lt;brms-governor-version&gt;0.9.0&lt;/brms-governor-version&gt;</div><div><span style="white-space:pre">		</span>&lt;wro4j-version&gt;1.6.3&lt;/wro4j-version&gt;</div><div><span style="white-space:pre">		</span>&lt;wro4j-minimize&gt;false&lt;/wro4j-minimize&gt;</div><div><span style="white-space:pre">		</span>&lt;mybatis-version&gt;3.0.5&lt;/mybatis-version&gt;</div><div><span style="white-space:pre">		</span>&lt;mybatis-spring-version&gt;1.0.1&lt;/mybatis-spring-version&gt;</div><div><span style="white-space:pre">	</span>&lt;/properties&gt;</div><div></div><div></div><div><span style="white-space:pre">	</span>&lt;dependencyManagement&gt;</div><div><span style="white-space:pre">		</span>&lt;dependencies&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;com.brms.server&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;brms-server-base&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${brms-server-version}&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;redis.clients&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;jedis&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;2.1.0&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;exclusions&gt;</div><div><span style="white-space:pre">					</span>&lt;exclusion&gt;</div><div><span style="white-space:pre">						</span>&lt;groupId&gt;commons-pool&lt;/groupId&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;commons-pool&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;/exclusion&gt;</div><div><span style="white-space:pre">				</span>&lt;/exclusions&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;3.0.5.RELEASE&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;spring-context&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;3.0.5.RELEASE&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.springframework.data&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;spring-data-redis&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;1.1.1.RELEASE&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;exclusions&gt;</div><div><span style="white-space:pre">					</span>&lt;exclusion&gt;</div><div><span style="white-space:pre">						</span>&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;/exclusion&gt;</div><div><span style="white-space:pre">					</span>&lt;exclusion&gt;</div><div><span style="white-space:pre">						</span>&lt;groupId&gt;org.springframework&lt;/groupId&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;spring-context&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;/exclusion&gt;</div><div><span style="white-space:pre">				</span>&lt;/exclusions&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;javax.servlet&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;servlet-api&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;2.5&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;scope&gt;provided&lt;/scope&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;javax.servlet&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;jsp-api&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;2.0&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;scope&gt;provided&lt;/scope&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;junit&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;junit&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;4.8.2&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;scope&gt;test&lt;/scope&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div></div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;oracle&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;oracle-jdbc&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;10.1.0.2.0&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;scope&gt;test&lt;/scope&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;!-- mybatis 坐标 --&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.mybatis&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;mybatis&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${mybatis-version}&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.mybatis&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;mybatis-spring&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${mybatis-spring-version}&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;!-- DPAP framework start --&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;com&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;framework-shared&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${dpap-version}&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div></div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;com&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;framework-server&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${dpap-version}&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;exclusions&gt;</div><div><span style="white-space:pre">					</span>&lt;exclusion&gt;</div><div><span style="white-space:pre">						</span>&lt;groupId&gt;net.sf.jasperreports&lt;/groupId&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;jasperreports&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;/exclusion&gt;</div><div><span style="white-space:pre">				</span>&lt;/exclusions&gt;</div><div></div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;com&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;framework-sso&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;${dpap-version}&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span>&lt;dependency&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.lazyluke&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;log4jdbc-remix&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;0.2.7&lt;/version&gt;</div><div><span style="white-space:pre">			</span>&lt;/dependency&gt;</div><div><span style="white-space:pre">			</span></div><div><span style="white-space:pre">			</span>&lt;!-- DPAP framework end --&gt;</div><div><span style="white-space:pre">		</span>&lt;/dependencies&gt;</div><div><span style="white-space:pre">	</span>&lt;/dependencyManagement&gt;</div><div></div><div><span style="white-space:pre">	</span>&lt;distributionManagement&gt;</div><div><span style="white-space:pre">		</span>&lt;repository&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;releases&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;name&gt;release repository&lt;/name&gt;</div><div><span style="white-space:pre">			</span>&lt;url&gt;http://私服:端口/nexus/content/repositories/releases&lt;/url&gt;</div><div><span style="white-space:pre">		</span>&lt;/repository&gt;</div><div><span style="white-space:pre">		</span>&lt;snapshotRepository&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;snapshots&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;name&gt;snapshot repository&lt;/name&gt;</div><div><span style="white-space:pre">			</span>&lt;url&gt;http://私服:端口/nexus/content/repositories/snapshots&lt;/url&gt;</div><div><span style="white-space:pre">		</span>&lt;/snapshotRepository&gt;</div><div><span style="white-space:pre">	</span>&lt;/distributionManagement&gt;</div><div></div><div><span style="white-space:pre">	</span>&lt;build&gt;</div><div><span style="white-space:pre">		</span>&lt;pluginManagement&gt;</div><div><span style="white-space:pre">			</span>&lt;plugins&gt;</div><div><span style="white-space:pre">				</span>&lt;plugin&gt;</div><div><span style="white-space:pre">					</span>&lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;</div><div><span style="white-space:pre">					</span>&lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;version&gt;1.0.0&lt;/version&gt;</div><div><span style="white-space:pre">					</span>&lt;configuration&gt;</div><div><span style="white-space:pre">						</span>&lt;lifecycleMappingMetadata&gt;</div><div><span style="white-space:pre">							</span>&lt;pluginExecutions&gt;</div><div><span style="white-space:pre">								</span>&lt;pluginExecution&gt;</div><div><span style="white-space:pre">									</span>&lt;pluginExecutionFilter&gt;</div><div><span style="white-space:pre">										</span>&lt;groupId&gt;ro.isdc.wro4j&lt;/groupId&gt;</div><div><span style="white-space:pre">										</span>&lt;artifactId&gt;wro4j-maven-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">										</span>&lt;versionRange&gt;[1.6.0,)&lt;/versionRange&gt;</div><div><span style="white-space:pre">										</span>&lt;goals&gt;</div><div><span style="white-space:pre">											</span>&lt;goal&gt;run&lt;/goal&gt;</div><div><span style="white-space:pre">										</span>&lt;/goals&gt;</div><div><span style="white-space:pre">									</span>&lt;/pluginExecutionFilter&gt;</div><div><span style="white-space:pre">									</span>&lt;action&gt;</div><div><span style="white-space:pre">										</span>&lt;execute /&gt;</div><div><span style="white-space:pre">									</span>&lt;/action&gt;</div><div><span style="white-space:pre">								</span>&lt;/pluginExecution&gt;</div><div><span style="white-space:pre">							</span>&lt;/pluginExecutions&gt;</div><div><span style="white-space:pre">						</span>&lt;/lifecycleMappingMetadata&gt;</div><div><span style="white-space:pre">					</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;plugin&gt;</div><div><span style="white-space:pre">					</span>&lt;groupId&gt;ro.isdc.wro4j&lt;/groupId&gt;</div><div><span style="white-space:pre">					</span>&lt;artifactId&gt;wro4j-maven-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;version&gt;${wro4j-version}&lt;/version&gt;</div><div><span style="white-space:pre">					</span>&lt;executions&gt;</div><div><span style="white-space:pre">						</span>&lt;execution&gt;</div><div><span style="white-space:pre">							</span>&lt;phase&gt;process-resources&lt;/phase&gt;</div><div><span style="white-space:pre">							</span>&lt;goals&gt;</div><div><span style="white-space:pre">								</span>&lt;goal&gt;run&lt;/goal&gt;</div><div><span style="white-space:pre">							</span>&lt;/goals&gt;</div><div><span style="white-space:pre">						</span>&lt;/execution&gt;</div><div><span style="white-space:pre">					</span>&lt;/executions&gt;</div><div><span style="white-space:pre">					</span>&lt;configuration&gt;</div><div><span style="white-space:pre">						</span>&lt;minimize&gt;${wro4j-minimize}&lt;/minimize&gt;</div><div><span style="white-space:pre">						</span>&lt;extraConfigFile&gt;${basedir}/src/main/resources/com/module/${moduleContext}/server/META-INF/wro.properties&lt;/extraConfigFile&gt;</div><div><span style="white-space:pre">						</span>&lt;wroManagerFactory&gt;ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory&lt;/wroManagerFactory&gt;</div><div><span style="white-space:pre">						</span>&lt;cssDestinationFolder&gt;${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/styles/wro/&lt;/cssDestinationFolder&gt;</div><div><span style="white-space:pre">						</span>&lt;jsDestinationFolder&gt;${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/scripts/wro/&lt;/jsDestinationFolder&gt;</div><div><span style="white-space:pre">						</span>&lt;wroFile&gt;${basedir}/src/main/resources/com/module/${moduleContext}/server/META-INF/wro.xml&lt;/wroFile&gt;</div><div><span style="white-space:pre">						</span>&lt;groupNameMappingFile&gt;${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/wromapping.properties&lt;/groupNameMappingFile&gt;</div><div><span style="white-space:pre">					</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;plugin&gt;</div><div><span style="white-space:pre">					</span>&lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;</div><div><span style="white-space:pre">					</span>&lt;artifactId&gt;tomcat6-maven-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">					</span>&lt;version&gt;2.1&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">			</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">		</span>&lt;/pluginManagement&gt;</div><div><span style="white-space:pre">		</span>&lt;plugins&gt;</div><div><span style="white-space:pre">			</span>&lt;plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;2.1.1&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;attach&gt;true&lt;/attach&gt;</div><div><span style="white-space:pre">					</span>&lt;encoding&gt;UTF-8&lt;/encoding&gt;</div><div><span style="white-space:pre">				</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">				</span>&lt;executions&gt;</div><div><span style="white-space:pre">					</span>&lt;execution&gt;</div><div><span style="white-space:pre">						</span>&lt;phase&gt;compile&lt;/phase&gt;</div><div><span style="white-space:pre">						</span>&lt;goals&gt;</div><div><span style="white-space:pre">							</span>&lt;goal&gt;jar&lt;/goal&gt;</div><div><span style="white-space:pre">						</span>&lt;/goals&gt;</div><div><span style="white-space:pre">					</span>&lt;/execution&gt;</div><div><span style="white-space:pre">				</span>&lt;/executions&gt;</div><div><span style="white-space:pre">			</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">			</span>&lt;plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;</div><div><span style="white-space:pre">				</span>&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">				</span>&lt;version&gt;2.5.1&lt;/version&gt;</div><div><span style="white-space:pre">				</span>&lt;configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;source&gt;${java-version}&lt;/source&gt;</div><div><span style="white-space:pre">					</span>&lt;target&gt;${java-version}&lt;/target&gt;</div><div><span style="white-space:pre">					</span>&lt;encoding&gt;${java-encoding}&lt;/encoding&gt;</div><div><span style="white-space:pre">				</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">			</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">		</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">	</span>&lt;/build&gt;</div><div><span style="white-space:pre">	</span>&lt;profiles&gt;</div><div><span style="white-space:pre">		</span>&lt;profile&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;dev&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;properties&gt;</div><div><span style="white-space:pre">				</span>&lt;staticServer&gt;http://静态资源服务器/dpap/dpap&lt;/staticServer&gt;</div><div><span style="white-space:pre">			</span>&lt;/properties&gt;</div><div><span style="white-space:pre">			</span>&lt;build&gt;</div><div><span style="white-space:pre">				</span>&lt;plugins&gt;</div><div><span style="white-space:pre">					</span>&lt;plugin&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">						</span>&lt;configuration&gt;</div><div><span style="white-space:pre">							</span>&lt;webResources&gt;</div><div><span style="white-space:pre">								</span>&lt;resource&gt;</div><div><span style="white-space:pre">									</span>&lt;directory&gt;src/main/webapp&lt;/directory&gt;</div><div><span style="white-space:pre">									</span>&lt;includes&gt;</div><div><span style="white-space:pre">										</span>&lt;include&gt;WEB-INF/web.xml&lt;/include&gt;</div><div><span style="white-space:pre">									</span>&lt;/includes&gt;</div><div><span style="white-space:pre">									</span>&lt;filtering&gt;true&lt;/filtering&gt;</div><div><span style="white-space:pre">								</span>&lt;/resource&gt;</div><div><span style="white-space:pre">							</span>&lt;/webResources&gt;</div><div><span style="white-space:pre">						</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">			</span>&lt;/build&gt;</div><div><span style="white-space:pre">		</span>&lt;/profile&gt;</div><div><span style="white-space:pre">		</span>&lt;profile&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;normal&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;properties&gt;</div><div><span style="white-space:pre">				</span>&lt;staticServer&gt;http://静态资源服务器/dpap/dpap&lt;/staticServer&gt;</div><div><span style="white-space:pre">			</span>&lt;/properties&gt;</div><div><span style="white-space:pre">			</span>&lt;build&gt;</div><div><span style="white-space:pre">				</span>&lt;plugins&gt;</div><div><span style="white-space:pre">					</span>&lt;plugin&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">						</span>&lt;configuration&gt;</div><div><span style="white-space:pre">							</span>&lt;webResources&gt;</div><div><span style="white-space:pre">								</span>&lt;resource&gt;</div><div><span style="white-space:pre">									</span>&lt;directory&gt;src/main/webapp&lt;/directory&gt;</div><div><span style="white-space:pre">									</span>&lt;includes&gt;</div><div><span style="white-space:pre">										</span>&lt;include&gt;WEB-INF/web.xml&lt;/include&gt;</div><div><span style="white-space:pre">									</span>&lt;/includes&gt;</div><div><span style="white-space:pre">									</span>&lt;filtering&gt;true&lt;/filtering&gt;</div><div><span style="white-space:pre">								</span>&lt;/resource&gt;</div><div><span style="white-space:pre">							</span>&lt;/webResources&gt;</div><div><span style="white-space:pre">						</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">			</span>&lt;/build&gt;</div><div><span style="white-space:pre">		</span>&lt;/profile&gt;</div><div><span style="white-space:pre">		</span>&lt;profile&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;sit&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;properties&gt;</div><div><span style="white-space:pre">				</span>&lt;staticServer&gt;http://静态资源服务器/dpap/dpap&lt;/staticServer&gt;</div><div><span style="white-space:pre">			</span>&lt;/properties&gt;</div><div><span style="white-space:pre">			</span>&lt;build&gt;</div><div><span style="white-space:pre">				</span>&lt;plugins&gt;</div><div><span style="white-space:pre">					</span>&lt;plugin&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">						</span>&lt;configuration&gt;</div><div><span style="white-space:pre">							</span>&lt;webResources&gt;</div><div><span style="white-space:pre">								</span>&lt;resource&gt;</div><div><span style="white-space:pre">									</span>&lt;directory&gt;src/main/webapp&lt;/directory&gt;</div><div><span style="white-space:pre">									</span>&lt;includes&gt;</div><div><span style="white-space:pre">										</span>&lt;include&gt;WEB-INF/web.xml&lt;/include&gt;</div><div><span style="white-space:pre">									</span>&lt;/includes&gt;</div><div><span style="white-space:pre">									</span>&lt;filtering&gt;true&lt;/filtering&gt;</div><div><span style="white-space:pre">								</span>&lt;/resource&gt;</div><div><span style="white-space:pre">							</span>&lt;/webResources&gt;</div><div><span style="white-space:pre">						</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">			</span>&lt;/build&gt;</div><div><span style="white-space:pre">		</span>&lt;/profile&gt;</div><div><span style="white-space:pre">		</span>&lt;profile&gt;</div><div><span style="white-space:pre">			</span>&lt;id&gt;prd&lt;/id&gt;</div><div><span style="white-space:pre">			</span>&lt;properties&gt;</div><div><span style="white-space:pre">				</span>&lt;staticServer&gt;http://静态资源服务器/dpap/foss&lt;/staticServer&gt;</div><div><span style="white-space:pre">			</span>&lt;/properties&gt;</div><div><span style="white-space:pre">			</span>&lt;build&gt;</div><div><span style="white-space:pre">				</span>&lt;plugins&gt;</div><div><span style="white-space:pre">					</span>&lt;plugin&gt;</div><div><span style="white-space:pre">						</span>&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;</div><div><span style="white-space:pre">						</span>&lt;configuration&gt;</div><div><span style="white-space:pre">							</span>&lt;webResources&gt;</div><div><span style="white-space:pre">								</span>&lt;resource&gt;</div><div><span style="white-space:pre">									</span>&lt;directory&gt;src/main/webapp&lt;/directory&gt;</div><div><span style="white-space:pre">									</span>&lt;includes&gt;</div><div><span style="white-space:pre">										</span>&lt;include&gt;WEB-INF/web.xml&lt;/include&gt;</div><div><span style="white-space:pre">									</span>&lt;/includes&gt;</div><div><span style="white-space:pre">									</span>&lt;filtering&gt;true&lt;/filtering&gt;</div><div><span style="white-space:pre">								</span>&lt;/resource&gt;</div><div><span style="white-space:pre">							</span>&lt;/webResources&gt;</div><div><span style="white-space:pre">						</span>&lt;/configuration&gt;</div><div><span style="white-space:pre">					</span>&lt;/plugin&gt;</div><div><span style="white-space:pre">				</span>&lt;/plugins&gt;</div><div><span style="white-space:pre">			</span>&lt;/build&gt;</div><div><span style="white-space:pre">		</span>&lt;/profile&gt;</div><div><span style="white-space:pre">	</span>&lt;/profiles&gt;</div><div><span style="white-space:pre">	</span>&lt;modules&gt;</div><div><span style="white-space: pre;">		</span>&lt;module&gt;common-login&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-sysconfig&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-frameworkimpl&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-dict&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-monitor&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-message&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-sync&lt;/module&gt;</div><div><span style="white-space:pre">		</span>&lt;module&gt;common-authorization&lt;/module&gt;</div><div><span style="white-space: pre;">	</span>&lt;/modules&gt;</div><div>&lt;/project&gt;</div><img src ="http://www.blogjava.net/quxiangjun/aggbug/422854.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/quxiangjun/" target="_blank">瞿祥军</a> 2015-02-10 17:07 <a href="http://www.blogjava.net/quxiangjun/archive/2015/02/10/422854.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Maven依赖编译出现异常，以及解决思路</title><link>http://www.blogjava.net/quxiangjun/archive/2015/02/09/422833.html</link><dc:creator>瞿祥军</dc:creator><author>瞿祥军</author><pubDate>Mon, 09 Feb 2015 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/quxiangjun/archive/2015/02/09/422833.html</guid><wfw:comment>http://www.blogjava.net/quxiangjun/comments/422833.html</wfw:comment><comments>http://www.blogjava.net/quxiangjun/archive/2015/02/09/422833.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/quxiangjun/comments/commentRss/422833.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/quxiangjun/services/trackbacks/422833.html</trackback:ping><description><![CDATA[<div><br />Maven项目的&nbsp;<br /><div><div>&lt;modules&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-login&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-sysconfig&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-frameworkimpl&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-dict&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-monitor&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-message&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-sync&lt;/module&gt;</div><div><span style="white-space:pre">	</span>&lt;module&gt;common-authorization&lt;/module&gt;</div><div>&lt;/modules&gt;</div><div><span style="white-space:pre">各个模块的依赖关系，在完成整体模块编译之前，需要各个module全部install完成，而且各个需求在maven版本下，存在对应的jar包；</span></div></div><br />如果按照依赖顺序，先编译成功全部的子module，然后在编译对应的parent工程。<br /><br />Maven编译出错信息：<br /><br />Apache Maven 3.0.2 (r1056850; 2011-01-09 08:58:10+0800)</div><div>Java version: 1.6.0_25, vendor: Sun Microsystems Inc.</div><div>Java home: C:\jdk\jdk1.6.0_25\jre</div><div>Default locale: zh_CN, platform encoding: UTF-8</div><div>OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"</div><div>[INFO] Error stacktraces are turned on.</div><div>[DEBUG] Reading global settings from EMBEDDED\conf\settings.xml</div><div>[DEBUG] Reading user settings from d:\232750\.m2\settings.xml</div><div>[DEBUG] Using local repository at D:\232750\.m2\repository</div><div>[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for D:\232750\.m2\repository</div><div>[INFO] Scanning for projects...</div><div>[DEBUG] Extension realms for project com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0: (none)</div><div>[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]</div><div>[WARNING]&nbsp;</div><div>[WARNING] Some problems were encountered while building the effective model for com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0</div><div>[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ com.deppon.dpap.brms.governor:brms-governor:0.9.0, F:\juny.qu\rule_workspace\brms-governor\pom.xml, line 245, column 14</div><div>[WARNING]&nbsp;</div><div>[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.</div><div>[WARNING]&nbsp;</div><div>[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.</div><div>[WARNING]&nbsp;</div><div>[DEBUG] === REACTOR BUILD PLAN ================================================</div><div>[DEBUG] Project: com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0</div><div>[DEBUG] Tasks: &nbsp; [install]</div><div>[DEBUG] Style: &nbsp; Regular</div><div>[DEBUG] =======================================================================</div><div>[INFO] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>[INFO] ------------------------------------------------------------------------</div><div>[INFO] Building brms-governor-web 0.9.0</div><div>[INFO] ------------------------------------------------------------------------</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] Lifecycle default -&gt; [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]</div><div>[DEBUG] Lifecycle clean -&gt; [pre-clean, clean, post-clean]</div><div>[DEBUG] Lifecycle site -&gt; [pre-site, site, post-site, site-deploy]</div><div>[DEBUG] === PROJECT BUILD PLAN ================================================</div><div>[DEBUG] Project: &nbsp; &nbsp; &nbsp; com.deppon.dpap.brms.governor:brms-governor-web:0.9.0</div><div>[DEBUG] Dependencies (collect): []</div><div>[DEBUG] -----------------------------------------------------------------------</div><div>[DEBUG] Goal: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources (default-resources)</div><div>[DEBUG] Style: &nbsp; &nbsp; &nbsp; &nbsp; Regular</div><div>[DEBUG] Configuration: &lt;?xml version="1.0" encoding="UTF-8"?&gt;</div><div>&lt;configuration&gt;</div><div>&nbsp; &lt;buildFilters default-value="${project.build.filters}"/&gt;</div><div>&nbsp; &lt;encoding default-value="${project.build.sourceEncoding}"&gt;${encoding}&lt;/encoding&gt;</div><div>&nbsp; &lt;escapeString default-value="${maven.resources.escapeString}"/&gt;</div><div>&nbsp; &lt;escapeWindowsPaths default-value="true"&gt;${maven.resources.escapeWindowsPaths}&lt;/escapeWindowsPaths&gt;</div><div>&nbsp; &lt;includeEmptyDirs default-value="false"&gt;${maven.resources.includeEmptyDirs}&lt;/includeEmptyDirs&gt;</div><div>&nbsp; &lt;outputDirectory default-value="${project.build.outputDirectory}"/&gt;</div><div>&nbsp; &lt;overwrite default-value="false"&gt;${maven.resources.overwrite}&lt;/overwrite&gt;</div><div>&nbsp; &lt;project default-value="${project}"/&gt;</div><div>&nbsp; &lt;resources default-value="${project.resources}"/&gt;</div><div>&nbsp; &lt;session default-value="${session}"/&gt;</div><div>&nbsp; &lt;useBuildFilters default-value="true"/&gt;</div><div>&nbsp; &lt;useDefaultDelimiters default-value="true"/&gt;</div><div>&lt;/configuration&gt;</div><div></div><div>[DEBUG] =======================================================================</div><div>[DEBUG] com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap:framework-server:jar:1.1.2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.deppon.dpap:framework-shared:jar:1.1.2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.caucho:hessian:jar:4.0.7:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-core:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-beans:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-context:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-aop:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-asm:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-aspects:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.springframework:spring-context-support:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.springframework:spring-test:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-expression:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-instrument:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.springframework:spring-tx:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-jms:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-orm:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-oxm:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-web:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.springframework:spring-webmvc:jar:3.0.5.RELEASE:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; aopalliance:aopalliance:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.aspectj:aspectjweaver:jar:1.6.8:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; cglib:cglib-nodep:jar:2.2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.struts:struts2-core:jar:2.3.15.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.apache.struts.xwork:xwork-core:jar:2.3.15.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; asm:asm:jar:3.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; asm:asm-commons:jar:3.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;asm:asm-tree:jar:3.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.freemarker:freemarker:jar:2.3.19:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ognl:ognl:jar:3.0.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;commons-fileupload:commons-fileupload:jar:1.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.struts:struts2-spring-plugin:jar:2.3.15.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.apache.commons:commons-lang3:jar:3.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.struts:struts2-convention-plugin:jar:2.3.15.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-beanutils:commons-beanutils:jar:1.8.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-lang:commons-lang:jar:2.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-collections:commons-collections:jar:3.2.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-codec:commons-codec:jar:1.5:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-io:commons-io:jar:2.0.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-logging:commons-logging:jar:1.1.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-configuration:commons-configuration:jar:1.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;commons-beanutils:commons-beanutils-core:jar:1.8.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-digester:commons-digester:jar:2.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-pool:commons-pool:jar:1.5.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-dbcp:commons-dbcp:jar:1.4:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-dbutils:commons-dbutils:jar:1.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.mybatis:mybatis:jar:3.0.5:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.mybatis:mybatis-spring:jar:1.0.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; javax.transaction:transaction-api:jar:1.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.quartz-scheduler:quartz:jar:1.8.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.quartz-scheduler:quartz-oracle:jar:1.8.6:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; log4j:log4j:jar:1.2.16:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.slf4j:slf4j-log4j12:jar:1.6.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.slf4j:slf4j-api:jar:1.6.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.codehaus.jackson:jackson-core-asl:jar:1.8.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.codehaus.jackson:jackson-mapper-asl:jar:1.8.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; javax.mail:mail:jar:1.4.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; javax.activation:activation:jar:1.0.2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; javassist:javassist:jar:3.12.1.GA:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.jgroups:jgroups:jar:3.0.10.Final:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; redis.clients:jedis:jar:2.1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.alibaba:fastjson:jar:1.1.35:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.poi:poi:jar:3.8:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.poi:poi-ooxml:jar:3.8:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dom4j:dom4j:jar:1.6.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xml-apis:xml-apis:jar:1.0.b2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.poi:poi-ooxml-schemas:jar:3.8:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stax:stax-api:jar:1.0.1:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.codehaus.groovy:groovy-all:jar:1.7.5:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.lowagie:itext:jar:2.1.7:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bouncycastle:bcmail-jdk14:jar:138:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bouncycastle:bcprov-jdk14:jar:138:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.bouncycastle:bctsp-jdk14:jar:1.38:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; org.bouncycastle:bcprov-jdk14:jar:1.38:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; org.bouncycastle:bcmail-jdk14:jar:1.38:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.lowagie:iTextAsian:jar:2.1.7:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.mongodb:mongo-java-driver:jar:2.9.3:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; commons-net:commons-net:jar:3.2:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; org.apache.ant:ant:jar:1.8.4:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;org.apache.ant:ant-launcher:jar:1.8.4:compile</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap.brms.governor:brms-governor-config:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap.brms.governor:brms-governor-common:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.deppon.dpap.brms.server:brms-server-base:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.deppon.dpap:framework-sso:jar:1.1.2:compile</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap.brms.governor:brms-governor-ruleeditor:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap.brms.governor:brms-governor-rulemanage:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.deppon.dpap.brms.governor:common-dict:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-frameworkimpl:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; com.deppon.dpap.brms.governor:common-login:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-authorization:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-message:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-sync:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:commonservices:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:dhbcore:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:fscontext:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:headers:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:jmqi:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:jms:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:jta:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:mq:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:mqjms:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:pcf:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; com.ibm.mq:providerutil:jar:1.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-sysconfig:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.dpap.brms.governor:common-monitor:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;com.deppon.casclient:casclient:jar:2.1.1:compile</div><div>[DEBUG] &nbsp; &nbsp;com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0:compile</div><div>[DEBUG] &nbsp; &nbsp;oracle:oracle-jdbc:jar:10.1.0.2.0:compile</div><div>[DEBUG] &nbsp; &nbsp;javax.servlet:servlet-api:jar:2.5:provided</div><div>[DEBUG] &nbsp; &nbsp;javax.servlet:jsp-api:jar:2.0:provided</div><div>[DEBUG] &nbsp; &nbsp;org.lazyluke:log4jdbc-remix:jar:0.2.7:compile</div><div>[DEBUG] &nbsp; &nbsp; &nbsp; junit:junit:jar:4.8.2:test (scope managed from compile) (version managed from 4.7)</div><div>[INFO] ------------------------------------------------------------------------</div><div>[INFO] BUILD FAILURE</div><div>[INFO] ------------------------------------------------------------------------</div><div>[INFO] Total time: 0.796s</div><div>[INFO] Finished at: Mon Feb 09 16:52:45 CST 2015</div><div>[INFO] Final Memory: 5M/15M</div><div>[INFO] ------------------------------------------------------------------------</div><div>[ERROR] Failed to execute goal on project brms-governor-web: Could not resolve dependencies for project com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0: Failure to find com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0 in http://私服地址:端口/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -&gt; [Help 1]</div><div>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project brms-governor-web: Could not resolve dependencies for project com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0: Failure to find com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0 in http://私服地址:端口/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:190)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:104)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)</div><div><span style="white-space:pre">	</span>at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)</div><div><span style="white-space:pre">	</span>at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)</div><div><span style="white-space:pre">	</span>at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)</div><div><span style="white-space:pre">	</span>at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)</div><div><span style="white-space:pre">	</span>at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)</div><div><span style="white-space:pre">	</span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span style="white-space:pre">	</span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div><span style="white-space:pre">	</span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div><div><span style="white-space:pre">	</span>at java.lang.reflect.Method.invoke(Method.java:597)</div><div><span style="white-space:pre">	</span>at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)</div><div><span style="white-space:pre">	</span>at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)</div><div><span style="white-space:pre">	</span>at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)</div><div><span style="white-space:pre">	</span>at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)</div><div>Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.deppon.dpap.brms.governor:brms-governor-web:war:0.9.0: Failure to find com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0 in http://私服地址:端口/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced</div><div><span style="white-space:pre">	</span>at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:156)</div><div><span style="white-space:pre">	</span>at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:165)</div><div><span style="white-space:pre">	</span>... 22 more</div><div>Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0 in http://私服地址:端口/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced</div><div><span style="white-space:pre">	</span>at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:526)</div><div><span style="white-space:pre">	</span>at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:304)</div><div><span style="white-space:pre">	</span>at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:334)</div><div><span style="white-space:pre">	</span>at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)</div><div><span style="white-space:pre">	</span>... 23 more</div><div>Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find com.deppon.dpap.brms.governor:brms-governor-monitor:jar:0.9.0 in http://私服地址:端口/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced</div><div><span style="white-space:pre">	</span>at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:186)</div><div><span style="white-space:pre">	</span>at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:408)</div><div><span style="white-space:pre">	</span>... 26 more</div><div>[ERROR]&nbsp;</div><div>[ERROR]&nbsp;</div><div>[ERROR] For more information about the errors and possible solutions, please read the following articles:</div><div>[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException</div><div><br /></div><img src ="http://www.blogjava.net/quxiangjun/aggbug/422833.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/quxiangjun/" target="_blank">瞿祥军</a> 2015-02-09 17:09 <a href="http://www.blogjava.net/quxiangjun/archive/2015/02/09/422833.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于ThreadLocal的使用要求</title><link>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422776.html</link><dc:creator>瞿祥军</dc:creator><author>瞿祥军</author><pubDate>Thu, 05 Feb 2015 11:40:00 GMT</pubDate><guid>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422776.html</guid><wfw:comment>http://www.blogjava.net/quxiangjun/comments/422776.html</wfw:comment><comments>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422776.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/quxiangjun/comments/commentRss/422776.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/quxiangjun/services/trackbacks/422776.html</trackback:ping><description><![CDATA[<br />针对ThreadLocal的使用，如果在ThreadPool的场景中，线程的使用会存在覆盖的问题；这里记录下，后补场景ｄｅｍｏ。<img src ="http://www.blogjava.net/quxiangjun/aggbug/422776.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/quxiangjun/" target="_blank">瞿祥军</a> 2015-02-05 19:40 <a href="http://www.blogjava.net/quxiangjun/archive/2015/02/05/422776.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在drools引擎中如果使用规则表</title><link>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422765.html</link><dc:creator>瞿祥军</dc:creator><author>瞿祥军</author><pubDate>Thu, 05 Feb 2015 06:09:00 GMT</pubDate><guid>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422765.html</guid><wfw:comment>http://www.blogjava.net/quxiangjun/comments/422765.html</wfw:comment><comments>http://www.blogjava.net/quxiangjun/archive/2015/02/05/422765.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/quxiangjun/comments/commentRss/422765.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/quxiangjun/services/trackbacks/422765.html</trackback:ping><description><![CDATA[<strong style="margin: 0px; padding: 0px; font-family: Tahoma; font-size: 19px; line-height: normal;">前提准备：java 虚拟机&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Drools核心库<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Junit4.0以上版本<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;规则Excel模板表（将下面的图片的内容新建到Excel中）<br /><br />典型的用法就是根据excel创建KnowledgeBase,然后将它丢给session执行，执行的参数和结果都在params里面<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">&nbsp; 1</span>&nbsp;<span style="color: #0000FF; ">package</span>&nbsp;com.xxx.yyyy;<br /><span style="color: #008080; ">&nbsp;&nbsp;2</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;&nbsp;3</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.File;<br /><span style="color: #008080; ">&nbsp;&nbsp;4</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.FileInputStream;<br /><span style="color: #008080; ">&nbsp;&nbsp;5</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.InputStream;<br /><span style="color: #008080; ">&nbsp;&nbsp;6</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.util.Arrays;<br /><span style="color: #008080; ">&nbsp;&nbsp;7</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.util.Collection;<br /><span style="color: #008080; ">&nbsp;&nbsp;8</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.util.HashMap;<br /><span style="color: #008080; ">&nbsp;&nbsp;9</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.util.Map;<br /><span style="color: #008080; ">&nbsp;10</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;junit.framework.Assert;<br /><span style="color: #008080; ">&nbsp;11</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.KnowledgeBase;<br /><span style="color: #008080; ">&nbsp;12</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.KnowledgeBaseFactory;<br /><span style="color: #008080; ">&nbsp;13</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.builder.DecisionTableConfiguration;<br /><span style="color: #008080; ">&nbsp;14</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.builder.DecisionTableInputType;<br /><span style="color: #008080; ">&nbsp;15</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.builder.KnowledgeBuilder;<br /><span style="color: #008080; ">&nbsp;16</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.builder.KnowledgeBuilderFactory;<br /><span style="color: #008080; ">&nbsp;17</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.builder.ResourceType;<br /><span style="color: #008080; ">&nbsp;18</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.definition.KnowledgePackage;<br /><span style="color: #008080; ">&nbsp;19</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.io.ResourceFactory;<br /><span style="color: #008080; ">&nbsp;20</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.runtime.StatelessKnowledgeSession;<br /><span style="color: #008080; ">&nbsp;21</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.junit.Test;<br /><span style="color: #008080; ">&nbsp;22</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.junit.runner.RunWith;<br /><span style="color: #008080; ">&nbsp;23</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.junit.runners.Parameterized;<br /><span style="color: #008080; ">&nbsp;24</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.junit.runners.Parameterized.Parameters;<br /><span style="color: #008080; ">&nbsp;25</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;26</span>&nbsp;@RunWith(Parameterized.<span style="color: #0000FF; ">class</span>)<br /><span style="color: #008080; ">&nbsp;27</span>&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">class</span>&nbsp;IsP4PTest<br /><span style="color: #008080; ">&nbsp;28</span>&nbsp;{<br /><span style="color: #008080; ">&nbsp;29</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;IsP4P&nbsp;param;<br /><span style="color: #008080; ">&nbsp;30</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;31</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;String&nbsp;extected;<br /><span style="color: #008080; ">&nbsp;32</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;33</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;IsP4PTest(IsP4P&nbsp;param,&nbsp;String&nbsp;extected)<br /><span style="color: #008080; ">&nbsp;34</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;35</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">this</span>.param&nbsp;=&nbsp;param;<br /><span style="color: #008080; ">&nbsp;36</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">this</span>.extected&nbsp;=&nbsp;extected;<br /><span style="color: #008080; ">&nbsp;37</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><span style="color: #008080; ">&nbsp;38</span>&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;getParams()<br /><span style="color: #008080; ">&nbsp;39</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;40</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;params&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;HashMap&lt;String,&nbsp;Object&gt;();<br /><span style="color: #008080; ">&nbsp;41</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;42</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.put("productLine",&nbsp;productLine);<br /><span style="color: #008080; ">&nbsp;43</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.put("productType",&nbsp;productType);<br /><span style="color: #008080; ">&nbsp;44</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.put("playType",&nbsp;playType);<br /><span style="color: #008080; ">&nbsp;45</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;46</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;params;<br /><span style="color: #008080; ">&nbsp;47</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><span style="color: #008080; ">&nbsp;48</span>&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;testExcel(String&nbsp;fileName,&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;params)<br /><span style="color: #008080; ">&nbsp;49</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;Exception<br /><span style="color: #008080; ">&nbsp;50</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;51</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("---------------begin------------------------");<br /><span style="color: #008080; ">&nbsp;52</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;53</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DecisionTableConfiguration&nbsp;dtableconfiguration&nbsp;=&nbsp;KnowledgeBuilderFactory<br /><span style="color: #008080; ">&nbsp;54</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.newDecisionTableConfiguration();<br /><span style="color: #008080; ">&nbsp;55</span>&nbsp;dtableconfiguration.setInputType(DecisionTableInputType.XLS);<br /><span style="color: #008080; ">&nbsp;56</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">final</span>&nbsp;KnowledgeBuilder&nbsp;kbuilder&nbsp;=&nbsp;KnowledgeBuilderFactory<br /><span style="color: #008080; ">&nbsp;57</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.newKnowledgeBuilder();<br /><span style="color: #008080; ">&nbsp;58</span>&nbsp;File&nbsp;file&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File(<br /><span style="color: #008080; ">&nbsp;59</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"F:\\juny.qu\\rule_workspace\\com.deppon.rules\\src\\main\\java\\com\\xxx\\yyyy\\"<br /><span style="color: #008080; ">&nbsp;60</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;fileName);<br /><span style="color: #008080; ">&nbsp;61</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;is&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;FileInputStream(file);<br /><span style="color: #008080; ">&nbsp;62</span>&nbsp;kbuilder.add(ResourceFactory.newInputStreamResource(is,&nbsp;"UTF-8"),<br /><span style="color: #008080; ">&nbsp;63</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResourceType.DTABLE);<br /><span style="color: #008080; ">&nbsp;64</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;(kbuilder.hasErrors())<br /><span style="color: #008080; ">&nbsp;65</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;66</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(kbuilder.getErrors().toString());<br /><span style="color: #008080; ">&nbsp;67</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><span style="color: #008080; ">&nbsp;68</span>&nbsp;Collection&lt;KnowledgePackage&gt;&nbsp;pkgs&nbsp;=&nbsp;kbuilder.getKnowledgePackages();<br /><span style="color: #008080; ">&nbsp;69</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KnowledgeBase&nbsp;kbase&nbsp;=&nbsp;KnowledgeBaseFactory.newKnowledgeBase();<br /><span style="color: #008080; ">&nbsp;70</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kbase.addKnowledgePackages(pkgs);<br /><span style="color: #008080; ">&nbsp;71</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;72</span>&nbsp;StatelessKnowledgeSession&nbsp;ksession&nbsp;=&nbsp;kbase<br /><span style="color: #008080; ">&nbsp;73</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.newStatelessKnowledgeSession();<br /><span style="color: #008080; ">&nbsp;74</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ksession.execute(Arrays.asList(<span style="color: #0000FF; ">new</span>&nbsp;Object[]&nbsp;{&nbsp;params&nbsp;}));<br /><span style="color: #008080; ">&nbsp;75</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;76</span>&nbsp;System.out.println("---------------end------------------------");<br /><span style="color: #008080; ">&nbsp;77</span>&nbsp;}<br /><span style="color: #008080; ">&nbsp;78</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;79</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;80</span>&nbsp;@Parameters<br /><span style="color: #008080; ">&nbsp;81</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">static</span>&nbsp;Collection&lt;?&gt;&nbsp;contructData()<br /><span style="color: #008080; ">&nbsp;82</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;83</span>&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;Arrays.asList(<span style="color: #0000FF; ">new</span>&nbsp;Object[][]&nbsp;{<br /><span style="color: #008080; ">&nbsp;84</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;IsP4P("搜索推广",&nbsp;"true",&nbsp;"null"),&nbsp;"true"&nbsp;},<br /><span style="color: #008080; ">&nbsp;85</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;IsP4P("网盟推广",&nbsp;"true",&nbsp;"null"),&nbsp;"true"&nbsp;},<br /><span style="color: #008080; ">&nbsp;86</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;IsP4P("掘金推广",&nbsp;"true",&nbsp;"非轮播"),&nbsp;"false"&nbsp;},<br /><span style="color: #008080; ">&nbsp;87</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;IsP4P("其他",&nbsp;"false",&nbsp;"其他"),&nbsp;"other"&nbsp;}&nbsp;});<br /><span style="color: #008080; ">&nbsp;88</span>&nbsp;}<br /><span style="color: #008080; ">&nbsp;89</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;90</span>&nbsp;@Test<br /><span style="color: #008080; ">&nbsp;91</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;testP4P()&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;Exception<br /><span style="color: #008080; ">&nbsp;92</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /><span style="color: #008080; ">&nbsp;93</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&lt;String,&nbsp;Object&gt;&nbsp;params&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;HashMap&lt;String,&nbsp;Object&gt;();<br /><span style="color: #008080; ">&nbsp;94</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;params.putAll(param.getParams());<br /><span style="color: #008080; ">&nbsp;95</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;testExcel("ka/isP4P.xls",&nbsp;params);<br /><span style="color: #008080; ">&nbsp;96</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assert.assertEquals(extected,&nbsp;params.get("isP4P"));<br /><span style="color: #008080; ">&nbsp;97</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><span style="color: #008080; ">&nbsp;98</span>&nbsp;}<br /><span style="color: #008080; ">&nbsp;99</span>&nbsp;<br /><span style="color: #008080; ">100</span>&nbsp;</div></strong><pre name="code" style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-size: 19px; line-height: normal;"><br /><div style="font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; background-color: #eeeeee;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">&nbsp;1</span>&nbsp;<span style="color: #0000FF; ">package</span>&nbsp;com.xxx.yyyy;<br /><span style="color: #008080; ">&nbsp;2</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;3</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.File;<br /><span style="color: #008080; ">&nbsp;4</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.FileInputStream;<br /><span style="color: #008080; ">&nbsp;5</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.FileNotFoundException;<br /><span style="color: #008080; ">&nbsp;6</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;java.io.InputStream;<br /><span style="color: #008080; ">&nbsp;7</span>&nbsp;<br /><span style="color: #008080; ">&nbsp;8</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.decisiontable.InputType;<br /><span style="color: #008080; ">&nbsp;9</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.drools.decisiontable.SpreadsheetCompiler;<br /><span style="color: #008080; ">10</span>&nbsp;<span style="color: #0000FF; ">import</span>&nbsp;org.junit.Test;<br /><span style="color: #008080; ">11</span>&nbsp;<br /><span style="color: #008080; ">12</span>&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">class</span>&nbsp;SpreadsheetCompilerTest&nbsp;{<br /><span style="color: #008080; ">13</span>&nbsp;<br /><span style="color: #008080; ">14</span>&nbsp;@Test<br /><span style="color: #008080; ">15</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;compile()&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;FileNotFoundException{<br /><span style="color: #008080; ">16</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">File&nbsp;file&nbsp;=&nbsp;new&nbsp;File("F:\\juny.qu\\rule_workspace\\com.deppon.rules\\src\\main\\java\\com\\xxx\\yyyy\\ka\\isP4P.xls");<br /></span><span style="color: #008080; ">17</span>&nbsp;<span style="color: #008000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">File&nbsp;file&nbsp;=&nbsp;new&nbsp;File("F:\\collections_study\\规则引擎系统开发小组\\规则引擎doc\\02开发\\06-详细设计\\增值服务折扣测试1.xls");</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">18</span>&nbsp;<span style="color: #008000; "></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;file&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File("F:\\rules.xlsx");<br /><span style="color: #008080; ">19</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #008080; ">20</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;is&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;FileInputStream(file);<br /><span style="color: #008080; ">21</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #008080; ">22</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SpreadsheetCompiler&nbsp;converter&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;SpreadsheetCompiler();<br /><span style="color: #008080; ">23</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;drl&nbsp;=&nbsp;converter.compile(is,&nbsp;InputType.XLS);&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">--------exception&nbsp;here--------&nbsp;</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">24</span>&nbsp;<span style="color: #008000; "></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("\n\n"&nbsp;+&nbsp;drl);<br /><span style="color: #008080; ">25</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #008080; ">26</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><span style="color: #008080; ">27</span>&nbsp;<br /><span style="color: #008080; ">28</span>&nbsp;}</div><div><div><ul style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; font-family: Tahoma; font-size: medium; white-space: normal;"><li style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; font-size: 19px;"><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #3665ee;">什么时候考虑使用规则表</span></li></ul><div style="margin: 0px; font-family: Tahoma; white-space: normal;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">&nbsp; 如果规则可以表示成</span>&nbsp;<span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">templates+data(</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">模板＋数据),可以考虑使用</span>&nbsp;<span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">decision tables</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">。在决策表的每一行，采集数据和模板一起生成规则。</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">使用基于决策表的</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">Spreadsheet</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">的</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">API</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">在</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">Drools-decisiontables</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">模块中。只有一个类：</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">SpreadsheetCompiler.</span>&nbsp;<span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">这个类可以操作各种格式的</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">Spreadsheet</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">，并生成</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: Calibri;">DRL</span><span style="margin: 0px; padding: 0px; list-style: none outside none; word-break: normal; word-wrap: break-word; color: #010101; font-family: 宋体;">规则（然后就可以常规的方式使用）。</span></strong></div><span style="font-size: 12px;"><br /></span><span style="color: #3665ee; font-family: 宋体; white-space: normal;">一个典型的规则表的格式<br /><img src="http://www.blogjava.net/images/blogjava_net/quxiangjun/规则信息.jpg" width="1262" height="580" alt="" /><br /><br /><br /><br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"></div></div></div></pre><img src ="http://www.blogjava.net/quxiangjun/aggbug/422765.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/quxiangjun/" target="_blank">瞿祥军</a> 2015-02-05 14:09 <a href="http://www.blogjava.net/quxiangjun/archive/2015/02/05/422765.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Drools中文乱码解决</title><link>http://www.blogjava.net/quxiangjun/archive/2015/02/04/422739.html</link><dc:creator>瞿祥军</dc:creator><author>瞿祥军</author><pubDate>Wed, 04 Feb 2015 07:22:00 GMT</pubDate><guid>http://www.blogjava.net/quxiangjun/archive/2015/02/04/422739.html</guid><wfw:comment>http://www.blogjava.net/quxiangjun/comments/422739.html</wfw:comment><comments>http://www.blogjava.net/quxiangjun/archive/2015/02/04/422739.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/quxiangjun/comments/commentRss/422739.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/quxiangjun/services/trackbacks/422739.html</trackback:ping><description><![CDATA[<p>&nbsp; &nbsp; &nbsp;项目中用到了规则引擎，后来选用了drools开源的实现，后来部署的linux环境后乱码，在本地不乱码，所以第一时间就想到了应该是drools内部取了操作系统默认的编码了 。<span>凡是乱码基本上是字节和字符之间相互转换的时候出现的，经过仔细排查，发现将规则文件加入到session里面的时候没有给编码，于是加上。<br /><br /></span><strong style="font-size: 18pt; color: #ff0000;"><span style="font-size: 14pt;">加载规则文件的时候必须指定编码，比如UTF-8</span><span><br /></span></strong><strong><span>中文乱码代码：</span></strong></p><p><strong></strong></p><div>Reader reader = new FileReader(new File("F:/WorkFolder/drools/drl/addpoint.drl"));</div><div style="font-weight: bold;">解决方法：</div><div>Reader reader = new InputStreamReader(new FileInputStream("F:/WorkFolder/drools/drl/addpoint.drl"),"UTF-8");<br /><span style="font-weight: normal; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><br />加上这一处编码还是不行，后来发现我们用的decisiontable的解码是用的jxl，在网上看，jxl的解析也有可能产生乱码，于是加上：<br /></span><strong style="font-weight: bold; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><span style="color: #ff0000; font-size: 20px;">给容器启动的时候设置jxl的编码<br /></span></strong><div><strong>System.setProperty("jxl.encoding", "UTF-8");<br /></strong><br /><span style="background-color: #ffffff;"><font face="Helvetica, Tahoma, Arial, sans-serif"><span style="line-height: 25.2000007629395px;">加上这两个系统参数，也是乱码，经过调试发现，org.drools.rule.builder.dialect.java.JavaDialect类里面的addClassCompileTask方法有将字符超字节转换的代码，如下：</span></font><br /></span><div><span style="line-height: 25.2000007629395px;">public void addClassCompileTask(final String className,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;final BaseDescr descr,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;final String text,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;final MemoryResourceReader src,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;final ErrorHandler handler) {</span></div><div><span style="line-height: 25.2000007629395px;"><br /></span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; final String fileName = className.replace( '.',</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'/' ) + ".java";</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; try {</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="white-space:pre">	</span> if (src != null) {</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;src.add( fileName,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text.getBytes() );</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.src.add( fileName,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;text.getBytes() );</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; } catch (final UnsupportedEncodingException e ) {</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new RuntimeException("unable to encoding the rule!");</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp;</span></div><div><span style="line-height: 25.2000007629395px;"><br /></span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; this.errorHandlers.put( fileName,</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handler );</span></div><div><span style="line-height: 25.2000007629395px;"><br /></span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; addClassName( fileName );</span></div><div><span style="line-height: 25.2000007629395px;">&nbsp; &nbsp; }<br /><br /></span><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;">我们再来看一下String的getBytes方法的实现，这个方法里面默认取平台的编码的，至此，我们就知道病根了，所以比较简单了，加上-Dfile.encoding=UTF8参数就可以了。注意，这个地方是UTF8，不是UTF-8,具体的解释看官方文档:&nbsp;</span><a target="_blank" href="http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html" style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; color: #108ac6; background-color: #ffffff;">http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html</a><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;">，最后这个也是在tomcat的启动参数里面加上-Dfile.encoding=UTF8</span><ul style="margin: 0px 0px 1.5em; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><li style="margin: 0px 0px 0.25em 30px; padding: 0px;"><strong><span style="color: #ff0000; font-size: 18px;">在tomcat的启动<strong style="line-height: 25.2000007629395px; font-size: 14px;"><span style="font-size: 18px;"><div style="display: inline !important;">catalina.bat/<strong style="line-height: 25.2000007629395px; font-size: 14px;"><span style="font-size: 18px;"><strong style="line-height: 25.2000007629395px; font-size: 14px;"><span style="font-size: 18px;"><div style="display: inline !important;">catalina.sh</div></span></strong></span></strong><strong style="line-height: 25.2000007629395px; font-size: 14px;"><span style="font-size: 18px;"><strong style="line-height: 25.2000007629395px; font-size: 14px;"><span style="font-size: 18px;">参数里面加上-Dfile.encoding=UTF8</span></strong></span></strong></div></span></strong></span></strong></li></ul><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><span style="color: #003300; font-size: large;"><span style="line-height: 27px;">CATALINA_OPTS="-Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Xss128k -server -Xdebug -Xnoagent -Djav</span></span></p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><span style="color: #003300; font-size: large;"><span style="line-height: 27px;">a.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8530&nbsp;<span style="color: #ff0000;">-Dfile.encoding=UTF8</span>"</span></span></p><span style="line-height: 25.2000007629395px;"><br /></span><ul style="margin: 0px 0px 1.5em; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.2000007629395px; background-color: #ffffff;"><li style="margin: 0px 0px 0.25em 30px; padding: 0px;"><strong><span style="color: #ff0000; font-size: 18px;">在maven跑junit测试的时候加上这个参数-Dfile.encoding=UTF-8<br /></span></strong></li></ul><strong style="background-color: #ffffff;"><font color="#0000ff" face="Helvetica, Tahoma, Arial, sans-serif"><span style="font-size: 18px; line-height: 25.2000007629395px;">如果不加这个测试，在junit跑测试的时候还会使用操作系统的默认字符集，会导致测试失败:<br /></span></font></strong><span style="font-size: 18px; line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;plugin&gt;</span><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">				</span>&lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">				</span>&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">				</span>&lt;version&gt;2.11&lt;/version&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">				</span>&lt;configuration&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;argLine&gt;-Dfile.encoding=utf-8&lt;/argLine&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;parallel&gt;methods&lt;/parallel&gt; &nbsp;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="white-space:pre">			</span>&lt;threadCount&gt;10&lt;/threadCount&gt; &nbsp;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;includes&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">						</span>&lt;include&gt;**/*Test.java&lt;/include&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;/includes&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;excludes&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">						</span>&lt;exclude&gt;**/BaseControllerTest.java&lt;/exclude&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">						</span>&lt;exclude&gt;**/BaseTest.java&lt;/exclude&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">						</span>&lt;exclude&gt;**/TestUtils.java&lt;/exclude&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">					</span>&lt;/excludes&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space:pre">				</span>&lt;/configuration&gt;</span></div><div><span style="font-size: 18px; line-height: 25.2000007629395px;"><span style="white-space: pre;">			</span>&lt;/plugin&gt;</span></div><strong style="background-color: #ffffff;"><br />这里乱码问题告一段落！<br /><br /></strong><br /><span style="line-height: 25.2000007629395px;"><br /><br /><br /></span></div></div></div><img src ="http://www.blogjava.net/quxiangjun/aggbug/422739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/quxiangjun/" target="_blank">瞿祥军</a> 2015-02-04 15:22 <a href="http://www.blogjava.net/quxiangjun/archive/2015/02/04/422739.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>