Maven nie odpala pluginow.

0

Witam, staram się skonfigurowac Mavena w ten sposob zeby podczas fazy generate-source wykonywal "goal" z pluginu maven-processor-plugin. Niestety wgl tego nie robi.

<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<finalName>class-enrolment</finalName>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.4</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.3</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
						<compilerArgument>-proc:none</compilerArgument>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.bsc.maven</groupId>
					<artifactId>maven-processor-plugin</artifactId>
					<executions>
						<execution>
							<id>process</id>
							<goals>
								<goal>process</goal>
							</goals>
							<phase>generate-sources</phase>
							<configuration>
								<outputDirectory>${project.build.directory}/generated-sources/java/jpametamodel</outputDirectory>
								<processors>
									<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
								</processors>
							</configuration>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>org.hibernate</groupId>
							<artifactId>hibernate-jpamodelgen</artifactId>
							<version>${hibernate.version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<executions>
						<execution>
							<id>add-source</id>
							<phase>generate-sources</phase>
							<goals>
								<goal>add-source</goal>
							</goals>
							<configuration>
								<sources>
									<source>${project.build.directory}/generated-sources/java/jpametamodel</source>
								</sources>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>com.mycompany.example</groupId>
					<artifactId>display-maven-plugin</artifactId>
					<version>1.0</version>
					<executions>
						<execution>
							<phase>compile</phase>
							<goals>
								<goal>time</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

potem z eclipsa wywoluje mvn clean install

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building class-enrolment Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ class-enrolment ---
[INFO] Deleting C:\Users\Dawid\git\class-enrollment\target
[INFO] 
[INFO] --- maven-resources-plugin:2.4:resources (default-resources) @ class-enrolment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 23 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ class-enrolment ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 47 source files to C:\Users\Dawid\git\class-enrollment\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.4:testResources (default-testResources) @ class-enrolment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Dawid\git\class-enrollment\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ class-enrolment ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ class-enrolment ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ class-enrolment ---
[INFO] Packaging webapp
[INFO] Assembling webapp [class-enrolment] in [C:\Users\Dawid\git\class-enrollment\target\class-enrolment]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Dawid\git\class-enrollment\src\main\webapp]
[INFO] Webapp assembled in [573 msecs]
[INFO] Building war: C:\Users\Dawid\git\class-enrollment\target\class-enrolment.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ class-enrolment ---
[INFO] Installing C:\Users\Dawid\git\class-enrollment\target\class-enrolment.war to C:\Users\Dawid\.m2\repository\pl\benq\class-enrolment\0.0.1-SNAPSHOT\class-enrolment-0.0.1-SNAPSHOT.war
[INFO] Installing C:\Users\Dawid\git\class-enrollment\pom.xml to C:\Users\Dawid\.m2\repository\pl\benq\class-enrolment\0.0.1-SNAPSHOT\class-enrolment-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.985 s
[INFO] Finished at: 2016-02-16T15:21:46+01:00
[INFO] Final Memory: 24M/216M
[INFO] ------------------------------------------------------------------------

W logach wgl nie widac zeby ten plugin zostal wykorzystany.

0

A to nie ma byc w build ->plugins. Managment służy do określania wersji..chyba

0

Tak, okazauje sie, ze Eclipse ma jakas nakladke na to i jak da sie tak jak Ty mowisz to Eclips wywala blad ale sam Maven dziala jak nalezy;p

1 użytkowników online, w tym zalogowanych: 0, gości: 1