Skip to content

Commit c2d6b2e

Browse files
dmealingclaude
andcommitted
Enable web and demo modules compilation with comprehensive Java 21 modernization
This commit restores the web and demo modules to the build by addressing extensive API changes and modernizing configurations for Java 21 compatibility. ## Web Module Modernization - Replace deprecated AttributeDef with StringAttribute.create() pattern - Update MetaDataLoader.findMetaObject() to MetaDataRegistry.findMetaObject() - Fix ValueException abstract class usage with InvalidValueException - Add MetaView constructor subtype requirement ("web") - Create Param utility class to replace missing dependencies - Replace URLConstructor with manual URL construction - Update MetaField.getLength() usage with default fallback ## Demo Module Overhaul - Remove obsolete Groovy-based code generation (gmaven-plugin) - Update Spring Framework versions from mixed 3.x/5.x to consistent 5.3.31 - Modernize metadata XML with v3 schema namespace - Create POJO model classes (Base, Store, Tank, Breed, Fish) - Add Claude AI development guides for modern MetaObjects usage - Clean up conflicting and deprecated dependencies ## Build System - Uncomment web and demo modules in reactor build - Update module versions from 5.0.0-SNAPSHOT to 5.1.0-SNAPSHOT - Ensure all 9 modules compile successfully with Java 21 ## Results - Complete project builds successfully in ~5.8 seconds - All modules now compile with modern Java 21 APIs - Web module: 16 files, Demo module: 7 files compiling cleanly - Ready for future MetaObjects Maven plugin integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 80bed9a commit c2d6b2e

23 files changed

Lines changed: 3000 additions & 77 deletions

demo/01-MetaObjects-Developer-Guide.md

Lines changed: 456 additions & 0 deletions
Large diffs are not rendered by default.

demo/02-Maven-Configuration-Guide.md

Lines changed: 613 additions & 0 deletions
Large diffs are not rendered by default.

demo/03-Best-Practices-Advanced-Patterns.md

Lines changed: 628 additions & 0 deletions
Large diffs are not rendered by default.

demo/04-Complete-Project-Example.md

Lines changed: 1018 additions & 0 deletions
Large diffs are not rendered by default.

demo/pom.xml

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.draagon</groupId>
66
<artifactId>metaobjects</artifactId>
7-
<version>5.0.0-SNAPSHOT</version>
7+
<version>5.1.0-SNAPSHOT</version>
88
</parent>
99

1010
<groupId>com.draagon</groupId>
@@ -17,86 +17,54 @@
1717

1818
<build>
1919
<plugins>
20-
<plugin>
21-
<groupId>org.codehaus.gmaven</groupId>
22-
<artifactId>gmaven-plugin</artifactId>
23-
<version>1.4</version>
24-
<executions>
25-
<execution>
26-
<phase>generate-sources</phase>
27-
<goals>
28-
<goal>execute</goal>
29-
</goals>
30-
<configuration>
31-
<properties>
32-
<template>${project.basedir}/src/main/resources/codegen/objectCodegen.gtm</template>
33-
<sourceDir>${project.basedir}/src/main/resources/</sourceDir>
34-
<input>metadata/fishstore-metadata.xml</input>
35-
<output>${project.build.sourceDirectory}/com/draagon/meta/demo/fishstore/model/</output>
36-
<!-- prefix></prefix -->
37-
<suffix>.java</suffix>
38-
<package>com.draagon.meta.demo.fishstore</package>
39-
</properties>
40-
<source>${project.basedir}/src/main/resources/codegen/objectCodegen.groovy</source>
41-
</configuration>
42-
</execution>
43-
</executions>
44-
</plugin>
20+
<!-- TODO: Add MetaObjects Maven Plugin when it supports proper code generation -->
4521
</plugins>
4622
</build>
4723

