# ignite-cleanup-bin Add java check in build. Removed igniteservice.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3e3905ba Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3e3905ba Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3e3905ba Branch: refs/heads/ignite-45 Commit: 3e3905ba5d6b8cbaa7ecc2f0b5bc035cd99165be Parents: b2f1e43 Author: anovikov <anovi...@gridgain.com> Authored: Fri Mar 13 17:34:59 2015 +0700 Committer: anovikov <anovi...@gridgain.com> Committed: Fri Mar 13 17:34:59 2015 +0700 ---------------------------------------------------------------------- bin/include/igniteservice.exe | Bin 6144 -> 0 bytes .../core/src/test/bin/start-nodes-custom.bat | 3 +- .../util/nodestart/IgniteNodeCallableImpl.java | 42 +---- modules/winservice/IgniteService.sln | 22 --- .../winservice/IgniteService/IgniteService.cs | 170 ------------------- .../IgniteService/IgniteService.csproj | 90 ---------- modules/winservice/README.md | 20 --- pom.xml | 20 +++ 8 files changed, 24 insertions(+), 343 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/bin/include/igniteservice.exe ---------------------------------------------------------------------- diff --git a/bin/include/igniteservice.exe b/bin/include/igniteservice.exe deleted file mode 100644 index 66deb9c..0000000 Binary files a/bin/include/igniteservice.exe and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/core/src/test/bin/start-nodes-custom.bat ---------------------------------------------------------------------- diff --git a/modules/core/src/test/bin/start-nodes-custom.bat b/modules/core/src/test/bin/start-nodes-custom.bat index 03897bb..bfa226e 100644 --- a/modules/core/src/test/bin/start-nodes-custom.bat +++ b/modules/core/src/test/bin/start-nodes-custom.bat @@ -19,6 +19,5 @@ set SCRIPT_DIR=%~dp0 if %SCRIPT_DIR:~-1,1% == \ set SCRIPT_DIR=%SCRIPT_DIR:~0,-1% -:: -np option is mandatory, if it is not provided then we will wait for a user input, -:: as a result igniteservice windows service hangs forever +:: -np option is mandatory, if it is not provided then we will wait for a user input. call "%SCRIPT_DIR%\..\..\..\..\..\bin\ignite.bat" -v -np modules\core\src\test\config\spring-start-nodes-attr.xml http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteNodeCallableImpl.java ---------------------------------------------------------------------- diff --git a/modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteNodeCallableImpl.java b/modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteNodeCallableImpl.java index d48ef6d..68e2be4 100644 --- a/modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteNodeCallableImpl.java +++ b/modules/ssh/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteNodeCallableImpl.java @@ -41,21 +41,9 @@ public class IgniteNodeCallableImpl implements IgniteNodeCallable { /** Default Ignite home path for Linux (taken from environment variable). */ private static final String DFLT_IGNITE_HOME_LINUX = "$IGNITE_HOME"; - /** Default start script path for Windows. */ - private static final String DFLT_SCRIPT_WIN = "bin\\ignite.bat -v -np"; - /** Default start script path for Linux. */ private static final String DFLT_SCRIPT_LINUX = "bin/ignite.sh -v"; - /** - * Logs folder for Windows. - * Folder for linux is configured in {@code ignite-log4j.xml}. - */ - private static final String LOG_DIR_WIN = "work\\log"; - - /** Windows service executable. */ - private static final String SVC_EXE = "bin\\include\\igniteservice.exe"; - /** Date format for log file name. */ private static final SimpleDateFormat FILE_NAME_DATE_FORMAT = new SimpleDateFormat("MM-dd-yyyy--HH-mm-ss"); @@ -125,7 +113,7 @@ public class IgniteNodeCallableImpl implements IgniteNodeCallable { String script = spec.script(); if (script == null) - script = win ? DFLT_SCRIPT_WIN : DFLT_SCRIPT_LINUX; + script = DFLT_SCRIPT_LINUX; String cfg = spec.configuration(); @@ -136,32 +124,8 @@ public class IgniteNodeCallableImpl implements IgniteNodeCallable { String scriptOutputFileName = FILE_NAME_DATE_FORMAT.format(new Date()) + '-' + UUID.randomUUID().toString().substring(0, 8) + ".log"; - if (win) { - String logDir = igniteHome + '\\' + LOG_DIR_WIN; - String tmpDir = env(ses, "%TMP%", logDir); - String scriptOutputDir = tmpDir + "\\ignite-startNodes"; - - shell(ses, "mkdir " + logDir); - shell(ses, "mkdir " + scriptOutputDir); - - UUID id = UUID.randomUUID(); - - String svcName = "Ignite-" + id; - String svcPath = igniteHome + '\\' + SVC_EXE; - - startNodeCmd = new SB(). - a("cmd /c if exist \"").a(svcPath).a("\""). - a(" sc create ").a(svcName). - a(" binPath= \"").a(svcPath).a("\""). - a(" && "). - a("sc start ").a(svcName). - a(" ").a(svcName). - a(" \"").a(igniteHome).a('\\').a(script). - a(" ").a(cfg).a("\""). - a(" \"").a(logDir).a("\\ignite.").a(id). - a(".log\" > ").a(scriptOutputDir).a("\\").a(scriptOutputFileName). - toString(); - } + if (win) + throw new UnsupportedOperationException("Apache Ignite can't be run as service under Windows."); else { // Assume Unix. int spaceIdx = script.indexOf(' '); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/winservice/IgniteService.sln ---------------------------------------------------------------------- diff --git a/modules/winservice/IgniteService.sln b/modules/winservice/IgniteService.sln deleted file mode 100644 index 7658fb1..0000000 --- a/modules/winservice/IgniteService.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IgniteService", "IgniteService\IgniteService.csproj", "{86BE9E54-4293-482A-8956-BDCF20BA53A8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {86BE9E54-4293-482A-8956-BDCF20BA53A8}.Debug|x86.ActiveCfg = Debug|x86 - {86BE9E54-4293-482A-8956-BDCF20BA53A8}.Debug|x86.Build.0 = Debug|x86 - {86BE9E54-4293-482A-8956-BDCF20BA53A8}.Release|x86.ActiveCfg = Release|x86 - {86BE9E54-4293-482A-8956-BDCF20BA53A8}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/winservice/IgniteService/IgniteService.cs ---------------------------------------------------------------------- diff --git a/modules/winservice/IgniteService/IgniteService.cs b/modules/winservice/IgniteService/IgniteService.cs deleted file mode 100644 index 63d1183..0000000 --- a/modules/winservice/IgniteService/IgniteService.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Ignite -{ - using System; - using System.ServiceProcess; - using System.Diagnostics; - using System.Threading; - using System.IO; - - /** <summary>Service implementation.</summary> */ - class IgniteService : ServiceBase - { - /** <summary>Service name.</summary> */ - private String name; - - /** <summary>External process.</summary> */ - private Process proc; - - /** - * <summary>Creates new service.</summary> - */ - public IgniteService() - { - this.ServiceName = "Ignite Service"; - } - - /** - * <summary>Runs service.</summary> - */ - public static void Main() - { - System.ServiceProcess.ServiceBase.Run(new IgniteService()); - } - - /** <inheritdoc /> */ - protected override void OnStart(string[] args) - { - base.OnStart(args); - - try - { - if (args.Length != 3) - throw new Exception("Following arguments must be provided: service name, script path, log path."); - - name = args[0]; - - String script = args[1]; - - int spaceIdx = script.IndexOf(' '); - - String scriptPath = spaceIdx != -1 ? script.Substring(0, spaceIdx) : script; - String scriptArgs = spaceIdx != -1 ? script.Substring(spaceIdx + 1) : String.Empty; - - String log = args[2]; - - proc = new Process(); - - proc.StartInfo.FileName = scriptPath; - proc.StartInfo.Arguments = scriptArgs + " > " + log + " 2>&1"; - proc.StartInfo.CreateNoWindow = true; - - proc.Start(); - - Thread waitThread = new Thread(new ThreadStart(WaitStopAndDelete)); - - waitThread.Start(); - } - catch (Exception e) - { - EventLog.WriteEntry(e.Message); - - try - { - Kill(); - } - finally - { - StopAndDelete(); - } - } - } - - /** <inheritdoc /> */ - protected override void OnStop() - { - base.OnStop(); - - Kill(); - } - - /** - * <summary>Waits for external process to complete, stops and deletes service.</summary> - */ - private void WaitStopAndDelete() - { - try - { - proc.WaitForExit(); - } - finally - { - StopAndDelete(); - } - } - - /** - * <summary>Stops and deletes service.</summary> - */ - private void StopAndDelete() - { - try - { - Stop(); - } - finally - { - Delete(); - } - } - - /** - * <summary>Kills the process.</summary> - */ - private void Kill() - { - Execute("taskkill /f /t /pid " + proc.Id); - } - - /** - * <summary>Deletes service.</summary> - */ - private void Delete() - { - Execute("sc delete " + name); - } - - /** - * <summary>Executes command.</summary> - * <param name="cmd">Command.</name> - */ - private void Execute(String cmd) - { - Process cmdProc = new Process(); - - cmdProc.StartInfo.FileName = "cmd.exe"; - cmdProc.StartInfo.Arguments = "/c " + cmd; - cmdProc.StartInfo.CreateNoWindow = true; - - cmdProc.Start(); - - cmdProc.WaitForExit(); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/winservice/IgniteService/IgniteService.csproj ---------------------------------------------------------------------- diff --git a/modules/winservice/IgniteService/IgniteService.csproj b/modules/winservice/IgniteService/IgniteService.csproj deleted file mode 100644 index 6f41039..0000000 --- a/modules/winservice/IgniteService/IgniteService.csproj +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">x86</Platform> - <ProductVersion>8.0.30703</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{86BE9E54-4293-482A-8956-BDCF20BA53A8}</ProjectGuid> - <OutputType>Exe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Ignite</RootNamespace> - <AssemblyName>IgniteService</AssemblyName> - <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> - <TargetFrameworkProfile>Client</TargetFrameworkProfile> - <FileAlignment>512</FileAlignment> - <IsWebBootstrapper>false</IsWebBootstrapper> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <PlatformTarget>x86</PlatformTarget> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <PlatformTarget>x86</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Compile Include="IgniteService.cs"> - <SubType>Component</SubType> - </Compile> - </ItemGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.ServiceProcess" /> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> - <Visible>False</Visible> - <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> - <Visible>False</Visible> - <ProductName>Windows Installer 3.1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/modules/winservice/README.md ---------------------------------------------------------------------- diff --git a/modules/winservice/README.md b/modules/winservice/README.md deleted file mode 100644 index 0aef473..0000000 --- a/modules/winservice/README.md +++ /dev/null @@ -1,20 +0,0 @@ -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -# Windows service project. -.Net project with Windows service. This service is used by "startNode" functionality when remote node is started from Ignite API through SSH. -If you make any changes to .Net source code if this project, please make sure to rebuild it in Release mode and copy resulting binary to /bin/include folder. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e3905ba/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 26c8159..2196816 100644 --- a/pom.xml +++ b/pom.xml @@ -494,6 +494,26 @@ <skip>true</skip> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.4</version> + <configuration> + <rules> + <requireJavaVersion> + <version>[1.7,1.8)</version> + </requireJavaVersion> + </rules> + </configuration> + <executions> + <execution> + <goals> + <goal>enforce</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build>