Quantcast

maven-osgi-compiler-plugin file encoding

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

maven-osgi-compiler-plugin file encoding

treiboll
Hi,

I had problems during test execution based on the encoding. So my first try was to set the following in the POM:

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

But this didn't solve the problem. I was only successful with the following:
<plugin>
	<groupId>org.sonatype.tycho</groupId>
	<artifactId>maven-osgi-compiler-plugin</artifactId>
	<configuration>
		<source>1.6</source>
		<target>1.6</target>
		<encoding>UTF-8</encoding>
	</configuration>
</plugin>

Does the  maven-osgi-compiler-plugin ignore the "project.build.sourceEncoding" property? Because this is the default used by the maven compiler plug-in my assumption is it should be also for the maven-osgi-compiler-plugin.

Regards
Fabian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-compiler-plugin file encoding

Lars Martin
You could use javacDefaultEncoding=..  in your build.properties file. Regards, Lars



Am 17.02.2011 um 10:06 schrieb treiboll <[hidden email]>:

>
> Hi,
>
> I had problems during test execution based on the encoding. So my first try
> was to set the following in the POM:
>
>
> <properties>
>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
>
>
> But this didn't solve the problem. I was only successful with the following:
>
> <plugin>
>    <groupId>org.sonatype.tycho</groupId>
>    <artifactId>maven-osgi-compiler-plugin</artifactId>
>    <configuration>
>        <source>1.6</source>
>        <target>1.6</target>
>        <encoding>UTF-8</encoding>
>    </configuration>
> </plugin>
>
>
> Does the  maven-osgi-compiler-plugin ignore the
> "project.build.sourceEncoding" property? Because this is the default used by
> the maven compiler plug-in my assumption is it should be also for the
> maven-osgi-compiler-plugin.
>
> Regards
> Fabian
> --
> View this message in context: http://software.2206966.n2.nabble.com/maven-osgi-compiler-plugin-file-encoding-tp6035146p6035146.html
> Sent from the Tycho Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: maven-osgi-compiler-plugin file encoding

Sievers, Jan
In reply to this post by treiboll
it seems that tycho uses an outdated copy [1] of AbstractCompilerMojo [2] which still uses

        /**
         * The -encoding argument for the Java compiler
         *
         * @parameter expression="${maven.compiler.encoding}"
         */
        private String encoding;


instead of the more recent

/**
* The -encoding argument for the Java compiler.
*
* @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
*/
private String encoding;


The reason for copying it in the first place is probably related to problems with maven in general when extending mojos from other plugins [3].

@Igor should we open a bug for updating the copy or better solve the problem via extension (if possible)?

Regards,
Jan

[1] https://github.com/sonatype/sonatype-tycho/blob/master/maven-osgi-compiler-plugin/src/main/java/org/codehaus/tycho/osgicompiler/copied/AbstractCompilerMojo.java 
[2] http://svn.apache.org/viewvc/maven/plugins/tags/maven-compiler-plugin-2.3.2/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?view=annotate
[3] http://jira.codehaus.org/browse/MPLUGIN-56 


-----Original Message-----
From: treiboll [mailto:[hidden email]]
Sent: Donnerstag, 17. Februar 2011 10:07
To: [hidden email]
Subject: [Tycho Users] maven-osgi-compiler-plugin file encoding


Hi,

I had problems during test execution based on the encoding. So my first try
was to set the following in the POM:


<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


But this didn't solve the problem. I was only successful with the following:

<plugin>
        <groupId>org.sonatype.tycho</groupId>
        <artifactId>maven-osgi-compiler-plugin</artifactId>
        <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
        </configuration>
</plugin>


Does the  maven-osgi-compiler-plugin ignore the
"project.build.sourceEncoding" property? Because this is the default used by
the maven compiler plug-in my assumption is it should be also for the
maven-osgi-compiler-plugin.

Regards
Fabian
--
View this message in context: http://software.2206966.n2.nabble.com/maven-osgi-compiler-plugin-file-encoding-tp6035146p6035146.html
Sent from the Tycho Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-compiler-plugin file encoding

treiboll
In reply to this post by Lars Martin
Yes, that seems also possible but than I have to edit all my build.properties files instead of editing only the parent POM of all my plug-ins and the associated test fragements of my RCP application.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-compiler-plugin file encoding

Igor Fedorenko-2
In reply to this post by Sievers, Jan
Yes, we need to reconcile Tycho and standard maven compiler parameters,
where it makes sense. Ideally, it would be nice to actually subclass,
but this is not easy with maven plugins.

--
Regards,
Igor

On 11-02-17 04:24 AM, Sievers, Jan wrote:

