블로그 이미지

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday
2016. 4. 18. 18:03 maven

<build>
....
....
<resources>
         <resource>
             <directory>src/main/java</directory>
             <includes>                     
                 <include>**/*.xml</include>
                 <include>**/*.propertis</include>
                 <include>**/*.tld</include>
             </includes>
         </resource>
         <resource>
             <directory>src/main/resources</directory>
         </resource>        
     </resources>
 </build>

 

posted by 천상의날개
2016. 4. 18. 17:10 maven

<dependency>
   <groupId>target</groupId>
   <artifactId>target</artifactId>
   <version>1.0</version>
   <scope>system</scope>
   <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/target.jar</systemPath>
  </dependency>

 

posted by 천상의날개
2016. 2. 25. 16:32 maven

자바 컴파일 버전, tomcat 자동배포, xml포함 war로 묶는소스 포함.

<build>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
     <source>1.7</source>
     <target>1.7</target>
     <encoding>UTF-8</encoding>
    </configuration>
   </plugin>  
   <plugin> 
    <groupId>org.apache.tomcat.maven</groupId> 
    <artifactId>tomcat7-maven-plugin</artifactId> 
    <version>2.2</version> 
    <configuration> 
      <url>http://[targetIP]/manager/text</url> 
      <update>true</update>      
      <username>id</username>
            <password>pw</password>
      <path>/</path>
    </configuration>
   </plugin>   
  </plugins>
  <resources>
         <resource>
             <directory>src/main/java</directory>
             <includes>                     
                 <include>**/*.xml</include>
             </includes>
         </resource>
         <resource>
             <directory>src/main/resources</directory>
         </resource>
     </resources>
 </build>

프로젝트에서 오른쪽 클릭-> Run As-> RunConfigurations 선택
 mavenBuild 더블 클릭
 [base directory]의 위치를 [Browse Workspace..] 버튼으로 배포할 프로젝트 선택
 [goals]에  "clean tomcat7:deploy" 입력

 Run 버튼 클릭

posted by 천상의날개
2014. 5. 28. 08:37 maven

{userhome}\.m2\repository 에 내용을 삭제후 maven 프로젝트를 새로 생성한다.

예 : C:\Users\Administrator\.m2\repository

posted by 천상의날개
2014. 1. 11. 16:20 maven

<plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
     <archive>
      <addMavenDescriptor>false</addMavenDescriptor>
     </archive>
    </configuration>
   </plugin>

   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jarsigner-plugin</artifactId>
    <version>1.3</version>
    <executions>
     <execution>
      <id>sign</id>
      <goals>
       <goal>sign</goal>
      </goals>
     </execution>
    </executions>
    <configuration>
     <keystore>${basedir}\src\main\resources\test.keystore</keystore>
     <alias>testsys</alias>
     <storepass>pass</storepass>
     <keypass>pass</keypass>
    </configuration>
   </plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
     <appendAssemblyId>false</appendAssemblyId>
     <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
     </descriptorRefs>

     <outputDirectory>${basedir}\..\appletTest\WebContent\applet\</outputDirectory>
     <jarName>applet</jarName>
     <archive>
      <manifest>
       <addClasspath>true</addClasspath>
       <classpathPrefix>lib/</classpathPrefix>
       <mainClass>applet.TestApplet</mainClass>
      </manifest>
     </archive>

    </configuration>
   </plugin>

posted by 천상의날개
2014. 1. 11. 16:16 maven

<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.heyum</groupId>
 <artifactId>applet</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <dependencies>
  <dependency>
   <groupId>org.apache.httpcomponents</groupId>
   <artifactId>httpclient</artifactId>
   <version>4.3.1</version>
  </dependency>
 </dependencies>
 <build>
  <pluginManagement>
   <plugins>
    <plugin>
     <groupId>org.eclipse.m2e</groupId>
     <artifactId>lifecycle-mapping</artifactId>
     <version>1.0.0</version>
     <configuration>
      <lifecycleMappingMetadata>
       <pluginExecutions>
        <pluginExecution>
         <pluginExecutionFilter>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <versionRange>[1.0.0,)</versionRange>
          <goals>
           <goal>copy-dependencies</goal>
          </goals>
         </pluginExecutionFilter>
         <action>
          <ignore />
         </action>
        </pluginExecution>
       </pluginExecutions>
      </lifecycleMappingMetadata>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>

  <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
     <execution>
      <id>copy-dependencies</id>
      <phase>prepare-package</phase>
      <goals>
       <goal>copy-dependencies</goal>
      </goals>
      <configuration>
       <outputDirectory>${project.build.directory}/lib</outputDirectory>
       <overWriteReleases>false</overWriteReleases>
       <overWriteSnapshots>false</overWriteSnapshots>
       <overWriteIfNewer>true</overWriteIfNewer>
      </configuration>
     </execution>
    </executions>
   </plugin>   
  </plugins>
 </build>
</project>

posted by 천상의날개