Skip to content

Commit

Permalink
startup 模块合并
Browse files Browse the repository at this point in the history
  • Loading branch information
qq254963746 committed Apr 16, 2016
1 parent 35d8d3f commit d7d464d
Show file tree
Hide file tree
Showing 51 changed files with 369 additions and 547 deletions.
37 changes: 10 additions & 27 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,22 @@ md "%BASE_HOME%\dist\%DIST_BIN_DIR%"

set LTS_Bin_Dir=%BASE_HOME%dist\%DIST_BIN_DIR%

set JobTracker_Startup_Dir=%BASE_HOME%\lts-startup\lts-startup-jobtracker
cd %JobTracker_Startup_Dir%
start mvn assembly:assembly -DskipTests
echo "LTS: mvn assembly:assembly -DskipTests"
set Startup_Dir=%BASE_HOME%\lts-startup\lts-startup
cd %Startup_Dir%
start mvn clean assembly:assembly -DskipTests -Pdefault
echo "LTS: mvn clean assembly:assembly -DskipTests -Pdefault"
echo "LTS: After sub window finished, close it , and press any key to continue" & pause>nul

xcopy /e /y "%JobTracker_Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%"
xcopy /e /y "%Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%"
cd ..\..\

set LTS_Admin_Startup_Dir=%BASE_HOME%/lts-startup/lts-startup-admin
cd %LTS_Admin_Startup_Dir%
start mvn assembly:assembly -DskipTests
echo "LTS: mvn assembly:assembly -DskipTests"
cd %Startup_Dir%
start mvn clean assembly:assembly -DskipTests -Plts-admin
echo "LTS: mvn clean assembly:assembly -DskipTests -Plts-admin"
echo "LTS: After sub window finished, close it , and press any key to continue" & pause>nul

xcopy /e /y "%LTS_Admin_Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%"
xcopy /e /y "%BASE_HOME%\lts-admin\target\lts-admin-%VERSION%.war" "%LTS_Bin_Dir%\lts-admin\lts-admin.war"
xcopy /e /y "%Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%\war\lib"
cd ..\..\

set TaskTracker_Startup_Dir=%BASE_HOME%\lts-startup\lts-startup-tasktracker
cd %TaskTracker_Startup_Dir%
start mvn assembly:assembly -DskipTests
echo "LTS: mvn assembly:assembly -DskipTests"
echo "LTS: After sub window finished, close it , and press any key to continue" & pause>nul

xcopy /e /y "%TaskTracker_Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%"
cd ..\..\

set LTS_Monitor_Startup_Dir=%BASE_HOME%\lts-monitor
cd %LTS_Monitor_Startup_Dir%
start mvn assembly:assembly -DskipTests
echo "LTS: mvn assembly:assembly -DskipTests"
echo "LTS: After sub window finished, close it , and press any key to continue" & pause>nul

xcopy /e /y "%LTS_Monitor_Startup_Dir%\target\lts-bin\lts" "%LTS_Bin_Dir%"
xcopy /e /y "%BASE_HOME%\lts-admin\target\lts-admin-%VERSION%.war" "%LTS_Bin_Dir%\war\lts-admin.war"
cd ..\..\
51 changes: 18 additions & 33 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,22 @@ cd $LTS_Bin_Dir

mvn clean install -U -DskipTests

Dist_Bin_Dir="lts-$VERSION-bin"
mkdir -p $LTS_Bin_Dir/dist/$Dist_Bin_Dir

# JobTracker 的打包
JobTracker_Startup_Dir="$LTS_Bin_Dir/lts-startup/lts-startup-jobtracker"
cd $JobTracker_Startup_Dir
mvn assembly:assembly -DskipTests

# LTS-Admin 打包
LTS_Admin_Startup_Dir="$LTS_Bin_Dir/lts-startup/lts-startup-admin"
cd $LTS_Admin_Startup_Dir
mvn assembly:assembly -DskipTests

# TaskTracker 打包
TaskTracker_Startup_Dir="$LTS_Bin_Dir/lts-startup/lts-startup-tasktracker"
cd $TaskTracker_Startup_Dir
mvn assembly:assembly -DskipTests

