update sample after package refactor
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>helloworld</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<comment>Spring Shell Example</comment>
|
||||
<projects/>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
<arguments/>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<linkedResources/>
|
||||
</projectDescription>
|
||||
|
||||
@@ -16,6 +16,23 @@ dependencies {
|
||||
compile "org.springframework.shell:spring-shell:$springShellVersion"
|
||||
testCompile "junit:junit:$junitVersion"
|
||||
}
|
||||
mainClassName = "org.springframework.shell.Bootstrap"
|
||||
|
||||
defaultTasks 'clean', 'build'
|
||||
task copyDependency(type: Copy) {
|
||||
into "$buildDir/libs/dependency"
|
||||
from configurations.runtime
|
||||
}
|
||||
|
||||
project.ext.springShellJar = configurations.runtime.find { file -> file.name.contains("spring-shell")}
|
||||
//println("spring shell name is:" + project.ext.springShellJar.name)
|
||||
|
||||
project.ext.manifestClasspath = "dependency/" + springShellJar.name + " "
|
||||
project.ext.manifestClasspath = project.ext.manifestClasspath + configurations.runtime.collect{ File file -> "dependency/"+file.name}.join(' ')
|
||||
|
||||
jar {
|
||||
baseName "helloworld"
|
||||
manifest {
|
||||
attributes 'Main-Class' : 'org.springframework.shell.Bootstrap', "Class-Path" : project.ext.manifestClasspath
|
||||
}
|
||||
}
|
||||
|
||||
defaultTasks 'clean', 'build', 'copyDependency'
|
||||
|
||||
@@ -11,9 +11,9 @@ Maven:
|
||||
Gradle
|
||||
|
||||
1.Build and install the project
|
||||
$>../../gradlew installApp
|
||||
$>../../gradlew
|
||||
|
||||
2.run spring shell
|
||||
$>.\build\install\helloworld\bin\helloworld.bat
|
||||
$>java -jar build/libs/helloworld-1.0.0.BUILD-SNAPSHOT.jar
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.springframework.shell.samples.helloworld.commands;
|
||||
|
||||
import org.springframework.roo.shell.CliAvailabilityIndicator;
|
||||
import org.springframework.roo.shell.CliCommand;
|
||||
import org.springframework.roo.shell.CliOption;
|
||||
import org.springframework.roo.shell.CommandMarker;
|
||||
|
||||
import org.springframework.shell.core.CommandMarker;
|
||||
import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
|
||||
import org.springframework.shell.core.annotation.CliCommand;
|
||||
import org.springframework.shell.core.annotation.CliOption;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
||||
@@ -17,9 +17,9 @@ package org.springframework.shell.samples.helloworld.commands;
|
||||
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.roo.shell.CliCommand;
|
||||
import org.springframework.roo.shell.CommandMarker;
|
||||
import org.springframework.shell.support.util.StringUtils;
|
||||
import org.springframework.shell.core.CommandMarker;
|
||||
import org.springframework.shell.core.annotation.CliCommand;
|
||||
import org.springframework.shell.plugin.support.DefaultBannerProvider;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user