Skip to content

Commit 8895006

Browse files
committed
Extremely simplified webissues project
0 parents  commit 8895006

11 files changed

Lines changed: 598 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
28+
- name: Build and test with coverage
29+
run: |
30+
BUILD_OK=true
31+
TEST_OK=true
32+
COVERAGE_OK=true
33+
34+
# Build
35+
if ! mvn -B clean compile -Dmaven.test.skip=true -Djava.awt.headless=true 2>&1; then
36+
BUILD_OK=false
37+
echo "::warning::Build failed — legacy code may need updates for Java 17"
38+
fi
39+
40+
# Test + JaCoCo
41+
if $BUILD_OK; then
42+
if ! mvn -B test -Djava.awt.headless=true 2>&1; then
43+
TEST_OK=false
44+
echo "::warning::Some tests failed"
45+
fi
46+
fi
47+
48+
# Coverage check
49+
if $BUILD_OK && $TEST_OK; then
50+
if ! mvn -B verify -Dmaven.test.skip=true -Djava.awt.headless=true 2>&1; then
51+
COVERAGE_OK=false
52+
echo "::warning::Coverage below 100%"
53+
fi
54+
fi
55+
56+
echo "BUILD_OK=$BUILD_OK" >> $GITHUB_ENV
57+
echo "TEST_OK=$TEST_OK" >> $GITHUB_ENV
58+
echo "COVERAGE_OK=$COVERAGE_OK" >> $GITHUB_ENV
59+
60+
- name: Coverage summary
61+
if: always()
62+
run: |
63+
echo "## CI Status" >> $GITHUB_STEP_SUMMARY
64+
echo "| Step | Status |" >> $GITHUB_STEP_SUMMARY
65+
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
66+
[ "$BUILD_OK" = "true" ] && echo "| Build | ✅ |" >> $GITHUB_STEP_SUMMARY || echo "| Build | ❌ |" >> $GITHUB_STEP_SUMMARY
67+
[ "$TEST_OK" = "true" ] && echo "| Tests | ✅ |" >> $GITHUB_STEP_SUMMARY || echo "| Tests | ❌ |" >> $GITHUB_STEP_SUMMARY
68+
[ "$COVERAGE_OK" = "true" ] && echo "| Coverage 100% | ✅ |" >> $GITHUB_STEP_SUMMARY || echo "| Coverage 100% | ❌ |" >> $GITHUB_STEP_SUMMARY
69+
70+
if [ -f target/site/jacoco/jacoco.csv ]; then
71+
echo "" >> $GITHUB_STEP_SUMMARY
72+
echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY
73+
echo '```' >> $GITHUB_STEP_SUMMARY
74+
awk -F',' 'NR>1 {missed+=$4; covered+=$5} END {total=missed+covered; if(total>0) printf "Line Coverage: %d/%d (%.1f%%)\nMissed: %d lines\n", covered, total, covered*100/total, missed; else print "No coverage data"}' target/site/jacoco/jacoco.csv >> $GITHUB_STEP_SUMMARY
75+
echo '```' >> $GITHUB_STEP_SUMMARY
76+
echo "" >> $GITHUB_STEP_SUMMARY
77+
echo "### Per-class" >> $GITHUB_STEP_SUMMARY
78+
echo '| Class | Coverage | Lines |' >> $GITHUB_STEP_SUMMARY
79+
echo '|-------|----------|-------|' >> $GITHUB_STEP_SUMMARY
80+
awk -F',' 'NR>1 {total=$4+$5; if(total>0) pct=$5*100/total; else pct=100; printf "| %s.%s | %.0f%% | %d/%d |\n", $2, $3, pct, $5, total}' target/site/jacoco/jacoco.csv >> $GITHUB_STEP_SUMMARY
81+
fi
82+
83+
- name: Upload coverage
84+
if: always()
85+
uses: codecov/codecov-action@v4
86+
with:
87+
file: target/site/jacoco/jacoco.xml
88+
fail_ci_if_error: false
89+
env:
90+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/nbactions.xml
2+
/nb-configuration.xml.idea