# LTS-Monitor 打包
LTS_Monitor_Startup_Dir="$LTS_Bin_Dir/lts-monitor"
cd $LTS_Monitor_Startup_Dir
mvn assembly:assembly -DskipTests


cp -rf $JobTracker_Startup_Dir/target/lts-bin/lts/* $LTS_Bin_Dir/dist/$Dist_Bin_Dir
cp -rf $LTS_Admin_Startup_Dir/target/lts-bin/lts/* $LTS_Bin_Dir/dist/$Dist_Bin_Dir
cp -rf $TaskTracker_Startup_Dir/target/lts-bin/lts/* $LTS_Bin_Dir/dist/$Dist_Bin_Dir
cp -rf $LTS_Monitor_Startup_Dir/target/lts-bin/lts/* $LTS_Bin_Dir/dist/$Dist_Bin_Dir
cp -rf $LTS_Bin_Dir/lts-admin/target/lts-admin-$VERSION.war $LTS_Bin_Dir/dist/$Dist_Bin_Dir/lts-admin/lts-admin.war

# cd $LTS_Bin_Dir/dist
# zip -r $Dist_Bin_Dir.zip $Dist_Bin_Dir/*
# rm -rf $Dist_Bin_Dir
Dist_Bin_Dir="$LTS_Bin_Dir/dist/lts-$VERSION-bin"
mkdir -p $Dist_Bin_Dir

Dist_Bin_Dir="$(cd "$(dirname "${Dist_Bin_Dir}/.")"; pwd)"

mkdir -p $Dist_Bin_Dir

# 打包
Startup_Dir="$LTS_Bin_Dir/lts-startup/"
cd $Startup_Dir
mvn clean assembly:assembly -DskipTests -Pdefault

cp -rf $Startup_Dir/target/lts-bin/lts/* $Dist_Bin_Dir

mkdir -p $Dist_Bin_Dir/war/jetty/lib
mvn clean assembly:assembly -DskipTests -Plts-admin
cp -rf $Startup_Dir/target/lts-bin/lts/lib $Dist_Bin_Dir/war/jetty
cp -rf $LTS_Bin_Dir/lts-admin/target/lts-admin-$VERSION.war $Dist_Bin_Dir/war/lts-admin.war

2 changes: 1 addition & 1 deletion lts-admin/src/main/resources/spring-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"
>

<context:component-scan base-package="com.lts">
<context:component-scan base-package="com.lts.admin">
<context:exclude-filter type="regex" expression="com.lts.admin.web.*"/>
</context:component-scan>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public JdkCompiler() {
// options.add("-target");
// options.add("1.6");
StandardJavaFileManager manager = compiler.getStandardFileManager(diagnosticCollector, null, null);
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader.getClass().getName().equals("org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader")) {
loader = loader.getParent();
}
if (loader instanceof URLClassLoader
&& (!loader.getClass().getName().equals("sun.misc.Launcher$AppClassLoader"))) {
try {
Expand All @@ -49,9 +52,10 @@ public JdkCompiler() {
throw new IllegalStateException(e.getMessage(), e);
}
}
final ClassLoader finalLoader = loader;
classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoaderImpl>() {
public ClassLoaderImpl run() {
return new ClassLoaderImpl(loader);
return new ClassLoaderImpl(finalLoader);
}
});
javaFileManager = new JavaFileManagerImpl(manager, classLoader);
Expand Down
44 changes: 1 addition & 43 deletions lts-monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,11 @@
<artifactId>lts-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.sgroschupf</groupId>
<artifactId>zkclient</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<finalName>lts</finalName>
<descriptors>
<descriptor>release.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</project>
25 changes: 0 additions & 25 deletions lts-monitor/release.xml

This file was deleted.

This file was deleted.

46 changes: 0 additions & 46 deletions lts-startup/lts-startup-admin/pom.xml

This file was deleted.

16 changes: 0 additions & 16 deletions lts-startup/lts-startup-admin/src/main/resources/bin/lts-admin.cmd

This file was deleted.

96 changes: 0 additions & 96 deletions lts-startup/lts-startup-jobtracker/pom.xml

This file was deleted.

Loading

0 comments on commit d7d464d

Please sign in to comment.