working jetty config
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -40,3 +40,6 @@ build/
|
||||
### nix / direnv
|
||||
.direnv
|
||||
result
|
||||
|
||||
### jetty
|
||||
.jetty/home
|
||||
|
||||
2
flake.lock
generated
2
flake.lock
generated
@@ -29,8 +29,8 @@
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
||||
38
flake.nix
38
flake.nix
@@ -3,10 +3,14 @@
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4";
|
||||
};
|
||||
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
outputs = inputs @ {
|
||||
flake-parts,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [];
|
||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||
@@ -95,13 +99,37 @@
|
||||
mermaid-cli
|
||||
openjdk
|
||||
jetty
|
||||
ant
|
||||
maven
|
||||
]
|
||||
++ latexPackages;
|
||||
|
||||
shellHook = ''
|
||||
shellHook =
|
||||
# bash
|
||||
''
|
||||
# jetty docs: https://jetty.org/docs/jetty/12.1/operations-guide/begin/index.html
|
||||
export JETTY_HOME="$(readlink -f .)/.jetty/home"
|
||||
export JETTY_BASE="$(readlink -f .)/.jetty/base"
|
||||
|
||||
mkdir -p "$JETTY_HOME" "$JETTY_BASE"
|
||||
for item in ${pkgs.jetty}/*; do
|
||||
ln -sf "$item" "$JETTY_HOME/"
|
||||
done
|
||||
|
||||
jetty() {
|
||||
mkdir -p $JETTY_BASE/webapps/
|
||||
ln -fs "$(readlink -f target/*.war)" $JETTY_BASE/webapps/
|
||||
|
||||
java \
|
||||
-Djetty.home="$JETTY_HOME" \
|
||||
-Djetty.base="$JETTY_BASE" \
|
||||
-jar $JETTY_HOME/start.jar $@
|
||||
}
|
||||
|
||||
jetty --add-modules=http,ee11-cdi,ee11-ext,ee11-deploy,ee11-environment,ee11-annotations,ee11-glassfish-jstl,ee11-jndi,ee11-jsp,ee11-jstl,ee11-plus,ee11-security,ee11-servlet,ee11-servlets,ee11-webapp,ee11-websocket-jakarta,ee11-websocket-jetty,ee11-websocket-jetty-client-webapp
|
||||
|
||||
echo "Usage Example:"
|
||||
echo "jetty ..."
|
||||
echo "jetty --add-modules=... # add modules"
|
||||
echo "jetty # run webserver"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
64
pom.xml
64
pom.xml
@@ -12,48 +12,70 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<project.report.sourceEncoding>UTF-8</project.report.sourceEncoding>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<junit.version>5.11.0-M2</junit.version>
|
||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||
<war-plugin.version>3.4.0</war-plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.platform</groupId>
|
||||
<artifactId>jakarta.jakartaee-web-api</artifactId>
|
||||
<version>11.0.0-M3</version>
|
||||
<version>11.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency><dependency>
|
||||
<groupId>org.jboss.weld.se</groupId>
|
||||
<artifactId>weld-se-core</artifactId>
|
||||
<version>6.0.0.Beta1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
<artifactId>jakarta.faces</artifactId>
|
||||
<version>4.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.enterprise</groupId>
|
||||
<artifactId>jakarta.enterprise.cdi-api</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.enterprise</groupId>
|
||||
<artifactId>jakarta.enterprise.cdi-el-api</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jboss.weld.servlet</groupId>
|
||||
<artifactId>weld-servlet-core</artifactId>
|
||||
<version>5.1.2.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<scope>provided</scope>
|
||||
<version>1.18.30</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>demo</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${compiler-plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</plugin> </plugins>
|
||||
<version>${war-plugin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
6
src/main/webapp/WEB-INF/beans.xml
Normal file
6
src/main/webapp/WEB-INF/beans.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
|
||||
version="4.0" bean-discovery-mode="annotated">
|
||||
</beans>
|
||||
@@ -3,11 +3,18 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
|
||||
version="6.0">
|
||||
|
||||
<context-param>
|
||||
<param-name>jakarta.faces.CONFIG_FILES</param-name>
|
||||
<param-value>/WEB-INF/faces-config.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>*.xhtml</url-pattern>
|
||||
|
||||
Reference in New Issue
Block a user