Skip to content

Commit 951fc39

Browse files
authored
Generating Bill of Material (#846)
1 parent e186003 commit 951fc39

File tree

2 files changed

+142
-0
lines changed

2 files changed

+142
-0
lines changed

pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<maven-bundle-plugin.version>4.0.0</maven-bundle-plugin.version>
8585
<centralsync-maven-plugin.version>0.1.0</centralsync-maven-plugin.version>
8686
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
87+
<bom-generator.version>0.14.3</bom-generator.version>
8788
</properties>
8889
<url>https://github.com/openfeign/feign</url>
8990
<inceptionYear>2012</inceptionYear>
@@ -443,6 +444,7 @@
443444
<exclude>mvnw*</exclude>
444445
<exclude>etc/header.txt</exclude>
445446
<exclude>**/.idea/**</exclude>
447+
<exclude>**/target/**</exclude>
446448
<exclude>LICENSE</exclude>
447449
<exclude>**/*.md</exclude>
448450
<exclude>bnd.bnd</exclude>
@@ -505,6 +507,56 @@
505507
</execution>
506508
</executions>
507509
</plugin>
510+
511+
<plugin>
512+
<groupId>io.sundr</groupId>
513+
<artifactId>sundr-maven-plugin</artifactId>
514+
<version>${bom-generator.version}</version>
515+
<inherited>false</inherited>
516+
<configuration>
517+
<bomTemplateUrl>file://${project.basedir}/src/config/bom.xml</bomTemplateUrl>
518+
<boms>
519+
<bom>
520+
<artifactId>feign-bom</artifactId>
521+
<name>Feign (Bill Of Materials)</name>
522+
523+
<properties>
524+
<license.skip>true</license.skip>
525+
</properties>
526+
527+
<modules>
528+
<includes>
529+
<include>io.github.openfeign:*</include>
530+
</includes>
531+
<excludes>
532+
<exclude>*:feign-example-*</exclude>
533+
<exclude>*:feign-benchmark</exclude>
534+
</excludes>
535+
</modules>
536+
</bom>
537+
</boms>
538+
</configuration>
539+
<executions>
540+
<execution>
541+
<goals>
542+
<goal>generate-bom</goal>
543+
</goals>
544+
</execution>
545+
</executions>
546+
<dependencies>
547+
<dependency>
548+
<groupId>io.sundr</groupId>
549+
<artifactId>sundr-codegen</artifactId>
550+
<version>${bom-generator.version}</version>
551+
<exclusions>
552+
<exclusion>
553+
<groupId>com.sun</groupId>
554+
<artifactId>tools</artifactId>
555+
</exclusion>
556+
</exclusions>
557+
</dependency>
558+
</dependencies>
559+
</plugin>
508560
</plugins>
509561
</build>
510562

src/config/bom.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright 2012-2018 The Feign Authors
5+
6+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7+
in compliance with the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software distributed under the License
12+
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13+
or implied. See the License for the specific language governing permissions and limitations under
14+
the License.
15+
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
20+
<groupId>${model.groupId}</groupId>
21+
<artifactId>${model.artifactId}</artifactId>
22+
<version>${model.version}</version>
23+
<name>${model.name}</name>
24+
<packaging>pom</packaging>
25+
<description>Bill of material</description>
26+
#if ($model.url)
27+
28+
<url>${model.url}</url>#end
29+
#if ($model.licenses && !$model.licenses.isEmpty())
30+
31+
<licenses>#foreach($l in $model.licenses)
32+
33+
<license>
34+
<name>${l.name}</name>
35+
<url>${l.url}</url>
36+
<distribution>${l.distribution}</distribution>
37+
</license>#end
38+
39+
</licenses>
40+
#end
41+
42+
#if ($model.developers && !$model.developers.isEmpty())
43+
<developers>#foreach($d in $model.developers)
44+
45+
<developer>
46+
<id>${d.id}</id>
47+
<name>${d.name}</name>#if($d.email)
48+
49+
<email>${d.email}</email>#end#if($d.url)
50+
51+
<url>${d.url}</url>#end#if($d.organization)
52+
53+
<organization>${d.organization}</organization>#end#if($d.organizationUrl)
54+
55+
<organizationUrl>${d.organizationUrl}</organizationUrl>#end
56+
57+
</developer>#end
58+
59+
</developers>
60+
#end
61+
62+
<dependencyManagement>
63+
<dependencies>#foreach($d in $model.dependencyManagement.dependencies)
64+
65+
<dependency>
66+
<groupId>${d.groupId}</groupId>
67+
<artifactId>${d.artifactId}</artifactId>
68+
<version>${d.version}</version>#if( $d.scope && $!d.scope != '' )
69+
70+
<scope>${d.scope}</scope>#end#if( $d.type && $!d.type != '' && $!d.type != 'jar' && $!d.type != 'bundle')
71+
72+
<type>${d.type}</type>#end#if( $d.classifier && $!d.classifier != '' )
73+
74+
<classifier>${d.classifier}</classifier>#end#if( $d.exclusions && $d.exclusions.size() > 0 )
75+
76+
<exclusions>#foreach( $e in $d.exclusions )
77+
78+
<exclusion>
79+
<groupId>${e.groupId}</groupId>
80+
<artifactId>${e.artifactId}</artifactId>
81+
</exclusion>#end
82+
83+
</exclusions>#end
84+
85+
</dependency>#end
86+
87+
</dependencies>
88+
</dependencyManagement>
89+
90+
</project>

0 commit comments

Comments
 (0)