Maven Plugin Notes

maven-jar-plugin

  1. 协助Jar打包
  2. org.apache.maven.plugins
    maven-jar-plugin



    sparkexample1.App


maven-assembly-plugin

  1. The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive.
  2. org.apache.maven.plugins
    maven-assembly-plugin
    2.4


    jar-with-dependencies



    com.your-package.MainClass




    package
    single


手动添加jar包以满足mvn依赖需求

1.加载jar包到本地 (以加载saxon-dom-9.0.jar为例)

首先在工程的pom.xml文件中加入


net.sf.saxon
saxon-dom
9.0

pom.xml配置完成后,再执行以下命令:

mvn install:install-file -DgroupId=net.sf.saxon -DartifactId=saxon-dom -Dversion=9.0 -Dpackaging=jar -Dfile=/home/ubuntu/saxon-dom-9.0.jar

说明:-Dfile指第三方jar的路径,其它的注意要确保maven命令中groupId、artifactId、version与pom.xml中的配置相同,-Dpackaging表示加载的文件类型

  1. 例子:
    mvn install:install-file -DgroupId=log4j -DartifactId=log4j -Dversion=1.2.17 -Dpackaging=jar -Dfile=/home/rao/.m2/repository/log4j-1.2.17.jar

mvn install:install-file -DgroupId=org.apache.htrace -DartifactId=htrace-core -Dversion=3.1.0-incubating -Dpackaging=jar -Dfile=/home/rao/.m2/repository/htrace-core-3.1.0-incubating.jar

Software Engineering Study Notes

Productivity v.s. Complexity

Over engineering happens when the productivity gained does not worth the effort of work and the complexity added into the system.

Memory Safety

A concern in software development that aims to avoid software bugs that cause security vulnerability dealing with random-memory-access, such as buffer overflows and dangling pointers.

Type Safety

Type safety is the extent to which a programming language discourages or prevents type errors.