Dicom:dcm4che Open Source Project import Eclipse compilation error Problem solution

Source: Internet
Author: User
Tags python script

Background:

Immediately across the years, remember when the New Year's Day is not a thing, how to grow up to grow up feeling more and more lively instead. Various dinners, various party, a little hold. Or come back to tidy up this year's notes more comfortable, more rewarding. Look at this month unexpectedly send volume still less than four, then will Evernote in an old article paste out of water, who happened to solve the previous e-mail before the related problems.

Dcm4che Open Source project:

Dcm4che3 is an open source project on GitHub and is a Java-implemented Dicom Open Source Library built with Maven. The entire project under the Windows file system directly MVN install can succeed successfully. However, the following error occurred after importing into the Eclipse Mars version:

Solution:

Official reference

The problem occurs because the M2E Eclipse plugin for MAVEN plugin does not support execution in pom.xml files

Scope of MAVEN dependencies
When a

defines a dependency on a project, we can specify the scope of the dependency by scope. Scope values are compile, runtime, test, provided, system, and import.
Compile : This is the default scope for dependencies, which means that compile is used by default when no scope is specified for a dependency. Dependencies in the compile range are valid in all cases, including run, test, and compile time.
Runtime : Indicates that the dependency is only required at run time and is not required at compile time. This type of dependency will be accessible under the classpath of Run and test.
Test : Indicates that the dependency is only useful for testing, including the compilation and operation of the test code, and has no effect on normal project runs.
provided : Indicates that the dependency will be provided by the JDK or run container at run time, which means that the dependency provided by Maven is only used when compiling and testing, and will be provided by the JDK or runtime container at runtime.
System : When scope is system, it means that the dependency is provided by us and does not need maven to go to the warehouse to find it. Specifying scope as system needs to be used with another property element, Systempath, which represents the location of the dependency on the current system, using an absolute path.

"Note":
Referring to the above scenarios, you can successfully resolve the following Eclipse import Dcm4che project prompt error,

And you can perform dmc4che maven compilation successfully in Eclipse, because the modified xxxx/.metadata/.plugins/org.eclipse.m2e.core/ The meaning of the Lifecycle-mapping-metadata.xml file is to make the Maven plugin for Eclipse M2E ignore its unrecognized execute and goal tags, but in the eclipse main interface we can see that there are hundreds of Error, indicating that the associated jar dependency package is missing.

But after Maven finishes compiling, we can see that the corresponding jar packages have been generated in each directory and have been successfully installed in the local Maven repository, so why are there many engineering tips missing from the Dcm4che?

Take a closer look at the solution we used in the official reference, we found that the execute and goal objects we ignored only addressed the error hints of the M2E control, but ignored the two execute and goal ( Note: In fact, the execute and goal in Maven's pom.xml are similar to the common post-compilation events in VS, or a script that is dependent on the dependency configuration of the user maven after each submodule has been compiled. is to add the dependencies of the MAVEN modules, resulting in a missing jar package error in the project.

To verify this, manually add the corresponding jar package to the corresponding project and find that the error hints are reduced, as in the Dcm4che-core project except for the Pom.xml error.

It can be inferred that the official solution is only to solve the m2e control unrecognized pom.xml part of the error, but in the Eclipse project Pom.xml in addition to start Maven compile time with the project modification, compilation, debugging does not matter, Therefore, our main purpose is not to solve the pom.xml error, but mainly to solve the Dcm4che project under the dependency of the module error. So how did it work out? The execution and goal tags in pom.xml that are not recognized by Eclipse's m2e control are exactly what Maven uses to complete the dependencies of the Dcm4che engineering modules?

The best solution:

In fact, the solution is simple and the Dmc4che engineering tip in Eclipse is missing the jar package error. The reason is not that the Dcm4che project source code in the Pom.xml itself is written incorrectly, but the Eclipse matching maven plugin M2E does not successfully identify execution and goal related fields.
The Dcm4che project was compiled using Eclipse's M2E, which was designed to be convenient because M2E was compiled automatically when importing MAVEN projects. Since there is a problem with the m2e control, can we compile it with the Maven tool and then import it with the Eclipse tool after the compilation is complete?

cd c:\dcm4che3-mvn\dcm4che-mastermvn installmvn eclipse:eclipse

Note: The Maven tool version used locally is 3.2.5

Once the above command line runs successfully, you can see that Dcm4che-master has one more. Project's Eclipse project file under each project module, which can be imported directly from Eclipse's import. There are only a few project Pom.xml file hint errors after import, that is, the above mentioned M2E control unrecognized execution and goal tags, but the previous mentioned Dmc4che each module missing jar package error All resolved, you can see Pom.xml control module dependencies execution to And goal have been executed successfully at MVN Eclipse:eclipse (the Maven tool itself is capable of identifying execution and goal) as shown in:

Solution 2:

Now that we have determined that MVN has successfully compiled and generated the jar packages and related code for each module, it is suggested that the error of missing jar packages is because M2E cannot perform execution to configure the dependencies of each module. Follow the error prompts to search for and download installation-related plugins in Eclipse's marketplace, as well as resolve dependency issues.

Solution 3:

In the StackOverflow there is a simple solution, although the vote is not high, but from the simplicity of the most reliable.

Errors occurred during the build.
Errors running builder ' Maven Project Builder ' on Project ' Dcm4che-dict '.
No Enum Constant Org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction.executor
Errors running builder ' Maven Project Builder ' on Project ' Dcm4che-js-dict '.
No Enum Constant Org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction.executor
After verification, the programme is still not implemented.

After installing the plug-in, you can compile and debug the Python script in Eclipse, and you can use its "Quick auto-config" during the configuration of the plug-in to resolve the intent of creating a Python green free install package.




[Email protected]
Date: 2015-12-31

Dicom:dcm4che Open Source Project import Eclipse compilation error Problem solution

Related Article

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.