Saturday, December 17, 2005

Maven 2 - How To: Add LICENSE.txt

1) Add LICENSE.txt to the root directory of your project...

%YOUR_PROJECT% pom.xml
LICENSE.txt
src site ...

2) Copy your license into LICENSE.txt

3) Include the <licenses> element in the pom.xml...

%YOUR_PROJECT%\pom.xml:

<project>
...
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>LICENSE.txt</url>
</license>
</licenses>
</project>

4) Inculde project ${reports} in site.xml

%YOUR_PROJECT%\src\site\site.xml:

<project>
...
${reports}
</body>
</project>

4 comments:

taw said...

Three years after you posted this, let me say - thanks! This was useful information that I couldn't find elsewhere. I happened on your blog based on a Google search for "maven2 license file site.xml".


-Tim

uday said...

Same here, This was very useful info. Thanks again.

Anonymous said...

Awesome, finally FINALLY I found it! Thank you very much.

Anonymous said...

Still useful nearly 6 years later!

Thanks,

- Greg