The MAVEN project structure module generates a separate jar

Source: Internet
Author: User
Tags stack trace

Generate Jar

The process of generating the jar has the following problems:

After the clean is finished, the following questions will appear:

"D:\Program Files\java\jdk\jdk1.8.0_31\bin\java" "-dmaven.home=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3" "-dclassworlds.conf=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3\bin\m2.conf "-didea.launcher.port=7535 "-didea.launcher.bin.path=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\bin"-dfile.encoding=gbk-classpath"D:\Program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar ;D: \program Files (x86) \jetbrains\intellij idea 14.1.2\lib\idea_rt.jar"Com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.launcher-didea.version=14.1.2Install[info] Scanning forprojects ...                                                                         [INFO] [INFO]------------------------------------------------------------------------[INFO] Building Oxgren-common1.0-Snapshot[info]------------------------------------------------------------------------[INFO] [INFO]---maven-resources-plugin:2.5: Resources (default-resources) @ Oxgren-common---[Debug] Execute contextualize[warning] Using platform encoding (GBK actually) to copy filtered resources, i.e. build /c2> isPlatform dependent![INFO] Copying0Resource[info] [INFO]---maven-compiler-plugin:2.3.2: Compile (default-compile) @ Oxgren-common---[WARNING] File encoding have not beenSet,usingPlatform encoding GBK, i.e. build isPlatform dependent![INFO] Compiling5source Files to D:\JavaWorkSpace\oxgren\oxgren-Common\target\classes[info]-------------------------------------------------------------[ERROR] compilation ERROR: [INFO]-------------------------------------------------------------[ERROR] Unable to locate the Javac Compilerinch: D:\Program files\java\jdk\jdk1.8. 0_31\. \lib\tools.jarplease ensureusingJdk1.4or above Andnot a JRE (the Com.sun.tools.javac.Mainclass  isrequired). In most cases you can change the location of your javainstallation by setting the JAVA_HOME environment variable. [INFO]1Error[info]-------------------------------------------------------------[INFO]------------------------------------------------------------------------[INFO] BUILD Failure[info]------------------------------------------------------------------------[INFO] Total time:1. 114s[info] finished At:mon Sep -  -: .:GenevaCst -[INFO] Final memory:7m/164m[info]------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2: Compile (default-compile) on Project oxgren-Common:compilation Failure[error] Unable to locate the Javac Compilerinch: [ERROR] D:\Program files\java\jdk\jdk1.8. 0_31\. \lib\tools.jar[error] Please ensureusingJdk1.4or above And[error] not a JRE (the Com.sun.tools.javac.Mainclass  isrequired). [ERROR] Cases you can change the location of your java[error] installation by setting the Java_home environment variable.[ ERROR]--[Help1][error] [ERROR] to see the full stack trace of the errors, re-run Maven with The-eSwitch. [ERROR] Re-run MavenusingThe-xSwitchTo enable full debug logging. [ERROR] [ERROR] For more information on the errors and possible solutions, please read the following articles:[error] [ Help1] http://cwiki.apache.org/confluence/display/maven/mojofailureexceptionProcess finished with exit code1

Compile module on the directory and then install it to build the jar package.

JRE can't find not to care so much about that right below

"D:\Program Files\java\jdk\jdk1.8.0_31\bin\java" "-dmaven.home=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3" "-dclassworlds.conf=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3\bin\m2.conf "-didea.launcher.port=7537 "-didea.launcher.bin.path=d:\program Files (x86) \jetbrains\intellij idea 14.1.2\bin"-dfile.encoding=gbk-classpath"D:\Program Files (x86) \jetbrains\intellij idea 14.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar ;D: \program Files (x86) \jetbrains\intellij idea 14.1.2\lib\idea_rt.jar"Com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.launcher-didea.version=14.1.2Install[info] Scanning forprojects ...                                                                         [INFO] [INFO]------------------------------------------------------------------------[INFO] Building Oxgren-common1.0-Snapshot[info]------------------------------------------------------------------------[INFO] [INFO]---maven-resources-plugin:2.5: Resources (default-resources) @ Oxgren-common---[Debug] Execute contextualize[warning] Using platform encoding (GBK actually) to copy filtered resources, i.e. build /c5> isPlatform dependent![INFO] Copying0Resource[info] [INFO]---maven-compiler-plugin:2.3.2: Compile (default-compile) @ Oxgren-common---[INFO] nothing to compile-All classes is up to date[info] [INFO]---maven-resources-plugin:2.5: Testresources (default-testresources) @ Oxgren-common---[Debug] Execute contextualize[warning] Using platform encoding (GBK actually) to copy filtered resources, i.e. build /c7> isPlatform dependent![INFO] Skip non existing resourcedirectory D:\JavaWorkSpace\oxgren\oxgren-Common\src\test\resources[info] [INFO]---maven-compiler-plugin:2.3.2: Testcompile (default-testcompile) @ Oxgren-common---[INFO] nothing to compile-All classes is up to date[info] [INFO]---maven-surefire-plugin:2.10: Test (default-test) @ Oxgren-common---[INFO] Surefire report Directory:d:\javaworkspace\oxgren\oxgren-common\target\surefire-reports-------------------------------------------------------T E s T s-------------------------------------------------------Running base64handertestencodestr:6L+b5ywlamf2yeeahos4luevja==Urlencodestr:6L-b5ywlamf2yeeahos4luevja==Mimeencodestr:6L+b5ywlamf2yeeahos4luevja==Tests Run:1, Failures:0, Errors:0, skipped:0, Time elapsed:0.094secrunning withattachmentmessagetest Send mail tests run:1, Failures:0, Errors:0, skipped:0, Time elapsed:0.125secresults:tests Run:2, Failures:0, Errors:0, skipped:0[INFO] [INFO]---maven-jar-plugin:2.3.2: Jar (default-jar) @ Oxgren-common---[INFO] Building Jar:d:\javaworkspace\oxgren\oxgren-common\target\oxgren-common-1.0-Snapshot.jar[info] [INFO]---maven-install-plugin:2.3.1: Install (default-install) @ Oxgren-common---[INFO] Installing D:\JavaWorkSpace\oxgren\oxgren-common\target\oxgren-common-1.0-snapshot.jar to C:\Users\yuchao\.m2\repository\oxgren\oxgren-common\1.0-snapshot\oxgren-common-1.0-Snapshot.jar[info] Installing D:\JavaWorkSpace\oxgren\oxgren-common\pom.xml to C:\Users\yuchao\.m2\repository\oxgren\oxgren-common\1.0-snapshot\oxgren-common-1.0-Snapshot.pom[info]------------------------------------------------------------------------[INFO] BUILD Success[info]------------------------------------------------------------------------[INFO] Total time:2. 785s[info] finished At:mon Sep -  -: at: $Cst -[INFO] Final memory:9m/164m[info]------------------------------------------------------------------------Process finished with exit code0

The jar cannot be completed if test has content that does not pass

The MAVEN project structure module generates a separate jar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.