2017/05/17

自転車タイヤのサイズ表記の見方

 700 × 25 C

700 → タイヤの外径を、ミリメートルで示しています。
25 → タイヤの幅(太さ)を、ミリメートルで示しています。
C → リム(鉄部分?)の大きさ
を表す記号です

2017/05/07

exec-maven-plugin java angular

pomファイルに下記を追加:
<build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.example.DemoApplication</mainClass>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <workingDirectory>${project.basedir}/src/main/angular</workingDirectory>
                    <executable>ng.cmd</executable>
                    <arguments>
                        <argument>build</argument>
                        <argument>--watch</argument>
                        <argument>--output-path=${project.basedir}/src/main/resources/static</argument>
                    </arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>


IDEのdebug configurationのmaven goadsに
exec:exec
を記載してangular buildを実行する
exec:javaでspringを実行する

 うまくいきました!!
次はangularのhot swapping ね!!

2017/05/06

spring-boot:run does not stop the tomcat

eclipseでmvn spring-boot:run を停止して、tomcatがまだ生きる

the port has been usedになる。


The best way to "fix" that is to not do it. Why would you need to run a maven goal from eclipse when you can just right click in the main class and Run As->Java Application?

boot dashboardも回避できる。
=> boot dashboardの仕組みは?単純に実行したことを思えたかな?
   あとで調べる

spring-boot hot swapping にする

・pomフィアルに下記を追記する

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>
  
・IDEの自動ビルドを有効にする


他に、devtoolsはcacheを無効にしている。
properties.put("spring.thymeleaf.cache", "false");
properties.put("spring.freemarker.cache", "false");
properties.put("spring.groovy.template.cache", "false");
properties.put("spring.mustache.cache", "false");
properties.put("server.session.persistent", "true");
properties.put("spring.h2.console.enabled", "true");
properties.put("spring.resources.cache-period", "0");
properties.put("spring.resources.chain.cache", "false");
properties.put("spring.template.provider.cache", "false");
properties.put("spring.mvc.log-resolved-exception", "true");
properties.put("server.jsp-servlet.init-parameters.development", "true");

また、
By default, any entry on the classpath that points to a folder will be monitored for changes. Note that certain resources such as static assets and view templates do not need to restart the application.

HERE:

 https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#using-boot-devtools-restart-exclude