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

Add skeleton poms. Fix shell check errors. #2

Merged
merged 2 commits into from
Nov 1, 2024
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
13 changes: 13 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,16 @@ jobs:
cache: maven
- name: Spotbugs
run: etc/scripts/spotbugs.sh
shellcheck:
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/[email protected]
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
cache: maven
- name: Shellcheck
run: etc/scripts/shellcheck.sh
40 changes: 40 additions & 0 deletions apps/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Oracle and/or its affiliates.

Licensed 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.

-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.labs</groupId>
<artifactId>helidon-labs-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>helidon-labs-apps</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Labs Apps</name>
<packaging>pom</packaging>

<!--
<modules>
<module>project1</module>
</modules>
-->

</project>
40 changes: 40 additions & 0 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Oracle and/or its affiliates.

Licensed 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.

-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.labs</groupId>
<artifactId>helidon-labs-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>helidon-labs-benchmarks</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Labs Benchmarks</name>
<packaging>pom</packaging>

<!--
<modules>
<module>project1</module>
</modules>
-->

</project>
3 changes: 2 additions & 1 deletion etc/scripts/checkstyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ mvn ${MAVEN_ARGS} checkstyle:checkstyle \
-f "${WS_DIR}"/pom.xml \
-Dcheckstyle.output.format="plain" \
-Dcheckstyle.output.file="${RESULT_FILE}"
> ${LOG_FILE} 2>&1 || (cat ${LOG_FILE} ; exit 1)
# shellcheck disable=SC2188
> "${LOG_FILE}" 2>&1 || (cat "${LOG_FILE}" ; exit 1)

grep "^\[ERROR\]" "${RESULT_FILE}" \
&& die "CHECKSTYLE ERROR" || echo "CHECKSTYLE OK"
16 changes: 10 additions & 6 deletions etc/scripts/owasp-dependency-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ trap on_error ERR
if [ -h "${0}" ] ; then
SCRIPT_PATH="$(readlink "${0}")"
else
# shellcheck disable=SC155
SCRIPT_PATH="${0}"
fi
readonly SCRIPT_PATH
Expand All @@ -40,22 +41,25 @@ readonly SCRIPT_PATH
WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)
readonly WS_DIR

# shellcheck disable=SC2155
readonly RESULT_FILE=$(mktemp -t XXXdependency-check-result)

die() { cat ${RESULT_FILE} ; echo "Dependency report in ${WS_DIR}/target" ; echo "${1}" ; exit 1 ;}
die() { cat "${RESULT_FILE}" ; echo "Dependency report in ${WS_DIR}/target" ; echo "${1}" ; exit 1 ;}

if [ "${PIPELINE}" = "true" ] ; then
# If in pipeline do a priming build before scan
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml clean install -DskipTests
# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} -f "${WS_DIR}"/pom.xml clean install -DskipTests
fi

# Setting NVD_API_KEY is not required but improves behavior of NVD API throttling

# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN org.owasp:dependency-check-maven:aggregate \
-f ${WS_DIR}/pom.xml \
-f "${WS_DIR}"/pom.xml \
-Dtop.parent.basedir="${WS_DIR}" \
-Dnvd-api-key=${NVD_API_KEY} \
> ${RESULT_FILE} || die "Error running the Maven command"
-Dnvd-api-key="${NVD_API_KEY}" \
> "${RESULT_FILE}" || die "Error running the Maven command"

grep -i "One or more dependencies were identified with known vulnerabilities" ${RESULT_FILE} \
grep -i "One or more dependencies were identified with known vulnerabilities" "${RESULT_FILE}" \
&& die "CVE SCAN ERROR" || echo "CVE SCAN OK"
3 changes: 2 additions & 1 deletion etc/scripts/spotbugs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ readonly SCRIPT_PATH
WS_DIR=$(cd $(dirname -- "${SCRIPT_PATH}") ; cd ../.. ; pwd -P)
readonly WS_DIR

mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
# shellcheck disable=SC2086
mvn ${MAVEN_ARGS} -f "${WS_DIR}"/pom.xml \
install -e \
-DskipTests \
-Dmaven.test.skip=true \
Expand Down
40 changes: 40 additions & 0 deletions hols/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Oracle and/or its affiliates.

Licensed 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.

-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.labs</groupId>
<artifactId>helidon-labs-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>helidon-labs-hols</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Labs HOLs</name>
<packaging>pom</packaging>

<!--
<modules>
<module>project1</module>
</modules>
-->

</project>
40 changes: 40 additions & 0 deletions incubator/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2024 Oracle and/or its affiliates.

Licensed 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.

-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.labs</groupId>
<artifactId>helidon-labs-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>helidon-labs-incubator</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Labs Incubator</name>
<packaging>pom</packaging>

<!--
<modules>
<module>project1</module>
</modules>
-->

</project>
68 changes: 13 additions & 55 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.helidon.projects</groupId>
<artifactId>myproject</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>io.helidon.labs</groupId>
<artifactId>helidon-labs-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Helidon Labs</name>
<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -35,7 +37,6 @@
<spotbugs.threshold>Medium</spotbugs.threshold>
<spotbugs.exclude>etc/spotbugs/exclude.xml</spotbugs.exclude>

<!-- Update these to latest versions -->
<version.lib.checkstyle>10.13.0</version.lib.checkstyle>
<version.plugin.checkstyle>3.3.1</version.plugin.checkstyle>
<version.plugin.dependency-check>10.0.4</version.plugin.dependency-check>
Expand Down Expand Up @@ -65,57 +66,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-libs</id>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${version.lib.mapstruct}</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<compilerArg>
-Amapstruct.suppressGeneratorTimestamp=true
</compilerArg>
<compilerArg>
-Amapstruct.suppressGeneratorVersionInfoComment=true
</compilerArg>
<compilerArg>
-Amapstruct.defaultComponentModel=jakarta-cdi
</compilerArg>
<compilerArg>
-Amapstruct.unmappedTargetPolicy=IGNORE
</compilerArg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.plugin.failsafe}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.directory}/classes</classesDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
Expand Down Expand Up @@ -213,6 +163,14 @@
</plugin>
</plugins>
</build>

<modules>
<module>apps</module>
<module>benchmarks</module>
<module>hols</module>
<module>incubator</module>
</modules>

<profiles>
<profile>
<id>copyright</id>
Expand Down
Loading