Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Maven dependencies
Maven dependencies [message #1823396] Thu, 26 March 2020 07:05 Go to next message
Mohan Radhakrishnan is currently offline Mohan RadhakrishnanFriend
Messages: 19
Registered: July 2009
Junior Member
I copied this from the tutorial and it works except for the dependencies like log4J and JUnit. The dependencies don't seem to be recognized. Anything missing here ? Should I use the BOM ?

Thanks,
Mohan

<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>generator</groupId>
	<artifactId>generator-pipeline</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<xtext-version>2.21.0</xtext-version>
	</properties>

	<dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
            <scope>compile</scope>
        </dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.xtend</groupId>
			<artifactId>org.eclipse.xtend.lib</artifactId>
			<version>${xtext-version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<phase>clean</phase>
						<goals>
							<goal>clean</goal>
						</goals>
						<configuration>
							<filesets>
								<fileset>
									<directory>${basedir}/xtend-gen</directory>
								</fileset>
							</filesets>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.xtend</groupId>
				<artifactId>xtend-maven-plugin</artifactId>
				<version>${xtext-version}</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<goal>xtend-install-debug-info</goal>
							<goal>testCompile</goal>
							<goal>xtend-test-install-debug-info</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/xtend-gen</outputDirectory>
							<testOutputDirectory>${project.build.directory}/xtend-gen/test</testOutputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
Re: Maven dependencies [message #1823397 is a reply to message #1823396] Thu, 26 March 2020 07:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13637
Registered: July 2009
Senior Member
what do you mean by "don't seem to be recognized"



Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven dependencies [message #1823399 is a reply to message #1823397] Thu, 26 March 2020 07:57 Go to previous messageGo to next message
Mohan Radhakrishnan is currently offline Mohan RadhakrishnanFriend
Messages: 19
Registered: July 2009
Junior Member
I added the log4j JAR myself from the local repository to Java's build path in eclipse.
Maven command-line still isn't identifying the log4j code. The dependencies section may not be correctly specified.

Thanks.
Re: Maven dependencies [message #1823400 is a reply to message #1823399] Thu, 26 March 2020 07:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13637
Registered: July 2009
Senior Member
can you please provide an example project in github/gitlab/...

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven dependencies [message #1823401 is a reply to message #1823400] Thu, 26 March 2020 08:12 Go to previous messageGo to next message
Mohan Radhakrishnan is currently offline Mohan RadhakrishnanFriend
Messages: 19
Registered: July 2009
Junior Member
It is the 'uncommented' line

//static Logger log = null;
in

https://github.com/mohanr/XTend-Code-Generator/blob/master/src/com/test/generator/SearchPatterns.xtend
Re: Maven dependencies [message #1823405 is a reply to message #1823401] Thu, 26 March 2020 08:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13637
Registered: July 2009
Senior Member
<scope>test</scope>

but the src is a src folder not a test src folder

maybe you want to remove that or mark src as test folder

<goal>add-test-source</goal>


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Maven dependencies [message #1823411 is a reply to message #1823405] Thu, 26 March 2020 08:55 Go to previous message
Mohan Radhakrishnan is currently offline Mohan RadhakrishnanFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks. It worked. Earlier experiments caused that error.

Mohan
Previous Topic:Add EAnnotation in generated Ecore
Next Topic:Cannot set backtrack to false
Goto Forum:
  


Current Time: Sun Oct 25 08:49:53 GMT 2020

Powered by FUDForum. Page generated in 0.01594 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top