Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate code from che-lib #14592

Merged
merged 6 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions assembly/assembly-che-tomcat8/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<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>
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>7.3.0-SNAPSHOT</version>
</parent>
<artifactId>assembly-che-tomcat8</artifactId>
<packaging>jar</packaging>
<name>Che IDE :: Assemblies Che Tomcat8</name>
<build>
<finalName>assembly-che-tomcat8</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<updateOnly>false</updateOnly>
<descriptors>
<descriptor>${project.basedir}/src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${project.build.directory}</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-tomcat</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<type>zip</type>
<version>${org.apache.tomcat.version}</version>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>analyze</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1,050 changes: 1,050 additions & 0 deletions assembly/assembly-che-tomcat8/src/assembly/LICENSE-tomcat.txt

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions assembly/assembly-che-tomcat8/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<assembly xmlns="https://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/plugins/maven-assembly-plugin/assembly/2.0.0 https://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>tomcat-zip</id>

<formats>
<format>zip</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>


<fileSets>
<fileSet>
<directory>${project.build.directory}/dependency/apache-tomcat-${org.apache.tomcat.version}</directory>
<outputDirectory></outputDirectory>
<excludes>
<exclude>**/webapps/**</exclude>
<exclude>**/bin/setenv.*</exclude>
<exclude>**/bin/*.sh</exclude>
<exclude>**/bin/catalina-tasks.xml</exclude>
<exclude>**/bin/*.tar.gz</exclude>
<exclude>**/conf/tomcat-users.xml</exclude>
<exclude>**/conf/server.xml</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/dependency/apache-tomcat-${org.apache.tomcat.version}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/bin/*.sh</include>
</includes>
<fileMode>755</fileMode>
</fileSet>


<fileSet>
<directory>${project.basedir}/src/assembly</directory>
<outputDirectory></outputDirectory>
<includes>
<include>LICENSE-tomcat.txt</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>setenv.sh</include>
</includes>
<fileMode>755</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/assembly/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>logback-access.xml</include>
<include>logback.xml</include>
<include>logback-json-appenders.xml</include>
<include>logback-plaintext-appenders.xml</include>
<include>server.xml</include>
<include>context.xml</include>
<include>logging.properties</include>
</includes>
</fileSet>
</fileSets>
</assembly>
41 changes: 41 additions & 0 deletions assembly/assembly-che-tomcat8/src/assembly/conf/logback-access.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<configuration>

<property name="max.retention.days" value="60" />

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.access.PatternLayoutEncoder">
<pattern>common</pattern>
</encoder>
</appender>

<appender name="ACCESS-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${che.logs.dir}/logs/localhost-access.log</file>
<append>true</append>
<encoder class="ch.qos.logback.access.PatternLayoutEncoder">
<charset>utf-8</charset>
<pattern>common</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${che.logs.dir}/archive/localhost-access-%d{yyyyMMdd}-%i.log</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
<maxFileSize>20MB</maxFileSize>
</rollingPolicy>
</appender>

<appender-ref ref="ACCESS-LOG" />

</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<included>
<appender name="stdout-json" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<includeMdcKeyName>identity_id</includeMdcKeyName>
<includeMdcKeyName>req_id</includeMdcKeyName>
</encoder>
</appender>

<root level="${che.logs.level:-INFO}">
<appender-ref ref="stdout-json"/>
</root>
</included>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<included>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-41(%date[%.15thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n</pattern>
</encoder>
</appender>

<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<append>true</append>
<prudent>true</prudent>
<encoder>
<charset>utf-8</charset>
<pattern>%-41(%date[%.15thread]) %-45([%-5level] [%.30logger{30} %L]) - %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${che.logs.dir}/archive/%d{yyyy/MM/dd}/catalina.log</fileNamePattern>
<maxHistory>${max.retention.days}</maxHistory>
</rollingPolicy>
</appender>

<root level="${che.logs.level:-INFO}">
<appender-ref ref="stdout"/>
<appender-ref ref="file"/>
</root>
</included>
33 changes: 33 additions & 0 deletions assembly/assembly-che-tomcat8/src/assembly/conf/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2012-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Contributors:
Red Hat, Inc. - initial API and implementation

-->
<configuration>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<contextListener class="org.eclipse.che.commons.logback.EnvironmentVariablesLogLevelPropagator"/>

<property name="max.retention.days" value="60" />

<jmxConfigurator/>

<include optional="true" file="${che.local.conf.dir}/logback/logback-additional-appenders.xml"/>
<include optional="true" file="${catalina.home}/conf/logback-additional-appenders.xml"/>
<!--Include appenders file depending on the variable `CHE_LOGS_APPENDERS_IMPL` -->
<include optional="false" file="${catalina.home}/conf/logback-${CHE_LOGS_APPENDERS_IMPL:-plaintext}-appenders.xml"/>

<logger name="org.apache.catalina.loader" level="OFF"/>
<logger name="org.apache.catalina.session.PersistentManagerBase" level="OFF"/>
<logger name="org.apache.jasper.servlet.TldScanner" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="32001"
rmiServerPortPlatform="32101"/>


<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
Expand Down Expand Up @@ -131,10 +130,6 @@
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false">


<!-- Provide Che Agent binaries (like workspace agent, terminal) -->
<Context docBase="${che.home}/lib" path="/agent-binaries" />

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
Expand All @@ -143,8 +138,6 @@
<Valve className="org.apache.catalina.valves.RemoteIpValve" protocolHeader="X-Forwarded-Proto"
internalProxies="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"/>

<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true" />

</Host>
</Engine>
</Service>
Expand Down
24 changes: 12 additions & 12 deletions assembly/assembly-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,21 @@
<packaging>pom</packaging>
<name>Che IDE :: Assemblies Tomcat</name>
<dependencies>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>assembly-che-tomcat8</artifactId>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>assembly-root-war</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>assembly-swagger-war</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.che</groupId>
<artifactId>assembly-workspace-loader-war</artifactId>
Expand All @@ -48,16 +58,6 @@
<artifactId>che-docs</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.che.lib</groupId>
<artifactId>che-swagger-war</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.eclipse.che.lib</groupId>
<artifactId>che-tomcat8-slf4j-logback</artifactId>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
Expand Down Expand Up @@ -100,8 +100,8 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.che.lib</groupId>
<artifactId>che-tomcat8-slf4j-logback</artifactId>
<groupId>org.eclipse.che</groupId>
<artifactId>assembly-che-tomcat8</artifactId>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
Expand Down
Loading