小编spa*_*row的帖子

如何在另一个项目中向Spring Boot Jar添加依赖项?

我有一个Spring Boot应用程序,我已经创建了一个Jar.以下是我的pom.xml:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
        <version>2.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <!-- WebJars -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.7</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.6.2</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

我想在我的其他应用程序中使用此Jar,因此将此jar添加到我的应用程序中.但是,当我在那个Jar中调用一个方法时,它正在抛出一个ClassNotFoundException.

我该如何解决这个问题?如何向Spring Boot JAR添加依赖项?

jar maven spring-boot spring-boot-maven-plugin

46
推荐指数
3
解决办法
5万
查看次数

我如何启动Apache Cassandra作为服务?

我在使用Ubuntu 14的Amazon实例上安装了Apache Cassandra 2.1.0.是否可以启动Apache Cassandra作为服务?

cassandra

10
推荐指数
2
解决办法
2万
查看次数

如何重置 JWT 令牌过期时间?

我创建了一个 JWT 令牌以及过期时间以用于身份验证目的。每次当应用程序中出现 url 时,我都会检查令牌。我想增加 JWT 令牌的过期时间。以下是我的做法。但令牌将通过创建令牌时已设置的过期时间来过期。

//creating JWT token only once when user logged in

String jwtToken = new String(Jwts.builder().setSubject(user.getUserId())
                    .setExpiration(expTime).setIssuedAt(new Date())
                    .signWith(SignatureAlgorithm.HS256, "secretkey").compact());

// checking the presence of token every time

Claims claims = Jwts.parser().setSigningKey("secretkey")
                            .parseClaimsJws(jwtToken).getBody();

claims.setExpiration(time); // trying to reset the expiration time
Run Code Online (Sandbox Code Playgroud)

我不知道出了什么问题。任何帮助将非常感激。

java jwt

7
推荐指数
2
解决办法
4万
查看次数

我可以在<p>标签中使用ng-model吗?

我是angular-js的新手,我认为这是一个基本问题,如何从angular-js中获取段落标记的值?我尝试使用ng-model但没有给出价值.任何人都可以帮助我吗?

angularjs

3
推荐指数
1
解决办法
1万
查看次数

如何将字符串转换为格式的日期yyyy-MM-dd HH:MM:ss

我有一个类似的字符串"2015-07-16 17:07:21".我想将其转换为相同格式的日期.我试过这样的事情:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");
Date date = sdf.parse("2015-07-16 17:07:21"); 
Run Code Online (Sandbox Code Playgroud)

但输出的格式不同Thu Jul 16 17:00:21 IST 2015.我怎样才能让它按需要运行.谁能帮我.我知道这可能是重复但我没有找到任何运气.

java date simpledateformat

2
推荐指数
1
解决办法
3万
查看次数