maven 编译或打包时报错: 

程序包com.sun.xml.internal.messaging.saaj.util不存在 

需要添加:

<compilerArguments>
	<verbose />
	<bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
</compilerArguments>

 配置rt.jar:

<plugin>

 <groupId>org.apache.maven.plugins</groupId>

 <artifactId>maven-compiler-plugin</artifactId>

 <version>3.0</version>

 <configuration>

 <compilerArguments>

  <Xlint />

 </compilerArguments>

 <verbose>true</verbose>

  <source>${java.version}</source>

  <target>${java.version}</target>

  <showWarnings>true</showWarnings>

 <!--  rt包没有打到项目中去 -->

  <compilerArguments>

   <verbose />

   <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>

 </compilerArguments>

</configuration>

</plugin>

或者直接添加:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
        <encoding>UTF-8</encoding>
        <compilerArguments>
        <verbose/>
        <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
        </compilerArguments>
    </configuration>
</plugin>

${path.separator}这个分隔符,在Windows系统下是“;”分号,在Linux下是“:”冒号。 
为了使打包时自动选择,可以使用${path.separator}

更多推荐