Mam plik pom.xml który używałem kiedyś w innym projekcie, teraz zmieniłem tylko kilka zależności. Nie mogę sobie poradzić z tym żeby została stworzona odpowiednia struktura katalogów src, src/main/java, src/main/resources, src/test/java itd.
Utworzyłem zwykły Java Projekt w Eclipse, przekopiowałem do głównego katalogu projektu pom.xml, z konsoli w katalogu projektu wydałem polecenie mvn install, później mvn eclipse:eclipse i utworzył się tylko katalog target. Nie ściągnęły się nawet zależności (odpowiednie liby) a nie wyświetlił żadnych błędów. Oczywiście sam mvn w systemie jest zainstalowany i plugin mvn w eclipse też. Żadne działanie z poziomu pluginu mvn w eclipse też nic nie daje, żadne update dependencies, snapshot itd....:|
<?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/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion>
<groupId>pl.diagno</groupId>
<artifactId>diagno</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>diagno</name>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>1.6</compilerVersion>
<fork>true</fork>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>apache-repo</id>
<name>Apache Repository</name>
<a href="http://people.apache.org/repo/m2-snapshot-repository">http://people.apache.org/repo/m2-snapshot-repository</a>
</repositories> <dependencymanagement> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.8.1</version> <scope>test</scope> </dependency></repository> <repository> <id>ibiblio</id> <name>iBiblio Maven2 Repository</name> <a href="http://www.ibiblio.org/maven2">http://www.ibiblio.org/maven2</a> </repository> <repository> <id>mavenrepository</id> <name>mavenrepository.com</name> <a href="http://mavenrepository.com">http://mavenrepository.com</a> </repository>
</dependencymanagement> </project><dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.7.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.2.7.ga</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager </artifactId> <version>3.2.7.ga</version> </dependency> <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1</version> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jpa</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> </dependencies>
A to dziwne bo w zakładce która nazywa się Effective POM są zapisy o tych strukturach katalogów:
<build> <sourcedirectory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\src\main\java</sourcedirectory> <scriptsourcedirectory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\src\main\scripts</scriptsourcedirectory> <testsourcedirectory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\src\test\java</testsourcedirectory> <outputdirectory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\target\classes</outputdirectory> <testoutputdirectory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\target\test-classes</testoutputdirectory> <resources> <resource> <directory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\src\main\resources</directory> </resource> </resources> <testresources> <testresource> <directory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\src\test\resources</directory> </testresource> </testresources> <directory>C:\Documents and Settings\xxx\workspace\DiagnoManagment\target</directory>