0

I try to get a executable file for my code using this maven plug from How can I create an executable JAR with dependencies using Maven?. However it ends up with the error Failed to execute goal com.mycila:license-maven-plugin:3.0:check (check-license) on project rinsim-example: Execution check-license of goal com.mycila:license-maven-plugin:3.0:check failed: Cannot read header document LICENSE_HEADER. Cause: Resource LICENSE_HEADER not found in file system, classpath or URL: no protocol: LICENSE_HEADER -> [Help 1]>

this is the part of my maven file:

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
     <archive>
      <manifest>
       <mainClass>com.github.rinde.rinsim.examples.project.DDRP</mainClass>
      </manifest>
     </archive>
     <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
     </descriptorRefs>
    </configuration>
    <executions>
     <execution>
      <id>make-my-jar-with-dependencies</id>
      <phase>package</phase>
      <goals>
       <goal>single</goal>
      </goals>
     </execution>
    </executions>
   </plugin>

Thank you.

Community
  • 1
  • 1
yihang.zhu
  • 27
  • 4
  • what is the error message that you see? – rinde May 02 '17 at 08:05
  • The error is : Failed to execute goal com.mycila:license-maven-plugin:3.0:check (check-license) on project rinsim-example: Execution check-license of goal com.mycila:license-maven-plugin:3.0:check failed: Cannot read header document LICENSE_HEADER. Cause: Resource LICENSE_HEADER not found in file system, classpath or URL: no protocol: LICENSE_HEADER -> [Help 1] – yihang.zhu May 02 '17 at 08:07

1 Answers1

0

It seems like you've copied part of the RinSim pom.xml, including the license-maven-plugin? You should probably remove the license-maven-plugin plugin execution, as that is the source of this error message. This is the definition of the license-maven-plugin in RinSim:

<pluginExecution>
  <pluginExecutionFilter>
    <groupId>com.mycila</groupId>
    <artifactId>
        license-maven-plugin
    </artifactId>
    <versionRange>
        [2.11,)
    </versionRange>
    <goals>
        <goal>check</goal>
    </goals>
  </pluginExecutionFilter>
  <action>
    <ignore></ignore>
  </action>
</pluginExecution>

Alternatively, you can choose to use the license-maven-plugin. This plugin allows you to set a license header on every source file.

rinde
  • 1,181
  • 1
  • 8
  • 20
  • Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rinsim-example: Compilation failure -> [Help 1] Hey, Rinde, I removed the license part, and it comes out with this error. I put the maven plugin in the pom.xml of example file which also contains my project code. and run command: mvn clean compile assembly:single in the example file to build the executable jar. And, all the simulator original code is obtained by run git clone instead follow your introduction of the website. Is there any thing not correct? – yihang.zhu May 02 '17 at 08:51
  • I wouldn't recommend to clone RinSim, just follow the instructions on the website. – rinde May 02 '17 at 12:31