mirror of
https://gitee.com/dcren/initializr.git
synced 2026-09-21 23:37:40 +08:00
Working app with maven pom generator and installer
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html">
|
||||
<head>
|
||||
<title>Spring Initializr</title>
|
||||
<link rel="stylesheet"
|
||||
href="/css/bootstrap.min.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<a class="brand"
|
||||
href="https://www.springsource.org">
|
||||
Spring
|
||||
</a>
|
||||
<ul class="nav">
|
||||
<li>
|
||||
<a href="/spring.zip">
|
||||
Download
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/">
|
||||
Projects
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/installer">
|
||||
Installer
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<h1>Spring Initializr</h1>
|
||||
<div>
|
||||
<form action="/pom" method="get">
|
||||
<label for="groupId">Group:</label> <input id="groupId" type="text" value="org.demo" name="groupId"/>
|
||||
<label for="artifactId">Artifact:</label> <input id="artifactId" type="text" value="demo" name="artifactId"/>
|
||||
<label for="name">Name:</label> <input id="name" type="text" value="demo" name="name"/>
|
||||
<label for="name">Description:</label> <input id="description" type="text" value="Demo project" name="description"/>
|
||||
<label for="packageName">Package Name:</label> <input id="packageName" type="text" value="demo" name="packageName"/>
|
||||
<label>Styles:</label>
|
||||
<% styles.each { %>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="style" value="${it.value}"/>
|
||||
${it.name}
|
||||
</label><% } %>
|
||||
<label>Type:</label>
|
||||
<% types.each { %>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" value="${it.value}"${it.selected ? ' checked="true"' : ''}/>
|
||||
${it.name}
|
||||
</label><% } %>
|
||||
<button type="submit" class="btn">Generate</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -e spring -a ! -d spring ]; then
|
||||
echo "You already have a local file called 'spring' and it's not a directory"
|
||||
echo "Remove it before trying again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d spring ]; then
|
||||
echo "You already have a local directory called 'spring'. Removing..."
|
||||
rm -rf spring
|
||||
fi
|
||||
|
||||
echo "Installing Spring in local directory..."
|
||||
|
||||
if [ ! -e spring.zip ]; then
|
||||
wget ${host}/spring.zip
|
||||
else
|
||||
echo "Using locally cached spring.zip"
|
||||
fi
|
||||
|
||||
echo "Unpacking spring.zip"
|
||||
unzip -u spring.zip
|
||||
rm spring.zip
|
||||
|
||||
echo "To use the spring CLI:"
|
||||
echo " export SPRING_HOME="`pwd`/spring
|
||||
echo " export PATH="`pwd`/spring/bin':\$PATH'
|
||||
echo "And (e.g.) 'spring run app.groovy'"
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
|
||||
<name>${name}</name>
|
||||
<description>${description}</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-starters</artifactId>
|
||||
<version>0.5.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies><% styles.each { %>
|
||||
<dependency>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-${it}starter</artifactId>
|
||||
</dependency><% } %>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<start-class>${packageName}.ApplicationConfiguration</start-class>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>http://repo.springsource.org/snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>http://repo.springsource.org/milestone</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>http://repo.springsource.org/snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user