Skip to content

Commit fbe868c

Browse files
committed
fix and deploy jooby bom
1 parent 00ad359 commit fbe868c

3 files changed

Lines changed: 567 additions & 386 deletions

File tree

jooby-bom/bom.groovy

Lines changed: 10 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,17 @@ import groovy.xml.*
55
def xml = new XmlSlurper().parse(new File(args[0]));
66
def sw = new StringWriter()
77
def b = new MarkupBuilder(sw)
8-
9-
def i = 0;
10-
11-
b.print('<?xml version="1.0" encoding="UTF-8"?>\n')
12-
13-
b.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/maven-v4_0_0.xsd") {
14-
15-
b.modelVersion('4.0.0')
16-
b.groupId(xml.groupId)
17-
b.artifactId('jooby-bom')
18-
b.version(xml.version)
19-
b.packaging(xml.packaging)
20-
b.name('jooby-bom')
21-
b.description('Jooby (Bill of Materials)')
22-
b.url(xml.url)
23-
24-
b.properties {
25-
'jooby.version'(xml.version)
26-
}
27-
28-
b.licenses {
29-
for (l in xml.licenses.license) {
30-
license {
31-
name(l.name)
32-
url(l.url)
33-
}
34-
}
35-
}
36-
37-
b.developers {
38-
for (d in xml.developers.developer) {
39-
developer {
40-
id(d.id)
41-
name(d.name)
42-
url(d.url)
43-
}
44-
}
45-
}
46-
47-
b.scm {
48-
connection(xml.scm.connection)
49-
developerConnection(xml.scm.developerConnection)
50-
url(xml.scm.url)
51-
}
52-
53-
b.distributionManagement {
54-
repository {
55-
id(xml.distributionManagement.repository.id)
56-
name(xml.distributionManagement.repository.name)
57-
url(xml.distributionManagement.repository.url)
58-
}
59-
}
60-
61-
b.dependencyManagement {
62-
dependencies {
63-
for (m in xml.modules.module) {
64-
if (m.text().endsWith('-bom') || m.text().contains('coverage-report')) continue;
65-
dependency {
66-
groupId('${project.groupId}');
67-
artifactId(m.text());
68-
version('${jooby.version}');
69-
}
70-
}
8+
def template = new java.io.File("pom.template.xml").getText("UTF-8")
9+
10+
b.dependencies {
11+
for (m in xml.modules.module) {
12+
if (m.text().endsWith('-bom') || m.text().contains('coverage-report')) continue;
13+
dependency {
14+
groupId('${project.groupId}');
15+
artifactId(m.text());
16+
version('${jooby.version}');
7117
}
7218
}
7319
}
7420

75-
println sw;
21+
println template.replace("@version", xml.version.text()).replace("@dependencies", sw.toString())

jooby-bom/pom.template.xml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
3+
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'>
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.jooby</groupId>
6+
<artifactId>jooby-bom</artifactId>
7+
<version>@version</version>
8+
<packaging>pom</packaging>
9+
<name>jooby-bom</name>
10+
<description>Jooby (Bill of Materials)</description>
11+
<url>https://github.com/jooby-project/jooby</url>
12+
<properties>
13+
<jooby.version>@version</jooby.version>
14+
15+
<maven-release-plugin.version>2.5.1</maven-release-plugin.version>
16+
<maven-source-plugin.version>2.4</maven-source-plugin.version>
17+
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
18+
<maven-javadoc-plugin.version>2.10.1</maven-javadoc-plugin.version>
19+
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
20+
<maven-enforcer-plugin.version>1.3.1</maven-enforcer-plugin.version>
21+
<maven-surefire-plugin.version>2.17</maven-surefire-plugin.version>
22+
<maven-eclipse-plugin.version>2.9</maven-eclipse-plugin.version>
23+
<maven-java-formatter-plugin.version>0.4</maven-java-formatter-plugin.version>
24+
<nexus-staging-maven-plugin.version>1.6.5</nexus-staging-maven-plugin.version>
25+
</properties>
26+
<licenses>
27+
<license>
28+
<name>The Apache Software License, Version 2.0</name>
29+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
30+
</license>
31+
</licenses>
32+
<developers>
33+
<developer>
34+
<id>jknack</id>
35+
<name>Edgar Espina</name>
36+
<url>https://github.com/jknack</url>
37+
</developer>
38+
</developers>
39+
<scm>
40+
<connection>scm:git:git@github.com:jooby-project/jooby.git</connection>
41+
<developerConnection>scm:git:git@github.com:jooby-project/jooby.git</developerConnection>
42+
<url>scm:git:git@github.com:jooby-project/jooby.git</url>
43+
</scm>
44+
<distributionManagement>
45+
<repository>
46+
<id>ossrh</id>
47+
<name>Nexus Release Repository</name>
48+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
49+
</repository>
50+
</distributionManagement>
51+
<dependencyManagement>
52+
@dependencies
53+
</dependencyManagement>
54+
55+
<profiles>
56+
<!-- Sonatype OSS release -->
57+
<profile>
58+
<id>sonatype-oss-release</id>
59+
<build>
60+
<plugins>
61+
<!-- Source -->
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-source-plugin</artifactId>
65+
<version>${maven-source-plugin.version}</version>
66+
<executions>
67+
<execution>
68+
<id>attach-sources</id>
69+
<goals>
70+
<goal>jar-no-fork</goal>
71+
</goals>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
76+
<!-- Javadoc -->
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-javadoc-plugin</artifactId>
80+
<version>${maven-javadoc-plugin.version}</version>
81+
<executions>
82+
<execution>
83+
<id>attach-javadocs</id>
84+
<goals>
85+
<goal>jar</goal>
86+
</goals>
87+
</execution>
88+
</executions>
89+
</plugin>
90+
91+
<!-- GPG -->
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-gpg-plugin</artifactId>
95+
<version>${maven-gpg-plugin.version}</version>
96+
<executions>
97+
<execution>
98+
<id>sign-artifacts</id>
99+
<phase>verify</phase>
100+
<goals>
101+
<goal>sign</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
107+
<!-- Release plugin -->
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-release-plugin</artifactId>
111+
<version>${maven-release-plugin.version}</version>
112+
<configuration>
113+
<mavenExecutorId>forked-path</mavenExecutorId>
114+
<useReleaseProfile>false</useReleaseProfile>
115+
<arguments>-Psonatype-oss-release</arguments>
116+
<autoVersionSubmodules>true</autoVersionSubmodules>
117+
<tagNameFormat>v@{project.version}</tagNameFormat>
118+
<scmCommentPrefix>release</scmCommentPrefix>
119+
<goals>deploy</goals>
120+
</configuration>
121+
</plugin>
122+
123+
<plugin>
124+
<groupId>org.sonatype.plugins</groupId>
125+
<artifactId>nexus-staging-maven-plugin</artifactId>
126+
<version>${nexus-staging-maven-plugin.version}</version>
127+
<extensions>true</extensions>
128+
<configuration>
129+
<serverId>ossrh</serverId>
130+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
131+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
132+
</configuration>
133+
</plugin>
134+
</plugins>
135+
</build>
136+
</profile>
137+
</profiles>
138+
</project>

0 commit comments

Comments
 (0)