The local/ is excluded from Git. It can be used to seem like to private config, deployment code, etc.
mkdir local/
cd local/
ln -s ~/.l10n/config
ln -s ~/code/mojito-deploy/
https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html
Build a project with Maven
- Click Maven settings in the Maven tool window. Alternatively, from the main menu select File | Settings/Preferences | Build, Execution, Deployment |Build Tools | Maven.
- Click Maven and from the list, select Runner.
- On the Runner page, select Delegate IDE build/run actions to maven.
Some useful command
- mvn install -DskipTests -P'!frontend,!git-commit-id-plugin' --projects webapp --also-make
- mvn install -DskipTests -P'!frontend,!git-commit-id-plugin' --projects cli --also-make
- mvn clean install -DskipTests -P'!frontend,!git-commit-id-plugin' --projects webapp --also-make
This can be configured in Maven UI too.
mvn test -Dtest=LeveragingCommandTest#copyTMModeTargetBranchName -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
cd ..; mvn install -DskipTests -P'!frontend'; cd - ; mvn test -Dtest=LeveragingCommandTest#copyTMModeTargetBranchName -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
Edit configuration (run/debug ) > Remote JVM debugging > just name the config and use this to attach
The goal there is to reuse Intellij incremental build that is way faster but I couldn't get it to work properly
Import project as Maven project, but it shows an error with
Some attempt at making annotation processor and aspectj all work:
- Add dependency provided in common.pom org.immutables value ${immutables-value.version} provided
and in webapp.pom
org.hibernate hibernate-jpamodelgen ${hibernate.version} providedStart an HSQL Server:
java -cp ~/.m2/repository/org/hsqldb/hsqldb/2.5.2/hsqldb-2.5.2.jar org.hsqldb.server.Server --database.0 file:~/tmp/hsqldb/mojito --dbname.0 mojito
It should run on 9001
[Server@506e1b77]: 2023-12-15 00:09:46.887 HSQLDB server 2.6.0 is online on port 9001
Then use following properties:
spring.datasource.url=jdbc:hsqldb:hsql://localhost:9001/mojito
spring.jpa.hibernate.ddl-auto=create
spring.jpa.defer-datasource-initialization=false
spring.sql.init.mode=always
spring.sql.init.data-locations=classpath:/db/hsql/data.sql
For quick plain SQL query debugging
@Autowired JdbcTemplate jdbcTemplate;
jdbcTemplate.queryForList(
"select unix_timestamp(), unix_timestamp(mblob.created_date), current_timestamp, mblob.* from mblob ")
.forEach(System.out::println);
Investigate constraint errors
SELECT tc.constraint_name, tc.constraint_type, tc.table_name, kcu.column_name
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS kcu
ON tc.constraint_name = kcu.constraint_name
WHERE tc.constraint_name = 'SYS_CT_252844';