Skip to content

Commit

Permalink
Merge pull request #42 from akaene/main
Browse files Browse the repository at this point in the history
[#40] Use JOPA 2.0.0-SNAPSHOT
  • Loading branch information
blcham authored Dec 28, 2023
2 parents 84ed465 + 2f3a10d commit 280b171
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 52 deletions.
69 changes: 27 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,39 @@
<name>OFN Record Manager</name>
<packaging>jar</packaging>

<!-- The snapshot repositories are necessary only for JOPA 2.0.0-SNAPSHOT -->
<repositories>
<repository>
<id>central-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>17</jdk.version>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>

<cz.cvut.kbss.jopa.version>1.1.3</cz.cvut.kbss.jopa.version>
<cz.cvut.kbss.jopa.version>2.0.0-SNAPSHOT</cz.cvut.kbss.jopa.version>
<org.aspectj.version>1.9.20</org.aspectj.version>
<org.mockito.version>4.11.0</org.mockito.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
Expand Down Expand Up @@ -153,47 +179,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>dev.aspectj</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.13.1</version>
<configuration>
<complianceLevel>${jdk.version}</complianceLevel>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<aspectLibraries>
<aspectLibrary>
<groupId>cz.cvut.kbss.jopa</groupId>
<artifactId>jopa-impl</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${org.aspectj.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>main</id>
<phase>process-classes</phase>
<goals>
<goal>compile</goal>
<!-- use this goal to weave all your main classes -->
</goals>
</execution>
<execution>
<id>test</id>
<phase>process-test-classes</phase>
<goals>
<goal>test-compile</goal>
<!-- use this goal to weave all your test classes -->
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/cz/cvut/kbss/study/config/AppConfig.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package cz.cvut.kbss.study.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class AppConfig {
}
6 changes: 1 addition & 5 deletions src/main/java/cz/cvut/kbss/study/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import cz.cvut.kbss.study.model.util.HasDerivableUri;
import cz.cvut.kbss.study.util.Constants;
import cz.cvut.kbss.study.util.IdentificationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.crypto.password.PasswordEncoder;

import java.io.Serializable;
Expand All @@ -27,8 +25,6 @@
@OWLClass(iri = Vocabulary.s_c_user)
public class User implements HasDerivableUri, Serializable {

private static final Logger LOG = LoggerFactory.getLogger(User.class);

@Id
private URI uri;

Expand Down Expand Up @@ -191,7 +187,7 @@ public void encodePassword(PasswordEncoder encoder) {
if (password == null || password.isEmpty()) {
throw new IllegalStateException("Cannot encode an empty password.");
}
this.password = encoder.encode(password);
setPassword(encoder.encode(password));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

import static org.mockito.Mockito.mock;

@TestConfiguration
@EnableAspectJAutoProxy(proxyTargetClass = true)
@ComponentScan(basePackages = {"cz.cvut.kbss.study.persistence.dao"})
@Import({PersistenceConfig.class, TestPersistenceFactory.class, TestFormGenPersistenceFactory.class})
@EnableTransactionManagement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@EnableAspectJAutoProxy(proxyTargetClass = true)
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {TestServiceConfig.class, TestPersistenceConfig.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
Expand Down

0 comments on commit 280b171

Please sign in to comment.