I am facing error when building Openmrs-core on windows with the following system environment settings:
java version: 1.7.0_71
maven version: 3.2.5
Below is the error message:
Failed to execute goal com.mycila:license-maven-plugin:2.6:check (default)on project openmrs-webapp: Some files do not have the expected license header.
Which version of OpenMRS-Core are you trying to build? and I don’t know if this should matter but, how are you trying to build - eclipse, intellij, command prompt?
If you are not planning on developing/contributing code to OpenMRS-Core or any other module, I would suggest trying to build and use a released version like 1.10.2 or 1.11.2 (using git checkout). As I believe, the code is changing each moment for .x(1.10.x or 1.11.x and so on) branches having chances of bad code, and in this case there might be some files without license headers and giving the build errors.
Can you please look at the logs are see what are the offending files? That plugin always lists them out, if you have added new files make sure they have the license and should be the new MPL license
@Maurya: Thanks for your suggestion. As I plan to build the module on the OpenMRS platform, I would still need to compile and run the openmrs-core. This would also enable to run the openmrs-webapp on a local server to actually install and manage the modules, if required later.
I would do what @wyclif mentioned as it would help find out which files have the problem.
Secondly, I might have wrongly implied that you had to deploy the war from the downloads. I asked to to git checkout that code and build and deploy them, that way you still can debug and run it in the local.
@wyclif: Thank you for your suggestion. I have created new files for the edtriage module using maven archetype and have not added any files to the OpenMRS core. As I am building the module on the OpenMRS platform which is 1.10x (suggested by mentor), I was trying to run openmrs webapp to install the module. The openmrs version in the current pom file is 1.10.3 .
Can you give some details how do I know the problematic files listed by plugin.
Am certainly sure that the module archetype is still generating files with the incorrect header, we need to update it to have the new license. Sorry but you have to manually replace the headers in your java classes to this:
@wyclif, @darius and @maurya: Thank you for providing me with various options in resolving this issue. I am now able to successfully build OpenMRS-core on 1.10.x after updating to the new licence.
Hi
Great to see @manikam that you were able to resolve this issue.
I am trying to build openmrs core 1.12.x using JDK 1.8 and running into the same issue. I just cloned the repository today and got the same error on doing a ‘mvn clean install’.
I randomly checked a dozen java files in different packages of openmrs-core but all of them had already implemented the MPL license.
@manikam, could you share some more details on where did you update the license?
Hi @maany. As mentioned in the previous replies by other developers, there are changes happening to the openmrs-core code base. Please try to clone openmrs-core or pull the latest changes and additionally, you may also check the jdk version to see if it is compatible with the openmrs branch you are trying to build. This might help to get the license for the files.
If it helps, I created a wiki page providing a recipe for how I converted openmrs-core to Mozilla Public License 2.0 with Health Disclaimer (MPL 2.0 HD) and standardize line endings:
Just a heads up. The issue still hasn’t been fixed and I’m facing the exact same issue in 1.10.x. The license header one. I reset back to commits in February and they seemed to work I believe. So if anyone is looking to work on this branch, you might want to consider doing the same