CLAUDE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# webissues_simple — Extremely simplified webissues project
2+
3+
## About
4+
5+
Extremely simplified webissues project
6+
7+
## Prerequisites
8+
9+
- JDK 8+
10+
- Maven 3.x
11+
12+
## Build & Run
13+
14+
```bash
15+
mvn clean install
16+
mvn test
17+
```
18+
19+
## Development Guidelines
20+
21+
### Code Style
22+
- Follow standard Java conventions
23+
- Keep code clean and well-organized
24+
- Use meaningful variable and method names
25+
26+
### Git Workflow
27+
- Write clear, descriptive commit messages
28+
- One logical change per commit
29+
- Test before committing
30+
31+
### Testing
32+
- Write tests for new functionality
33+
- Run the full test suite before pushing
34+
- Keep tests focused and independent

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
webissues
2+
=========
3+
4+
Simple spring-based web application. Tested with Apache Tomcat 7.0.40.
5+

pom.xml

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>ru.spb.petrk</groupId>
6+
<artifactId>webissues</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<packaging>war</packaging>
9+
10+
<name>webissues</name>
11+
12+
<properties>
13+
<spring.version>6.2.6</spring.version>
14+
<spring.security.version>6.4.4</spring.security.version>
15+
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>javax.servlet</groupId>
23+
<artifactId>jstl</artifactId>
24+
<version>1.2</version>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>org.glassfish.web</groupId>
29+
<artifactId>jstl-impl</artifactId>
30+
<version>1.2</version>
31+
<exclusions>
32+
<exclusion>
33+
<artifactId>servlet-api</artifactId>
34+
<groupId>javax.servlet</groupId>
35+
</exclusion>
36+
<exclusion>
37+
<artifactId>jsp-api</artifactId>
38+
<groupId>javax.servlet.jsp</groupId>
39+
</exclusion>
40+
<exclusion>
41+
<artifactId>jstl-api</artifactId>
42+
<groupId>javax.servlet.jsp.jstl</groupId>
43+
</exclusion>
44+
</exclusions>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>javax</groupId>
49+
<artifactId>javaee-web-api</artifactId>
50+
<version>6.0</version>
51+
<scope>provided</scope>
52+
</dependency>
53+
54+
<dependency>
55+
<groupId>org.springframework</groupId>
56+
<artifactId>spring-core</artifactId>
57+
<version>${spring.version}</version>
58+
</dependency>
59+
60+
<dependency>
61+
<groupId>org.springframework</groupId>
62+
<artifactId>spring-context</artifactId>
63+
<version>${spring.version}</version>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>org.springframework</groupId>
68+
<artifactId>spring-beans</artifactId>
69+
<version>${spring.version}</version>
70+
</dependency>
71+
72+
<dependency>
73+
<groupId>org.springframework.security</groupId>
74+
<artifactId>spring-security-core</artifactId>
75+
<version>${spring.security.version}</version>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>org.springframework.security</groupId>
80+
<artifactId>spring-security-web</artifactId>
81+
<version>${spring.security.version}</version>
82+
</dependency>
83+
84+
<dependency>
85+
<groupId>org.springframework.security</groupId>
86+
<artifactId>spring-security-config</artifactId>
87+
<version>${spring.security.version}</version>
88+
</dependency>
89+
90+
<dependency>
91+
<groupId>org.springframework.security</groupId>
92+
<artifactId>spring-security-taglibs</artifactId>
93+
<version>${spring.security.version}</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>org.springframework</groupId>
98+
<artifactId>spring-web</artifactId>
99+
<version>${spring.version}</version>
100+
</dependency>
101+
102+
<dependency>
103+
<groupId>org.springframework</groupId>
104+
<artifactId>spring-webmvc</artifactId>
105+
<version>${spring.version}</version>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>org.springframework</groupId>
110+
<artifactId>spring-orm</artifactId>
111+
<version>${spring.version}</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>org.springframework.data</groupId>
116+
<artifactId>spring-data-jpa</artifactId>
117+
<version>[1.11.22,)</version>
118+
</dependency>
119+
120+
<dependency>
121+
<groupId>org.hibernate</groupId>
122+
<artifactId>hibernate-core</artifactId>
123+
<version>3.6.10.Final</version>
124+
</dependency>
125+
126+
<dependency>
127+
<groupId>org.hibernate</groupId>
128+
<artifactId>hibernate-entitymanager</artifactId>
129+
<version>3.6.10.Final</version>
130+
<exclusions>
131+
<exclusion>
132+
<groupId>cglib</groupId>
133+
<artifactId>cglib</artifactId>
134+
</exclusion>
135+
<exclusion>
136+
<groupId>dom4j</groupId>
137+
<artifactId>dom4j</artifactId>
138+
</exclusion>
139+
</exclusions>
140+
</dependency>
141+
142+
<dependency>
143+
<groupId>org.hibernate</groupId>
144+
<artifactId>hibernate-ehcache</artifactId>
145+
<version>3.6.10.Final</version>
146+
</dependency>
147+
148+
<dependency>
149+
<groupId>org.javassist</groupId>
150+
<artifactId>javassist</artifactId>
151+
<version>3.17.1-GA</version>
152+
</dependency>
153+
154+
<dependency>
155+
<groupId>mysql</groupId>
156+
<artifactId>mysql-connector-java</artifactId>
157+
<version>5.1.49</version>
158+
<scope>runtime</scope>
159+
</dependency>
160+
161+
</dependencies>
162+
163+
<build>
164+
<plugins>
165+
<plugin>
166+
<groupId>org.apache.maven.plugins</groupId>
167+
<artifactId>maven-compiler-plugin</artifactId>
168+
<version>3.13.0</version>
169+
<configuration>
170+
<release>17</release>
171+
<compilerArguments>
172+
<endorseddirs>${endorsed.dir}</endorseddirs>
173+
</compilerArguments>
174+
</configuration>
175+
</plugin>
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-war-plugin</artifactId>
179+
<version>2.3</version>
180+
<configuration>
181+
<failOnMissingWebXml>false</failOnMissingWebXml>
182+
</configuration>
183+
</plugin>
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-dependency-plugin</artifactId>
187+
<version>2.1</version>
188+
<executions>
189+
<execution>
190+
<phase>validate</phase>
191+
<goals>
192+
<goal>copy</goal>
193+
</goals>
194+
<configuration>
195+
<outputDirectory>${endorsed.dir}</outputDirectory>
196+
<silent>true</silent>
197+
<artifactItems>
198+
<artifactItem>
199+
<groupId>javax</groupId>
200+
<artifactId>javaee-endorsed-api</artifactId>
201+
<version>6.0</version>
202+
<type>jar</type>
203+
</artifactItem>
204+
</artifactItems>
205+
</configuration>
206+
</execution>
207+
</executions>
208+
</plugin>
209+
210+
<!-- JaCoCo code coverage -->
211+
<plugin>
212+
<groupId>org.jacoco</groupId>
213+
<artifactId>jacoco-maven-plugin</artifactId>
214+
<version>0.8.12</version>
215+
<executions>
216+
<execution>
217+
<id>prepare-agent</id>
218+
<goals><goal>prepare-agent</goal></goals>
219+
</execution>
220+
<execution>
221+
<id>report</id>
222+
<phase>test</phase>
223+
<goals><goal>report</goal></goals>
224+
</execution>
225+
<execution>
226+
<id>check</id>
227+
<phase>verify</phase>
228+
<goals><goal>check</goal></goals>
229+
<configuration>
230+
<rules>
231+
<rule>
232+
<element>BUNDLE</element>
233+
<limits>
234+
<limit>
235+
<counter>LINE</counter>
236+
<value>COVEREDRATIO</value>
237+
<minimum>1.00</minimum>
238+
</limit>
239+
</limits>
240+
</rule>
241+
</rules>
242+
</configuration>
243+
</execution>
244+
</executions>
245+
</plugin>
246+
</plugins>
247+
</build>
248+
249+
</project>

0 commit comments

Comments
 (0)