4824
<dependencies>
25+
<!-- MetaObjects Dependencies -->
4926
<dependency>
50-
<groupId>org.codehaus.gmaven.runtime</groupId>
51-
<artifactId>gmaven-runtime-1.7</artifactId>
52-
<version>1.3</version>
53-
<exclusions>
54-
<exclusion>
55-
<groupId>org.codehaus.groovy</groupId>
56-
<artifactId>groovy-all</artifactId>
57-
</exclusion>
58-
</exclusions>
59-
</dependency>
60-
<dependency>
61-
<groupId>org.codehaus.groovy</groupId>
62-
<artifactId>groovy-all</artifactId>
63-
<version>2.4.21</version>
27+
<groupId>com.draagon</groupId>
28+
<artifactId>metaobjects-omdb</artifactId>
29+
<version>${project.version}</version>
6430
</dependency>
6531
<dependency>
6632
<groupId>com.draagon</groupId>
67-
<artifactId>metaobjects-omdb</artifactId>
33+
<artifactId>metaobjects-web</artifactId>
6834
<version>${project.version}</version>
6935
</dependency>
36+
37+
<!-- Spring Framework - Use consistent version -->
7038
<dependency>
7139
<groupId>org.springframework</groupId>
7240
<artifactId>spring-beans</artifactId>
73-
<version>5.2.22.RELEASE</version>
74-
<type>jar</type>
41+
<version>5.3.31</version>
7542
</dependency>
7643
<dependency>
7744
<groupId>org.springframework</groupId>
7845
<artifactId>spring-jdbc</artifactId>
79-
<version>3.1.2.RELEASE</version>
80-
<type>jar</type>
46+
<version>5.3.31</version>
8147
</dependency>
8248
<dependency>
8349
<groupId>org.springframework</groupId>
8450
<artifactId>spring-tx</artifactId>
85-
<version>3.1.2.RELEASE</version>
86-
<type>jar</type>
51+
<version>5.3.31</version>
8752
</dependency>
8853
<dependency>
8954
<groupId>org.springframework</groupId>
9055
<artifactId>spring-webmvc</artifactId>
91-
<version>5.2.20.RELEASE</version>
92-
<type>jar</type>
56+
<version>5.3.31</version>
9357
</dependency>
58+
59+
<!-- Java EE API -->
9460
<dependency>
9561
<groupId>javax</groupId>
9662
<artifactId>javaee-api</artifactId>
9763
<version>${javaee.api.version}</version>
9864
<scope>provided</scope>
9965
</dependency>
66+
67+
<!-- Database -->
10068
<dependency>
10169
<groupId>org.apache.derby</groupId>
10270
<artifactId>derby</artifactId>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.draagon.meta.demo.fishstore;
2+
3+
/**
4+
* Base class for all fishstore entities
5+
*/
6+
public abstract class Base {
7+
private Long id;
8+
9+
public Long getId() {
10+
return id;
11+
}
12+
13+
public void setId(Long id) {
14+
this.id = id;
15+
}
16+
17+
@Override
18+
public boolean equals(Object obj) {
19+
if (this == obj) return true;
20+
if (obj == null || getClass() != obj.getClass()) return false;
21+
Base base = (Base) obj;
22+
return id != null ? id.equals(base.id) : base.id == null;
23+
}
24+
25+
@Override
26+
public int hashCode() {
27+
return id != null ? id.hashCode() : 0;
28+
}
29+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.draagon.meta.demo.fishstore;
2+
3+
/**
4+
* Represents a fish breed
5+
*/
6+
public class Breed extends Base {
7+
private String name;
8+
private Integer agressionLevel;
9+
10+
public String getName() {
11+
return name;
12+
}
13+
14+
public void setName(String name) {
15+
this.name = name;
16+
}
17+
18+
public Integer getAgressionLevel() {
19+
return agressionLevel;
20+
}
21+
22+
public void setAgressionLevel(Integer agressionLevel) {
23+
this.agressionLevel = agressionLevel;
24+
}
25+
26+
@Override
27+
public String toString() {
28+
return "Breed{" +
29+
"id=" + getId() +
30+
", name='" + name + '\'' +
31+
", agressionLevel=" + agressionLevel +
32+
'}';
33+
}
34+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.draagon.meta.demo.fishstore;
2+
3+
/**
4+
* Represents a fish
5+
*/
6+
public class Fish extends Base {
7+
private String breedName;
8+
private Breed breed;
9+
private Integer length;
10+
private Integer weight;
11+
12+
public String getBreedName() {
13+
return breedName;
14+
}
15+
16+
public void setBreedName(String breedName) {
17+
this.breedName = breedName;
18+
}
19+
20+
public Breed getBreed() {
21+
return breed;
22+
}
23+
24+
public void setBreed(Breed breed) {
25+
this.breed = breed;
26+
}
27+
28+
public Integer getLength() {
29+
return length;
30+
}
31+
32+
public void setLength(Integer length) {
33+
this.length = length;
34+
}
35+
36+
public Integer getWeight() {
37+
return weight;
38+
}
39+
40+
public void setWeight(Integer weight) {
41+
this.weight = weight;
42+
}
43+
44+
@Override
45+
public String toString() {
46+
return "Fish{" +
47+
"id=" + getId() +
48+
", breedName='" + breedName + '\'' +
49+
", length=" + length +
50+
", weight=" + weight +
51+
'}';
52+
}
53+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.draagon.meta.demo.fishstore;
2+
3+
/**
4+
* Represents a fish store
5+
*/
6+
public class Store extends Base {
7+
private String name;
8+
private Integer maxTanks;
9+
10+
public String getName() {
11+
return name;
12+
}
13+
14+
public void setName(String name) {
15+
this.name = name;
16+
}
17+
18+
public Integer getMaxTanks() {
19+
return maxTanks;
20+
}
21+
22+
public void setMaxTanks(Integer maxTanks) {
23+
this.maxTanks = maxTanks;
24+
}
25+
26+
@Override
27+
public String toString() {
28+
return "Store{" +
29+
"id=" + getId() +
30+
", name='" + name + '\'' +
31+
", maxTanks=" + maxTanks +
32+
'}';
33+
}
34+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.draagon.meta.demo.fishstore;
2+
3+
import java.util.List;
4+
5+
/**
6+
* Represents a fish tank
7+
*/
8+
public class Tank extends Base {
9+
private Integer num;
10+
private Integer maxFish;
11+
private List<Fish> fishes;
12+
13+
public Integer getNum() {
14+
return num;
15+
}
16+
17+
public void setNum(Integer num) {
18+
this.num = num;
19+
}
20+
21+
public Integer getMaxFish() {
22+
return maxFish;
23+
}
24+
25+
public void setMaxFish(Integer maxFish) {
26+
this.maxFish = maxFish;
27+
}
28+
29+
public List<Fish> getFishes() {
30+
return fishes;
31+
}
32+
33+
public void setFishes(List<Fish> fishes) {
34+
this.fishes = fishes;
35+
}
36+
37+
@Override
38+
public String toString() {
39+
return "Tank{" +
40+
"id=" + getId() +
41+
", num=" + num +
42+
", maxFish=" + maxFish +
43+
", fishCount=" + (fishes != null ? fishes.size() : 0) +
44+
'}';
45+
}
46+
}

0 commit comments

Comments
 (0)