> it seems that tycho uses an outdated copy [1] of AbstractCompilerMojo [2] which still uses
>
> /**
> * The -encoding argument for the Java compiler
> *
> * @parameter expression="${maven.compiler.encoding}"
> */
> private String encoding;
>
>
> instead of the more recent
>
> /**
> * The -encoding argument for the Java compiler.
> *
> * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
> */
> private String encoding;
>
>
> The reason for copying it in the first place is probably related to problems with maven in general when extending mojos from other plugins [3].
>
> @Igor should we open a bug for updating the copy or better solve the problem via extension (if possible)?
>
> Regards,
> Jan
>
> [1] https://github.com/sonatype/sonatype-tycho/blob/master/maven-osgi-compiler-plugin/src/main/java/org/codehaus/tycho/osgicompiler/copied/AbstractCompilerMojo.java
> [2] http://svn.apache.org/viewvc/maven/plugins/tags/maven-compiler-plugin-2.3.2/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?view=annotate
> [3] http://jira.codehaus.org/browse/MPLUGIN-56
>
>
> -----Original Message-----
> From: treiboll [mailto:[hidden email]]
> Sent: Donnerstag, 17. Februar 2011 10:07
> To: [hidden email]
> Subject: [Tycho Users] maven-osgi-compiler-plugin file encoding
>
>
> Hi,
>
> I had problems during test execution based on the encoding. So my first try
> was to set the following in the POM:
>
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
>
>
> But this didn't solve the problem. I was only successful with the following:
>
> <plugin>
> <groupId>org.sonatype.tycho</groupId>
> <artifactId>maven-osgi-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <encoding>UTF-8</encoding>
> </configuration>
> </plugin>
>
>
> Does the  maven-osgi-compiler-plugin ignore the
> "project.build.sourceEncoding" property? Because this is the default used by
> the maven compiler plug-in my assumption is it should be also for the
> maven-osgi-compiler-plugin.
>
> Regards
> Fabian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: maven-osgi-compiler-plugin file encoding

Sievers, Jan
created https://issues.sonatype.org/browse/TYCHO-586 to track this issue.

-----Original Message-----
From: Igor Fedorenko [mailto:[hidden email]]
Sent: Donnerstag, 17. Februar 2011 16:29
To: [hidden email]
Subject: Re: [Tycho Users] maven-osgi-compiler-plugin file encoding

Yes, we need to reconcile Tycho and standard maven compiler parameters,
where it makes sense. Ideally, it would be nice to actually subclass,
but this is not easy with maven plugins.

--
Regards,
Igor

On 11-02-17 04:24 AM, Sievers, Jan wrote:

> it seems that tycho uses an outdated copy [1] of AbstractCompilerMojo [2] which still uses
>
> /**
> * The -encoding argument for the Java compiler
> *
> * @parameter expression="${maven.compiler.encoding}"
> */
> private String encoding;
>
>
> instead of the more recent
>
> /**
> * The -encoding argument for the Java compiler.
> *
> * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
> */
> private String encoding;
>
>
> The reason for copying it in the first place is probably related to problems with maven in general when extending mojos from other plugins [3].
>
> @Igor should we open a bug for updating the copy or better solve the problem via extension (if possible)?
>
> Regards,
> Jan
>
> [1] https://github.com/sonatype/sonatype-tycho/blob/master/maven-osgi-compiler-plugin/src/main/java/org/codehaus/tycho/osgicompiler/copied/AbstractCompilerMojo.java
> [2] http://svn.apache.org/viewvc/maven/plugins/tags/maven-compiler-plugin-2.3.2/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?view=annotate
> [3] http://jira.codehaus.org/browse/MPLUGIN-56
>
>
> -----Original Message-----
> From: treiboll [mailto:[hidden email]]
> Sent: Donnerstag, 17. Februar 2011 10:07
> To: [hidden email]
> Subject: [Tycho Users] maven-osgi-compiler-plugin file encoding
>
>
> Hi,
>
> I had problems during test execution based on the encoding. So my first try
> was to set the following in the POM:
>
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
>
>
> But this didn't solve the problem. I was only successful with the following:
>
> <plugin>
> <groupId>org.sonatype.tycho</groupId>
> <artifactId>maven-osgi-compiler-plugin</artifactId>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> <encoding>UTF-8</encoding>
> </configuration>
> </plugin>
>
>
> Does the  maven-osgi-compiler-plugin ignore the
> "project.build.sourceEncoding" property? Because this is the default used by
> the maven compiler plug-in my assumption is it should be also for the
> maven-osgi-compiler-plugin.
>
> Regards
> Fabian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: maven-osgi-compiler-plugin file encoding

garyfry
Try using OPS4J's maven-inherit plugin ... I had to tweak the maven-release-plugin for branch support with Perforce, and used this plugin as a starting point to add my tweaks.  It works well, but make sure you read the caveats about it's capabilities!

http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin/

Good luck!

Gary.
Loading...