1
このpom.xmlファイルでSpring Tool Suiteバージョン3.9.1.RELEASEで生成された基本的なSpringBootアプリケーションがありますが、mvn clean package
を実行するとjarファイルがターゲットフォルダ内に生成されず、でも、他のフォルダが生成され、アプリケーションがOKに実行されている私は、Eclipsejarファイルが生成されていません
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.telefonica.handler</groupId>
<artifactId>telefonicaTeltonikaHandler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>telefonicaTeltonikaHandler</name>
<description>telefonica Teltonika Handler</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Logging dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
内でそれを実行したときにこれがメインクラスです:
@SpringBootApplication
public class TelefonicaTeltonikaHandlerApplication implements CommandLineRunner {
public static final Logger LOG = LoggerFactory.getLogger (TelefonicaTeltonikaHandlerApplication.class);
private final static int TCP_PORT = 5202;
private final static int BUFFER_SIZE = 2048;
private DatagramSocket socket = null;
private byte[] ackimei = { 0x01 };
public static void main(String[] args) {
SpringApplication app = new SpringApplication(TelefonicaTeltonikaHandlerApplication.class);
app.run(args);
}
@Override
public void run(String... arg0) throws Exception {
socket = new DatagramSocket(TCP_PORT);
byte[] receiveData = new byte[BUFFER_SIZE];
byte[] sendData = new byte[BUFFER_SIZE];
while (true) {
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
socket.receive(receivePacket);
String sentence = new String(receivePacket.getData(), 0, receivePacket.getLength());
LOG.info("recived [" + sentence + "] from " + receivePacket.getAddress());
//DataInputStream dis = new DataInputStream(new ByteArrayInputStream(receivePacket.getData()));
InetAddress IPAddress = receivePacket.getAddress();
int port = receivePacket.getPort();
DatagramPacket sendPacket = new DatagramPacket(receiveData, receiveData.length, IPAddress, receivePacket.getPort());
socket.send (sendPacket);
}
}
}
、ここでビルドログ:
MacBook-Pro-de-lopes:telefonicaTeltonikaHandler lopes$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building telefonicaTeltonikaHandler 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ telefonicaTeltonikaHandler ---
[INFO] Deleting /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ telefonicaTeltonikaHandler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ telefonicaTeltonikaHandler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ telefonicaTeltonikaHandler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ telefonicaTeltonikaHandler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ telefonicaTeltonikaHandler ---
[INFO] Surefire report directory: /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests], using SpringBootContextLoader
2017-12-13 15:31 [main] INFO o.s.t.c.s.AbstractContextLoader - Could not detect default resource locations for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
2017-12-13 15:31 [main] INFO o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests]: telefonicaTeltonikaHandlerApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.telefonica.handler.telefonicaTeltonikaHandlerApplication for test class com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext]
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test[email protected]46944ca9, org.springframework.boot.test.a[email protected]22bac7bc, org.springfra[email protected]63798ca7, org.springframew[email protected]4612b856, org.sp[email protected]22875539, org.springframework.boot.test.autoconfi[email protected]5674e1f2, org.springframework[email protected]79c7532f, org.springframework.boot.test.autoconfigure.web.ser[email protected], org.spri[email protected]32f232a5, org.springf[email protected]43f82e78, org.springframework.boot.test.autoconfi[email protected]e54303]
Running com.telefonica.handler.TCPTest
. ____ _ __ _ _
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ))))
' |____| .__|_| |_|_| |_\__, |////
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
2017-12-13 15:31 [main] INFO o.a.m.surefire.booter.ForkedBooter - Starting ForkedBooter v2.18.1 on MacBook-Pro-de-lopes.local with PID 17215 (started by lopes in /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler)
2017-12-13 15:31 [main] INFO o.a.m.surefire.booter.ForkedBooter - No active profile set, falling back to default profiles: default
2017-12-13 15:31 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.spring[email protected]669513d8: startup date [Wed Dec 13 15:31:06 CET 2017]; root of context hierarchy
2017-12-13 15:31 [main] INFO o.s.i.config.IntegrationRegistrar - No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
WARNING: An illegal reflective access operation has occurred
SUREFIRE-859: WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/Users/lopes/.m2/repository/org/springframework/spring-core/4.3.13.RELEASE/spring-core-4.3.13.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2017-12-13 15:31 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2017-12-13 15:31 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$883d35a8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'integrationGlobalProperties' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'integrationGlobalProperties' of type [java.util.Properties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.s.c.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler'
2017-12-13 15:31 [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
2017-12-13 15:31 [main] INFO o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 0
2017-12-13 15:31 [main] INFO o.s.i.endpoint.EventDrivenConsumer - Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2017-12-13 15:31 [main] INFO o.s.i.c.PublishSubscribeChannel - Channel 'application.errorChannel' has 1 subscriber(s).
2017-12-13 15:31 [main] INFO o.s.i.endpoint.EventDrivenConsumer - started _org.springframework.integration.errorLogger
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ telefonicaTeltonikaHandler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ telefonicaTeltonikaHandler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ telefonicaTeltonikaHandler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ telefonicaTeltonikaHandler ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ telefonicaTeltonikaHandler ---
[INFO] Surefire report directory: /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests], using SpringBootContextLoader
2017-12-13 15:31 [main] INFO o.s.t.c.s.AbstractContextLoader - Could not detect default resource locations for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
2017-12-13 15:31 [main] INFO o.s.t.c.s.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests]: telefonicaTeltonikaHandlerApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.telefonica.handler.telefonicaTeltonikaHandlerApplication for test class com.telefonica.handler.telefonicaTeltonikaHandlerApplicationTests
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext]
2017-12-13 15:31 [main] INFO o.s.b.t.c.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test[email protected]46944ca9, org.springframework.boot.test.a[email protected]22bac7bc, org.springfra[email protected]63798ca7, org.springframew[email protected]4612b856, org.sp[email protected]22875539, org.springframework.boot.test.autoconfi[email protected]5674e1f2, org.springframework[email protected]79c7532f, org.springframework.boo[email protected]2a448449, org.spri[email protected]32f232a5, org.springf[email protected]43f82e78, org.springframework.boot.test.autoconfi[email protected]e54303]
Running com.telefonica.handler.TCPTest
. ____ _ __ _ _
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ))))
' |____| .__|_| |_|_| |_\__, |////
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
2017-12-13 15:31 [main] INFO o.a.m.surefire.booter.ForkedBooter - Starting ForkedBooter v2.18.1 on MacBook-Pro-de-ricard.local with PID 17215 (started by lopes in /Users/lopes/Documents/workspace-sts-3.9.1.RELEASE/telefonicaTeltonikaHandler)
2017-12-13 15:31 [main] INFO o.a.m.surefire.booter.ForkedBooter - No active profile set, falling back to default profiles: default
2017-12-13 15:31 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.spring[email protected]669513d8: startup date [Wed Dec 13 15:31:06 CET 2017]; root of context hierarchy
2017-12-13 15:31 [main] INFO o.s.i.config.IntegrationRegistrar - No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
WARNING: An illegal reflective access operation has occurred
SUREFIRE-859: WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/Users/lopes/.m2/repository/org/springframework/spring-core/4.3.13.RELEASE/spring-core-4.3.13.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2017-12-13 15:31 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2017-12-13 15:31 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created.
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$883d35a8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'integrationGlobalProperties' of type [org.springframework.beans.factory.config.PropertiesFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'integrationGlobalProperties' of type [java.util.Properties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-12-13 15:31 [main] INFO o.s.s.c.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler'
2017-12-13 15:31 [main] INFO o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
2017-12-13 15:31 [main] INFO o.s.c.s.DefaultLifecycleProcessor - Starting beans in phase 0
2017-12-13 15:31 [main] INFO o.s.i.endpoint.EventDrivenConsumer - Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2017-12-13 15:31 [main] INFO o.s.i.c.PublishSubscribeChannel - Channel 'application.errorChannel' has 1 subscriber(s).
2017-12-13 15:31 [main] INFO o.s.i.endpoint.EventDrivenConsumer - started _org.springframework.integration.errorLogger
ですか? –
いいえ、ビルド中に問題なし –
ビルドログの最後の行で質問を更新できますか –